All in one theme renderers and helpers for hexo. Load all hexo renderer engines at once.
- use any type layout inside source
- more custom helpers
- related post helpers examples
- auto fix post assets folder
- renderer cache strategy
Custom markdown-it
from https://github.com/dimaslanjaka/markdown-it
This only required when you add
markdown-it
on_config_yml.renderers.engine
yarn add markdown-it@https://github.com/dimaslanjaka/markdown-it/raw/17ccc825cbb3e4c6d59edada5f6d93f27075d752/release/markdown-it.tgz
Change hash with latest commit hash
Why must change?
Original
markdown-it
now only support for ESM, we need shimmarkdown-it
into CommonJS
You can specify some renderers by _config.yml
renderers:
engines: ['ejs', 'stylus', 'nunjucks', 'dartsass', 'pug', 'sass', 'markdown-it', 'rollup', 'marked']
generator:
# enable generate <domain>/meta.json
- meta
# enable generate related posts
- related-posts
fix:
# Fix html
# - fix invalid post asset folder path
# - escape invalid html tags into html entities
html: false
# Toggle cache
cache: false
# when _config_yml.renderers.fix.html is true
# this plugin transforming unknown tags into html entities
# add custom html tag names to avoid from transformation
# reference src\markdown-it\renderer.ts
# reference src\markdown-it\html-tags.js
html_tags: ['customtag', 'custom-html-tag']
Configuration for markdown-it
engine
markdown:
preset: default
# Toggle render nunjucks in markdown
disableNunjucks: true
render:
html: true
xhtmlOut: false
# prefix class of <pre><code class="language-">
langPrefix: language-
breaks: true
# auto convert url plaintext into anchor
linkify: false
typographer: true
quotes: “”‘’
# Toggle cache
cache: true
enable_rules: null
disable_rules: null
plugins:
- markdown-it-abbr
- markdown-it-attrs
- markdown-it-bracketed-spans
- markdown-it-sup
- markdown-it-cjk-breaks
- markdown-it-sub
- markdown-it-deflist
- markdown-it-footnote
- markdown-it-ins
- markdown-it-mark
- name: "@renbaoshuo/markdown-it-katex"
options:
skipDelimitersCheck: true
- name: markdown-it-emoji
options:
shortcuts:
laughing: :D
smile: [":)", ":-)"]
# - name: markdown-it-table-of-contents
# options:
# includeLevel:
# - 1
# - 2
# - 3
# - 4
# - 5
# - 6
anchors:
level: 2
collisionSuffix: ""
permalink: false
permalinkClass: header-anchor
permalinkSide: left
permalinkSymbol: ¶
case: 0
separator: "-"
images:
lazyload: false
prepend_root: false
post_asset: true
inline: false # https://markdown-it.github.io/markdown-it/#MarkdownIt.renderInline
This marked renderer is improved from hexo-renderer-marked.
Configuration for marked
engine same as hexo-renderer-marked - read here
NOTE: this plugin add
cache
options
marked:
cache: true # default false
# rest of marked options
dartsass
improved from hexo-renderer-dartsasssass
improved from hexo-renderer-sass
set config for your desired renderer engine.
- Drop activating all engines by default. All engine follows
_config_yml.renderers.engine
- Separate html fixer
- Fix post asset folder fixer
- migrate to ESM with shim for CommonJS
- fix: escape invalid html tag curly brackets on hyperlink text to html entities
- feat: auto fix post assets folder
- chore: disable
rollup
renderer by default
- feat: support for hexo 7.3.0
- update dependencies (except markdown-it)
- fix maximum call stack exceeded
- change options structure
- add
meta.json
generator which available athttp://example.com/meta.json
- add related post helper
- fix: invalid default markdown options
- fix: cannot find installed
markdown-it
plugins
- improved
dartsass
- add and improved
hexo-renderer-sass
- optimize docs
- add more helpers
- hotfix known issues
- add
hexo-renderer-markdown-it
- hotfix nunjucks renderer
- update dependencies