Open sean-smith opened 1 year ago
Ok, I can get the behaviour I want with:
{{< rawhtml >}}
<a href='#setup'><h2>Setup</h2></a>
{{< /rawhtml >}}
Instead of:
## Setup
Obviously it would be ideal if this was done at the markdown layer so I don't have to go through and change all my section headers.
Any pointers on how to do that? Basically override the rendering of h1,h2,h3...
headers to render as a link
Ok I implemented this on my site using some custom js, this looks like:
Example: https://swsmith.cc/posts/efa-best-practices.html#what-version-is-best
The code looks like:
https://github.com/sean-smith/swsmith.cc/commit/ea2ac86c466ff60edd49055b6bf72b17e007f9c2
If anyone is interested I'll open a pull request to contribute this back upstream.
Would be great to add a click to create an anchor link to link to subsections. Here's an example:
I would love it if you could click on the
##Setup
and get an anchor link like: https://swsmith.cc/posts/cost-explorer-pcluster.html#setupThe id is already setup so the only feature is to add this as a link to any headers in markdown.