mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-19 08:24:40 -04:00
Fix toclayout
This commit is contained in:
parent
9764af5be3
commit
7ae01dbb87
@ -1,5 +1,6 @@
|
||||
{{ define "main" }}
|
||||
{{$title := .Title}}
|
||||
<span id="page-top"></span>
|
||||
<main class="main">
|
||||
{{with .Params.testing }}
|
||||
{{range $ind,$value := . }}
|
||||
|
@ -1,7 +1,9 @@
|
||||
{{ if gt .WordCount 500}}
|
||||
{{ if gt .WordCount 300}}
|
||||
<aside id="toc">
|
||||
<header>
|
||||
<a href="#page-top">
|
||||
<h3>{{.Title}}</h3>
|
||||
</a>
|
||||
</header>
|
||||
{{.TableOfContents}}
|
||||
<a href="#" id="toc-toggle">ToC</a>
|
||||
|
@ -1,15 +1,24 @@
|
||||
$('document').ready(function() {
|
||||
$('.body-copy a[href$=".pdf"]').append('<i class="icon-pdf"></i>');
|
||||
$('.body-copy > h2,.body-copy > h3').each(function() {
|
||||
var id = $(this).attr('id'),
|
||||
baseurl = window.location.origin,
|
||||
path = window.location.pathname,
|
||||
fullurl = `${baseurl}${path}#${id}`;
|
||||
$(this).append(`<a class="smooth-scroll heading-link" data-clipboard-text="${fullurl}" href="#${id}"><i class="icon-link"></i></a>`);
|
||||
$(this).append(`<a class="smooth-scroll heading-link" title="Copy heading link to clipboard" data-clip="${fullurl}" href="#${id}"><i class="icon-link"></i></a>`);
|
||||
});
|
||||
});
|
||||
// const hasCopy = document.execCommand('copy', false, null);
|
||||
// console.log(`${hasCopy} is hasCopy value`);
|
||||
|
||||
$('document').ready(function() {
|
||||
var cliplink = new Clipboard('.heading-link');
|
||||
cliplink.on('success', function(e) {
|
||||
console.log("hello");
|
||||
});
|
||||
});
|
||||
window.setTimeout(function() {
|
||||
// let headLinks = document.querySelector('.heading-link');
|
||||
// for (var i = 0; i < headLinks.length; i++) {
|
||||
// headLinks[i].addEventListener('click', copyHeaderLink, false);
|
||||
// }
|
||||
}, 2000);
|
||||
|
||||
function copyHeaderLink(evt) {
|
||||
let link = evt.target.dataset.clip;
|
||||
console.log(link);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
$(document).ready(function() {
|
||||
// bind click event to all internal page anchors
|
||||
$('a.heading-link,#TableOfContents a').on('click', function(e) {
|
||||
$('a.heading-link,#toc a').on('click', function(e) {
|
||||
// prevent default action and bubbling
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
@ -16,3 +16,5 @@ $(document).ready(function() {
|
||||
location.hash = hashid;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
@ -13,6 +13,7 @@ aside#toc {
|
||||
ul li ul {
|
||||
font-size: .8em;
|
||||
li {
|
||||
margin-top:.5em;
|
||||
a {
|
||||
color: lighten($base-font-color, 25%);
|
||||
}
|
||||
@ -29,7 +30,7 @@ aside#toc {
|
||||
}
|
||||
@include MQ(XL) {
|
||||
top: $site-header-height + 20px;
|
||||
right: 2vw;
|
||||
left: calc(#{$site-navigation-width} + #{$content-max-width} + 3em);
|
||||
|
||||
}
|
||||
@include MQ(HUGE){
|
||||
|
@ -4,7 +4,7 @@ ul.tags {
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
margin-top:-1em;
|
||||
margin-bottom:.5em;
|
||||
margin-bottom:1em;
|
||||
}
|
||||
|
||||
.tags li {
|
||||
|
2
themes/hugodocs/static/css/style.min.css
vendored
2
themes/hugodocs/static/css/style.min.css
vendored
File diff suppressed because one or more lines are too long
6
themes/hugodocs/static/js/script.min.js
vendored
6
themes/hugodocs/static/js/script.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user