pages-gem
pages-gem copied to clipboard
Support for plugin adding anchors?
Hello @benbalter and @parkr! 👋
I was wondering if this project/GitHub would whitelist a simple text plugin that added anchor tags to headings, to allow for linking. Right now, there are only the following options:
- Use Kramdown, which supports this natively
- Con: GitHub uses Commonmark, so there may be some rendering differences
- Incorporate https://github.com/allejo/jekyll-anchor-headings
- Con: Liquid rendering can be a slow process, and for a site with many pages, this adds overhead.
- Con: you must copy-paste a file into your site, preventing the ability for easy updates
- Use a JavaScript solution like anchor.js
- Con: adds unnecessary client-side dependencies
I don't think the plugin I am proposing exists yet, so I'd be happy to write one if it'd be considered for inclusion. Thanks!
Hi! I think we’ve shipped jekyll-commonmark support. Are you able to use that in your site to achieve anchors? markdown: jekyll-commonmark in your _config.yml if I remember correctly.
Oh! I didn't know you supported that. Even better~
Thanks!
Oh, @parkr, I meant adding a information to h tags, not autolinking text URLs.
If GitHub dot com does it, I don't see why we can't add it to jekyll-commonmark or jekyll-commonmark-ghpages!
Looking at the gems, I see how this is immediately possible in jekyll-commonmark-ghpages. What's the difference between the two gems, though? Is -ghpages specifically catered to just a GH Pages environment?
This works for me when I use markdown: CommonMarkGhPages in _config.yml.