大佬的教程在这里: https://shoka.lostyu.me/computer-science/note/theme-shoka-doc/
# 主题下载
| # 定位到你的目录 | |
| cd blog | |
| # 下载 Shoka 主题 | |
| git clone https://github.com/amehime/hexo-theme-shoka.git ./themes/shoka | 
# 依赖安装
以下都是在 cd blog 后再进行的
# 卸载 hexo 默认的渲染器
| npm un hexo-renderer-marked --save | 
# 安装主题所需的渲染器 hexo-renderer-multi-markdown-it
| npm i hexo-renderer-multi-markdown-it --save --ignore-scripts | 
# 安装其他依赖
| npm install hexo-autoprefixer | |
| npm install hexo-symbols-count-time | |
| npm install hexo-algoliasearch | |
| npm install hexo-feed | |
| npm install cheerio | 
# 依赖配置
可以打开 blog/themes/shoka/example 把里面所有文件都复制到 blog 下,然后 hexo g && hexo s , 再慢慢改
也可以打开 blog/_config.yml 文件,拉到最下面,粘贴下面内容
| # edit for Theme.shoka | |
| autoprefixer: | |
| exclude: | |
| - '*.min.css' | |
| 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: "你知道得太多了" | |
| minify: | |
| html: | |
| enable: true | |
| stamp: false | |
| exclude: | |
| - '**/json.ejs' | |
| - '**/atom.ejs' | |
| - '**/rss.ejs' | |
| css: | |
| enable: true | |
| stamp: false | |
| exclude: | |
| - '**/*.min.css' | |
| js: | |
| enable: true | |
| stamp: false | |
| mangle: | |
| toplevel: true | |
| output: | |
| compress: | |
| exclude: | |
| - '**/*.min.js' | |
| algolia: | |
| appId: #你自己的 | |
| apiKey: #你自己的 | |
| adminApiKey: #你自己的 | |
| chunkSize: 5000 | |
| indexName: adalove | |
| fields: | |
| - title #必须配置 | |
| - path #必须配置 | |
| - categories #推荐配置 | |
| - content:strip:truncate,0,4000 | |
|      - gallery | |
|      - photos | |
|      - tags | |
| feed: | |
| limit: 20 | |
| order_by: "-date" | |
| tag_dir: false | |
| category_dir: false | |
| rss: | |
| enable: true | |
| template: "themes/shoka/layout/_alternate/rss.ejs" | |
| output: "rss.xml" | |
| atom: | |
| enable: true | |
| template: "themes/shoka/layout/_alternate/atom.ejs" | |
| output: "atom.xml" | |
| jsonFeed: | |
| enable: true | |
| template: "themes/shoka/layout/_alternate/json.ejs" | |
| output: "feed.json" | 
algolia 部分需要去 Algolia 注册账号生成一个 key
algolia 配置完毕后
| ## 先运行 | |
| hexo clean && hexo g | |
| ## 生成索引 | |
| hexo algolia | |
| ## 也可以四条一起运行,直接部署 | |
| hexo clean && hexo g && hexo algolia && hexo d | 
还要记得在 _config.yml 中关闭自动高亮
| highlight: | |
| enable: false | |
| prismjs: | |
| enable: false | 
# 修改默认主题为 shoka
修改站点配置文件 blog/_config.yml ,把主题改为 shoka
| theme: shoka | 
