Hacker Plus is a Jekyll theme for GitHub Pages based on The Hacker Theme with added cool new features optimised for those who like to spread their knowledge in the InfoSec or Competitive Programming fields by writing writups/solutions for the problems they have solved during a CTF or Programming Contest
Run the script -> Write in markdown -> Push commit -> The site is generated automatically
You can preview the theme to see what it looks like, or even use it today. You can also visit my personal site to see the theme used in an actual website
The theme is optimised for easy use in VS Code with some useful snippets to reduce the burden
- UI improvements with mobile compatibility
- Scripts for automatic generation of boilerplate templates for each writeup/solution
- Social media links
- Disqus comments section
- Easy google site verification, google analytics integration
- Post share buttons(for Facebook, Twitter and LinkedIn)
- Automatic sitemap generation for improved SEO
- Search by tag functionality
- Anchors for subheadings
- Code markdown using Prism.js instead of rogue
- Line number support
- Code copy and download support
- Syntax highlighting for numerous languages
- Support for font ligatures in code like that for
=>
,!=
, etc.
- Optimisations for CTF Writeups:
- Automatically generate the top level writeups.html page with proper categorisation
- Automatically add side nav bar to show other writeups in the same CTF
- Automatically generate beautiful headers for each writeup
- Optimisations for CP Solutions:
- Automatically fetch and render problem statements from platforms like Codechef
- Automatically generate the top level solutions.html page with proper categorisation
- Automatically add side nav bar to show other solutions in the same contest
- Automatically generate beautiful headers for each solution
Some useful snippets for markdown included in the template project:
Prefix | Description |
---|---|
cmdbashdown | To add a code block with bash prompt and download |
cmdbash | To add a code block with bash prompt |
cmdotherdown | To add a code block with other prompt and download |
cmdother | To add a code block with other prompt |
down | Downloadable code |
linenum | Code block with line numbers |
linenumdown | Downloadable code with line numbers |
To use the Hacker Plus theme:
(Assuming that you have VS Code and python already installed)
- Go to CaptainIRS/hacker-plus-template and click on 'Use this template'. Then fill in the asked details. This repo contains the basic structure, useful snippets for markdown in VS Code and a Gemfile in case you want to build and test the site locally
- Enable GitHub Pages in your repository
- Clone the repo locally and run
git submodule add https://github.com/CaptainIRS/hacker-plus-scripts scripts
to get the required python scripts - Fill in in the desired fields the
_config.yml
file and push the commits to have a working site - To get started, follow the instructions below(in VS Code):
Writing CTF Writeups:
- Open a new terminal window in VS Code and run
cd scripts
- Run
python writeup_gen.py
and fill in the details. The script would generate the required writeup files and asset directory for the CTF and open the required files in VS Code for editing - Write the writeups in markdown and push the commits to your repo
Writing Codechef Problem Solutions:
- Open a new terminal window in VS Code and run
cd scripts
- Run
python codechef_gen.py
and fill in the details. The script would generate the required solution files and open them in VS Code for editing - Write the solutions in markdown and push the commits to your repo
If you'd like to add your own custom styles:
- Create a file called
/assets/css/style.scss
in your site - Add the following content to the top of the file, exactly as shown:
--- --- @import "{{ site.theme }}";
- Add any custom CSS (or Sass, including imports) you'd like immediately after the
@import
line
See the open issues for a list of proposed features (and known issues).
- Support for more CP platforms(Codeforces, TopCoder, etc.)
Contributions are welcome! If you'd like a feature to be added, submit an issue or make a pull request
If you'd like to preview the theme locally (for example, in the process of proposing a change):
- Clone down the theme's repository (
git clone https://github.com/CaptainIRS/hacker-plus-theme
) cd
into the theme's directory- Run
gem install bundler
andbundle install
to install the necessary dependencies - Run
bundle exec jekyll serve
to start the preview server - Visit
localhost:4000
in your browser to preview the theme
The theme is licensed under MIT License