Hexo 插件介绍

这一篇来介绍我都在Hexo中用了哪些插件。

讲讲安装方式和使用技巧。


hexo-renderer-pandoc

在直接使用Hexo的默认markdown渲染器hexo-renderer-marked的时候,会发现因为markdown和\(\LaTeX\)的语法冲突,如\\__,会导致公式部分无法正常渲染。

注意

  • pandoc's markdown 和 standard markdown的语法上有一点点区别。pandoc中似乎需要很多额外的 换行
  • 而且没法混合markdown和html来写了。如原本的## <center>爱小康</center>需要写成<h2><center>爱小康</center></h2>

下面说一下如何安装Pandoc和其hexo插件:

  1. Install Pandoc

    Ubuntu

    Download .deb package on github release to install

    1
    2
    wget https://github.com/jgm/pandoc/releases/download/$Version/pandoc-$Version-amd64.deb
    sudo dpkg -i pandoc-$Version-amd64.deb

    MacOS using Homebrew

    1
    brew install pandoc
  2. Uninstall hexo-renderer-marked

    1
    npm uninstall hexo-renderer-marked --save

  3. Install hexo-renderer-pandoc

    1
    npm install hexo-renderer-pandoc --save

Reference

https://segmentfault.com/a/1190000007261752


This plugin is used for generating a search index file, which contains all the necessary data of your articles that you can use to write a local search engine for your blog.

This plugin is designed to hide posts, which means the posts will not be shown on article lists, the homepage, or search results.

Install

1
npm install hexo-generator-search --save

hexo-deployer-git

A git deplyer plugin for Hexo to deploy to especially github.

Install

1
npm install hexo-deployer-git --save

Tips

A sample configuration of this plugin in _config.yml.

1
2
3
4
5
deploy:
type: git
# Since password method was removed on github, please use SSH instead.
repo: git@github.com:gangxing1996/blogangxing.git
branch: main

Convert Markdown style asset links to HTML style ones.

Install

1
npm i -s hexo-asset-link