🚀快速开始 -->🌈基本配置 -->🏆界面显示 -->🎨特殊功能

# 快速安装

# cd 到你的博客根目录
git clone https://github.com/amehime/hexo-theme-shoka.git ./themes/shoka

# 安装依赖插件

在使用主题前,需要安装以下插件

插件名称npm 地址功能依赖程度
hexo-renderer-multi-markdown-it链接md 文件渲染器,压缩 css/js/html必需
hexo-autoprefixer链接给生成的 css 文件们添加浏览器前缀必需
hexo-algoliasearch链接站内搜索功能搜索按钮失效
hexo-symbols-count-time链接文章或站点字数及阅读时间统计没有统计功能
hexo-feed链接生成 Feed 文件无法生成 Feed 文件

# multi-markdown-it 安装与配置

# 安装

  1. 安装前,需要卸载默认的 hexo-renderer-marked ,以及其他的 md 文件渲染器
npm un hexo-renderer-marked --save
  1. 安装插件
npm i hexo-renderer-multi-markdown-it -D

# 配置

  1. 加入 markdown 配置,用于渲染 md 文件,文件位置 <root>/_config.yml
markdown:
  render: # 渲染器设置
    html: false # 过滤 HTML 标签
    xhtmlOut: true # 使用 '/' 来闭合单标签 (比如 <br />)。
    breaks: true # 转换段落里的 '\n' 到 <br>。
    linkify: true # 将类似 URL 的文本自动转换为链接。
    typographer:
    quotes: "“”‘’"
  plugins: # markdown-it 插件设置
    - plugin:
        name: markdown-it-toc-and-anchor
        enable: true
        options: # 文章目录以及锚点应用的 class 名称,shoka 主题必须设置成这样
          tocClassName: "toc"
          anchorClassName: "anchor"
    - plugin:
        name: markdown-it-multimd-table
        enable: true
        options:
          multiline: true
          rowspan: true
          headerless: true
    - plugin:
        name: ./markdown-it-furigana
        enable: true
        options:
          fallbackParens: "()"
    - plugin:
        name: ./markdown-it-spoiler
        enable: true
        options:
          title: "你知道得太多了"
  1. 加入 minify 配置,压缩代码
minify:
  html:
    enable: true
    exclude: # 排除 hexo-feed 用到的模板文件
      - "**/json.ejs"
      - "**/atom.ejs"
      - "**/rss.ejs"
  css:
    enable: true
    exclude:
      - "**/*.min.css"
  js:
    enable: true
    mangle:
      toplevel: true
    output:
    compress:
    exclude:
      - "**/*.min.js"
  1. 停用默认的代码高亮功能,否则代码块的 mac 样式不能正常显示
    找到 hightlightprismjs ,把 enable 改为 false
highlight:
  enable: false
prismjs:
  enable: false

# autoprefixer 配置

autoprefixer:
  exclude:
    - "*.min.css"

如果没有这个插件,首页卡片翻转效果无法正常显示

# 应用主题


# 替换默认主题

修改站点配置文件 <root>/_config.yml ,把主题修改为 shoka

# 修改主题配置

shoka 主题默认的参数在 <root>/thems/shoha/_config.yml 中。

为了方便对主题进行配置,在根目录下新建一个 yml 文件,文件名为 _config.shoka.yml

更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

津渡烛影深 微信支付

微信支付

津渡烛影深 支付宝

支付宝

津渡烛影深 贝宝

贝宝