config for hide header links
This commit is contained in:
parent
5e2ff37e94
commit
e9a24f95ec
|
@ -50,8 +50,9 @@
|
||||||
})
|
})
|
||||||
}());
|
}());
|
||||||
|
|
||||||
/* Add "link here" links to <h2> headings */
|
{{ if not .Site.Params.hideHeaderLinks }}
|
||||||
(function () {
|
/* Add "link here" links to <h2> headings */
|
||||||
|
(function () {
|
||||||
var headings = document.querySelectorAll('main > h2');
|
var headings = document.querySelectorAll('main > h2');
|
||||||
|
|
||||||
Array.prototype.forEach.call(headings, function (heading) {
|
Array.prototype.forEach.call(headings, function (heading) {
|
||||||
|
@ -69,7 +70,6 @@
|
||||||
|
|
||||||
var link = document.createElement('a');
|
var link = document.createElement('a');
|
||||||
link.setAttribute('href', '#' + id);
|
link.setAttribute('href', '#' + id);
|
||||||
var headingText = heading.textContent;
|
|
||||||
link.innerHTML = '<svg aria-hidden="true" class="link-icon" viewBox="0 0 50 50" focusable="false"> <use xlink:href="#link"></use> </svg>';
|
link.innerHTML = '<svg aria-hidden="true" class="link-icon" viewBox="0 0 50 50" focusable="false"> <use xlink:href="#link"></use> </svg>';
|
||||||
|
|
||||||
container.appendChild(link);
|
container.appendChild(link);
|
||||||
|
@ -77,7 +77,8 @@
|
||||||
heading.parentNode.removeChild(heading);
|
heading.parentNode.removeChild(heading);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}());
|
}());
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
/* Enable scrolling by keyboard of code samples */
|
/* Enable scrolling by keyboard of code samples */
|
||||||
(function () {
|
(function () {
|
||||||
|
|
|
@ -25,6 +25,7 @@ params:
|
||||||
codePenUser: someUser
|
codePenUser: someUser
|
||||||
katex: true
|
katex: true
|
||||||
darkThemeAsDefault: false
|
darkThemeAsDefault: false
|
||||||
|
hideHeaderLinks: false
|
||||||
# A list of custom css files can be provided, which must be placed inside
|
# A list of custom css files can be provided, which must be placed inside
|
||||||
# 'static/'.
|
# 'static/'.
|
||||||
# This is useful to override just specific css classes, instead of copying
|
# This is useful to override just specific css classes, instead of copying
|
||||||
|
|
Loading…
Reference in New Issue
Block a user