Home

Awesome

hexo-renderer-pandoc_header-link-filter

This project provides a Lua filter for Hexo's Pandoc renderer to add header links to your files to show the anchor icon.
<img width="898" alt="image" src="https://github.com/user-attachments/assets/5a7a3e71-d8c9-403f-8cc7-ace40742d41f">

Usage

  1. 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.

  2. Update your _config.yml to include the Lua filter along with other Pandoc arguments. If you placed the header-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'

Notes

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.