Cactus-Dark主题使用帮助

Cactus Dark

A responsive, dark and simple Hexo theme for a personal website.

:cactus: Demo

cactus-dark

Summary

General

  • Version : 2.0
  • Compatibility : Hexo 3 or later

Features

  • Fully responsive
  • Disqus
  • Googe analytics
  • Font Awesome icons
  • Pick your own code highlighting scheme
  • Configurable navigation menu
  • Support for local search
  • Projects list
  • Simplicity

Install

  1. In the root directory:

    1
    2
    $ git clone https://github.com/probberechts/cactus-dark.git themes/cactus-dark
    $ npm install hexo-pagination --save
  2. Change the theme property in the config.yml file.

    1
    2
    # theme: landscape
    theme: cactus-dark
  3. Run: hexo generate and hexo server

Configuration

Setup the navigation menu in the theme’s _config.yml:

1
2
3
4
5
6
nav:
Home: /
About: /about/
Writing: /archives/
Projects: http://github.com/probberechts
LINK_NAME: URL

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
    3
    customize:
    show_all_posts: false
    post_count: 5
  • Show all posts

    1
    2
    customize:
    show_all_posts: true

Projects list

Create a projects file source/_data/projects.json.

1
2
3
4
5
6
7
8
9
10
11
12
[
{
"name":"Hexo",
"url":"https://hexo.io/",
"desc":"A fast, simple & powerful blog framework"
},
{
"name":"Font Awesome",
"url":"http://fontawesome.io/",
"desc":"The iconic font and CSS toolkit"
}
]

Cactus Dark can automatically add links to your social media accounts. Therefore, update the theme’s _config.yml:

1
2
3
4
5
customize:
social_links:
github: your-github-url
twitter: your-twitter-url
NAME: your-NAME-url

where NAME is the name of a Font Awesome icon.

RSS

Set the rss field in the theme’s _config.yml to one of the following values:

  1. rss: false will totally disable rss (default).
  2. rss: atom.xml sets a specific feed link.
  3. rss:leave empty to use the hexo-generator-feed plugin.

Analytics

Add you Google Analytics tracking_id to the theme’s _config.yml.

1
2
plugins:
gooogle_analytics: 'UA-49627206-1' # Format: UA-xxxxxx-xx

Comments

First, create a site on Disqus: https://disqus.com/admin/create/.

Next, update the theme’s _config.yml file:

1
2
plugins:
disqus_shortname: SITENAME

where SITENAME is the name you gave your site on Disqus.

Code Highlighting

Pick one of the available colorschemes and add it to the theme’s _config.yml:

1
2
customize:
highlight: COLORSCHEME_NAME

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 theme’s _config.yml and add a link to the navigation menu.

1
2
3
4
nav:
...
Search: /Search/
...

License

MIT