mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Add automatic anchor symbols using anchorjs
This commit is contained in:
6
_includes/anchorjs.html
Normal file
6
_includes/anchorjs.html
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<script type="text/javascript">
|
||||||
|
anchors.options = {
|
||||||
|
placement: 'left',
|
||||||
|
};
|
||||||
|
anchors.add('article h2, article h3, article h4, article h5, article h6');
|
||||||
|
</script>
|
||||||
@@ -22,4 +22,7 @@
|
|||||||
|
|
||||||
<!-- RSS -->
|
<!-- RSS -->
|
||||||
<link rel="alternate" type="application/atom+xml" title="{{ site.title }}" href="{{ site.baseurl }}/atom.xml">
|
<link rel="alternate" type="application/atom+xml" title="{{ site.title }}" href="{{ site.baseurl }}/atom.xml">
|
||||||
|
|
||||||
|
<!-- JS -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/2.0.0/anchor.min.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -8,4 +8,5 @@ layout: default
|
|||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
{% include disqus.html %}
|
{% include disqus.html %}
|
||||||
|
{% include anchorjs.html %}
|
||||||
</article>
|
</article>
|
||||||
|
|||||||
@@ -19,4 +19,5 @@ layout: default
|
|||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
{% include disqus.html %}
|
{% include disqus.html %}
|
||||||
|
{% include anchorjs.html %}
|
||||||
</article>
|
</article>
|
||||||
|
|||||||
@@ -47,6 +47,10 @@ a {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a.anchorjs-link:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
display: block;
|
display: block;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
|||||||
Reference in New Issue
Block a user