This project provides a Lua filter for Hexo's Pandoc renderer to add header links to your files to show the anchor icon.
-
Download the
header-link-filter.lua
script from this repository and add it to your Hexo project. We recommend placing it in the./source/_data
directory for organization, but you can choose a location that suits your project structure. -
Update your
_config.yml
to include the Lua filter along with other Pandoc arguments. If you placed theheader-link-filter.lua
file in a different location, make sure to update the path accordingly:
pandoc:
args:
- "-f"
- "markdown"
- "-t"
- "html"
- "--mathjax"
- '--lua-filter'
- './source/_data/header-link-filter.lua'
This filter is an opt-in feature and is not hard-coded into the source code of the hexo-renderer-pandoc plugin. This allows for greater flexibility and customization based on individual project needs.