Cactus-guide
Cactus
A responsive, clean and simple Hexo theme for a personal website.
:cactus: Demo
Summary
General Bastian Molkenthin
- Version : 3.0
- Compatibility : Hexo 3 or later
Features
- Fully responsive
- Multiple color schemes
- Pick your own code highlighting scheme
- Configurable navigation menu
- Support for local search
- Projects list
- I18n support
- Disqus integration
- Google analytics / Baidu Tongji
- Font Awesome icons
- Simplicity
Install
In the
root
directory:1
$ git clone https://github.com/probberechts/hexo-theme-cactus.git themes/cactus
Change the
theme
property in theconfig.yml
file.1
2# theme: landscape
theme: cactusRun:
hexo generate
andhexo server
Configuration
You can (and should) modify a couple of settings. An overview of all settings
can be found in _config.yml. The most important ones are
discussed below.
There are two possible methods to override these variables. As a first option,
you could fork the theme and maintain a custom branch with your settings.
Alternatively, you can configure it from your site’s primary configuration
file. Therefore, define you custom settings under the theme_config
variable.
For example:
1 | # _config.yml |
1 | # themes/cactus/_config.yml |
This will result in the white color scheme.
Color scheme
Currently, this theme is delivered with four color schemes: dark, light,
white and classic. Set your preferred color scheme in the _config.yml
file.
1 | colorscheme: light |
Alternatively, you can easily create your own color scheme by creating a new
file in source/css/_colors
.
Navigation
Setup the navigation menu in the _config.yml
:
1 | nav: |
Blog posts list on home page
You have two options for the list of blog posts on the home page:
Show only the 5 most recent posts (default)
1
2
3posts_overview:
show_all_posts: false
post_count: 5Show all posts
1
2posts_overview:
show_all_posts: true
Projects list
Create a projects file source/_data/projects.json
to show a list of your projects on the index page.
1 | [ |
Social media links
Cactus can automatically add links to your social media accounts.
Therefore, update the theme’s _config.yml
:
1 | social_links: |
where NAME
is the name of a Font Awesome icon.
Language configuration
If you are new to Hexo and internationalization (i18n), please read
Hexo documentation - internationalization (i18n) section
Currently, the theme is delivered with support for:
- English (en), default
- Chinese (Simplified, PRC) (zh-CN)
- Dutch (nl)
- French (fr)
- Persian (fa)
- Russian (ru)
- Spanish (es)
If you would like to use one the languages listed above, simply set language
to the desired language (e.g., fr
) in _config.yml
.
Otherwise, you can follow the steps below (E.g., to add a Japanese (ja) translation):
- Set
language
toja
in Hexo configuration file_config.yml
- Create a
ja.yml
file in thethemes/cactus/languages/
folder - Copy the content of
themes/cactus/languages/default.yml
and paste it it into theja.yml
file - Replace all English strings by their Japanese translation
Note: Cactus does not support multi-language sites.
RTL support
This theme support RTL languages for Persian and Arabic language.
If you would like to use RTL layout, change direction
attribute in _config.yml
to rtl
.
Note that this also will change the font to Vazir, wich is a Persian font.
1 | direction: rtl |
RSS
Set the rss
field in the _config.yml
to one of the following values:
rss: false
will totally disable rss (default).rss: atom.xml
sets a specific feed link.rss:
leave empty to use the hexo-generator-feed plugin.
Analytics
Add you Google Analytics or Baidu Tongji tracking_id
to the _config.yml
.
1 | google_analytics: |
Comments
First, create a site on Disqus: https://disqus.com/admin/create/.
Next, update the _config.yml
file:
1 | disqus: |
where SITENAME
is the name you gave your site on Disqus.
Code Highlighting
Pick one of the available colorschemes and add it to the _config.yml
:
1 | highlight: COLORSCHEME_NAME |
Local search
First, install the hexo-generate-search
plugin, which will generate a search index file.
1 | $ npm install hexo-generator-search --save |
Next, create a page to display the search engine:
1 | $ hexo new page Search |
and put search: true
in the front-matter.
Finally, edit the _config.yml
and add a link to the navigation menu.
1 | nav: |
License
MIT