Skip to content

Mrcxt/xiabibi-cactus

Repository files navigation

xiabibi-cactus

本主题 fork 自 cactus 主题,项目主页。主题最新版请从原作者处下载,本主题仅做风格上的修改和部分 bug 修复。 fork版本:3.0

说明

主题默认修改为白色,其中所有的修改也是基于白色主题修改的,在其他颜色方案上未做测试。

主题演示

自定义标签演示

更新

    • 修复部分 bug
    • 添加搜索页面
    • 添加 分类页 和 标签页,可在 主题配置 文件中的 nav 选项中控制
    • 修改 bash 命令行样式
    • 添加 live2d 控件
    • 增添部分样式
    • 增添danger类警告窗样式
    • 解决无法添加文章列表页的 bug
    • 新添标签云页面
    • 修改code代码块样式
    • 分离pre代码块样式
    • 添加highlight高亮方案avue.css,样式为 vue 官网风格

------------------------------------ 我是分割线 ------------------------------------

安装

  1. 下载主题文件:

    $ git clone https:/Mrcxt/xiabibi-cactus.git
    
  2. 将主题文件放入themes文件夹中

  3. config.yml中修改theme.

    # theme: landscape
    theme: xiabibi-cactus
  4. 运行命令hexo server -d查看效果吧

关于 live2d

具体配置请参照 live2d 项目

配置

你可以修改_config.yml文件来自定义配置

注意:这里有两种方式来修改。hexo 下的_config.yml和主题下的_config.yml,前者将覆盖后者的变量。

For example:

# _config.yml
theme_config:
  colorscheme: white
# themes/cactus/_config.yml
colorscheme: dark

这将导致主题为白色

你也可以创建新的颜色方案source/css/_colors.

导航栏

Setup the navigation menu in the _config.yml:

nav:
  Home: /
  About: /about/
  Writing: /archives/
  Projects: URL
  LINK_NAME: URL

首页文章列表

你可以决定显示多少条文章在你的首页

  • 只显示最近的 10 条内容

    posts_overview:
      show_all_posts: false
      post_count: 10
  • 显示全部文章

    posts_overview:
      show_all_posts: true

项目列表

可以通过自source/_data/projects.json来展示项目列表,注意是 hexo 下的 source 文件夹,而非主题文件下。

[
    {
        "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 can automatically add links to your social media accounts. Therefore, update the theme's _config.yml:

social_links:
  github: your-github-url
  twitter: your-twitter-url
  NAME: your-NAME-url

where NAME is the name of a Font Awesome icon.

语言

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):

  1. Set language to ja in Hexo configuration file _config.yml
  2. Create a ja.yml file in the themes/cactus/languages/ folder
  3. Copy the content of themes/cactus/languages/default.yml and paste it it into the ja.yml file
  4. Replace all English strings by their Japanese translation

Note: Cactus does not support multi-language sites.

RSS

Set the rss field in the _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 or Baidu Tongji tracking_id to the _config.yml.

google_analytics:
  enabled: true
  id: 'UA-49627206-1'

baidu_analytics:
  enabled: true
  id: 2e6da3c375c8a87f5b664cea6d4cb29c

评论

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

Next, update the _config.yml file:

disqus:
  enabled: true
  shortname: SITENAME

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

代码高亮

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

highlight: COLORSCHEME_NAME

本地搜索

First, install the hexo-generate-search plugin, which will generate a search index file.

$ npm install hexo-generator-search --save

Next, create a page to display the search engine:

$ 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.

nav:
  search: /Search/

License

MIT

About

hexo主题 -- 基于cactus主题修改,自用

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published