更改hexo-renderer

原因

因為無法用hexo原本的hexo-renderer-marked去顯示html的部分
所以改用hexo-renderer-markdown-it

方案

之前可能設置錯誤,有時render失敗,目前採用下面的配置就穩定了

在hexo的_config.yml加上以下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
markdown:
render:
html: true # Doesn't escape HTML content so the tags will appear as html.(開啟好讓dataframe的表格能夠使用)
xhtmlOut: false # Parser will not produce XHTML compliant code.
breaks: true # Parser produces `<br>` tags every time there is a line break in the source document.
linkify: false # Returns text links as text.
typographer: true # Substitution of common typographical elements will take place.
quotes: '“”‘’' # "double" will be turned into “single”
# 'single' will be turned into ‘single’
plugins:
#以下啟用套件 需另外下載
#+ markdown-it-abbr
#+ markdown-it-checkbox
#+ markdown-it-emoji
#+ markdown-it-footnote
#+ markdown-it-ins
#+ markdown-it-sub
#+ markdown-it-sup
anchors:
level: 2 # Minimum level for ID creation. (Ex. h2 to h6)
collisionSuffix: 'v' # A suffix that is prepended to the number given if the ID is repeated.
permalink: true # If true, creates an anchor tag with a permalink besides the heading.
permalinkClass: header-anchor # Class used for the permalink anchor tag.
permalinkSymbol: ¶ # The symbol used to make the permalink.

Reference

hexo-renderer-marked
hexo-renderer-markdown-it
設置參考

本文地址: https://david6686.github.io/blog/silentink/18958/

加個打賞功能,說不定真的有好心人~