NixNet/_layouts/post.html

28 lines
684 B
HTML
Raw Permalink Normal View History

2018-12-14 05:47:01 +00:00
---
layout: default
---
2019-06-04 17:52:49 +00:00
2018-12-14 05:47:01 +00:00
{% include post/title.html %}
<div class="content">
{{ content }}
</div>
2019-06-06 13:28:38 +00:00
<script>
document.querySelectorAll('.content h1, .content h2, .content h3').forEach($heading => {
// get id from headings
var id = $heading.getAttribute("id") || $heading.innerText.toLowerCase().replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, '').replace(/ +/g, '-');
// create anchors for id
$anchor = document.createElement('a');
$anchor.className = "headerlink";
$anchor.href = '#' + id;
2018-12-14 05:47:01 +00:00
2019-06-06 13:28:38 +00:00
// prepend anchor to heading text
$heading.prepend($anchor);
});
</script>
2018-12-14 05:47:01 +00:00
{% include post/about.html %}
2019-10-15 18:47:05 +00:00
<br/>
<br/>
2019-06-06 13:28:38 +00:00
<img class="post-image" src="{{ page.cover }}">