跳到主要内容

Website render with pandoc and citeproc

· 阅读需 1 分钟

Recently, I rebuilt my blog with Hexo engine from Jekyll, and I forked hexo-theme-fluid.

However, I had an issue in rendering bibliography with the default render engine. I check the official document from Hexo and pandoc, and motivatited by the discuss.

I switch the render engine from marked to pandoc by:

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

Then, I add the following code to the _config.yml file:

pandoc:
filters:
extra:
- citeproc:
- bibliography: "biblio.bib"
- csl: "chicago.csl"
template:
meta:
- linkCitations: true
- reference-section-title: Reference
- notes-after-punctuation: true

Remember to add the biblio.bib and chicago.csl files to the root directory of your web not /source.

When you want to cite a paper, you only need to enter the entrykey @paper1 or [@paper1]. The paper will render a list of reference below the last section of the page.