blob: 713826267cdaa340ebfc51848abde7f2ef4b3186 (
about) (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
|
Jekyll::Hooks.register [:documents, :pages], :post_render do |doc|
if doc.output_ext == ".html" && doc.type != :slides
lang = doc.data["lang"]
alt = doc.site.site_payload["site"]["t"]["alt"]["link_icon"][lang]
doc.output =
doc.output.gsub(
/<h([1-6])(.*?)id="([\w-]+)"(.*?)>(.*?)<\/h[1-6]>/,
'<div class="header-anchor"><h\1\2id="\3"\4>\5</h\1><a href="#\3"><img class="simple-icon" src="/static/link.svg" aria-hidden="true" alt="' + alt + '" /></a></div>'
)
end
end
|