Hexo配置
yatbfm

插件安装

1
npm install hexo-asset-img --save

该插件可以将相对路径转换为绝对路径使得浏览器可以访问到。

配置Hexo

修改根目录下的_config.yml文件。

post_asset_folder设置为true。该配置会在使用hexo new "filename"时自动生成同名的文件夹保存资源。

配置Typora

将Typora的图像设置改为保存到与该文件同目录的同名文件夹中。

Hexo配置渲染数学公式

  1. 卸载默认渲染器,安装Pandoc渲染器

    1
    2
    npm uninstall hexo-renderer-marked --save
    npm install hexo-renderer-pandoc --save

  2. 安装mathjax包

    1
    npm install hexo-filter-mathjax

  3. 在根目录_config.yml下添加

    1
    2
    3
    4
    5
    6
    7
    mathjax:
    tags: none # or 'ams' or 'all'
    single_dollars: true # enable single dollar signs as in-line math delimiters
    cjk_width: 0.9 # relative CJK char width
    normal_width: 0.6 # relative normal (monospace) width
    append_css: true # add CSS to every page
    every_page: true # if true, every page will be rendered by mathjax regardless the `mathjax` setting in Front-matter of each article

  4. 在博客front-matter上添加

    1
    mathjax: true

配置显示emoji

安装库

npm install hexo-filter-emoji

_config.yml添加以下内容:

1
2
3
4
5
6
# hexo-filter-emoji
emoji:
enable: true
className: github-emoji
styles:
customEmojis:
由 Hexo 驱动 & 主题 Keep
访客数 访问量