Update toc styles

This commit is contained in:
Ryan Watters
2017-02-13 19:03:14 -08:00
parent 513a785248
commit 9764af5be3
14 changed files with 78 additions and 91 deletions
+3 -3
View File
@@ -17,10 +17,10 @@ Hugo v0.15 and later are released under the Apache 2.0 license.
Earlier releases were under the Simple Public License.
{{% /note %}}
_Version 2.0, January 2004_
_&lt;<http://www.apache.org/licenses/>&gt;_
_Version 2.0, January 2004_ <br>
<http://www.apache.org/licenses/LICENSE-2.0>
## Terms and Conditions for use, reproduction, and distribution
*Terms and Conditions for use, reproduction, and distribution*
## 1. Definitions
+1 -1
View File
@@ -5,7 +5,7 @@ description: Archetypes allow you to create and set default parameters from the
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-01
tags: [archetypes,generators]
tags: [archetypes,generators,metadata,front matter]
categories: [content]
weight: 50
draft: false
+1 -1
View File
@@ -62,7 +62,7 @@ gulp.task("image-resize", () => {
gulp.task('scripts', function(cb) {
pump([
gulp.src(['js/utils.js', 'js/_velocity.min.js', 'js/_velocity.ui.min.js', 'js/scripts/*.js']),
gulp.src(['js/_clipboard.js', 'js/_velocity.min.js', 'js/_velocity.ui.min.js', 'js/scripts/*.js']),
// sourcemaps.init(),
babel({
presets: ['es2015']
@@ -1,25 +1,15 @@
$('.body-copy a[href$=".pdf"]').append('<i class="icon-pdf"></i>');
$('.body-copy > h2,.body-copy > h3').each(function() {
var id = $(this).attr('id');
$(this).append('<a class="smooth-scroll heading-link" href="#' + id + '"><i class="icon-link"></i></a>');
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>`);
});
$(document).ready(function () {
// bind click event to all internal page anchors
$('a.heading-link,#TableOfContents a').on('click', function (e) {
// prevent default action and bubbling
e.preventDefault();
e.stopPropagation();
// set target to anchor's "href" attribute
var target = $(this).attr('href');
var hashid = target.split('#')[1];
// scroll to each target
$(target).velocity('scroll', {
duration: 500,
offset: -50,
easing: 'ease-in-out'
});
location.hash = hashid;
});
$('document').ready(function() {
var cliplink = new Clipboard('.heading-link');
cliplink.on('success', function(e) {
console.log("hello");
});
});
@@ -0,0 +1,18 @@
$(document).ready(function() {
// bind click event to all internal page anchors
$('a.heading-link,#TableOfContents a').on('click', function(e) {
// prevent default action and bubbling
e.preventDefault();
e.stopPropagation();
// set target to anchor's "href" attribute
var target = $(this).attr('href');
var hashid = target.split('#')[1];
// scroll to each target
$(target).velocity('scroll', {
duration: 500,
offset: -50,
easing: 'ease-in-out'
});
location.hash = hashid;
});
});
-38
View File
@@ -1,38 +0,0 @@
//Utility functions (when not using jQuery)
let byId = function(id) {
return document.getElementById(id);
};
let qs = function(sel) {
return document.querySelector(sel);
};
let qsa = function(sel) {
return document.querySelectorAll(sel);
}
//browser sniff
function getMobileOperatingSystem() {
var userAgent = navigator.userAgent || navigator.vendor || window.opera;
// Windows Phone must come first because its UA also contains "Android"
if (/windows phone/i.test(userAgent)) {
return "Windows Phone";
}
if (/android/i.test(userAgent)) {
return "Android";
}
// iOS detection from: http://stackoverflow.com/a/9039885/177710
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
return "iOS";
return "notMobile";
}
}
function urlize(item) {
if (typeof item == "string") {
return item.replace(/[^\w\s\-]/gi, '').toLowerCase().replace(' ', '-');
} else if (item instanceof HTMLElement) {
return item.textContent.replace(/[^\w\s\-]/gi, '').toLowerCase().replace(' ', '-');
}
}
@@ -5,7 +5,7 @@ $S:480px;
$SM: 560px;
$M:760px;
$L:960px;
$XL:1200px;
$XL:1240px;
$HUGE:1600px;
//Color Palette
@@ -61,7 +61,7 @@ $inline-code-background-color:lighten($hugo-gray-light,21%);
//Sidebar
$site-navigation-width: 280px;
$content-max-width: 31em;
$content-max-width: 34em;
//Header
$site-header-height:50px;
@@ -7,31 +7,36 @@ h4 {
font-weight: $heading-font-weight;
margin: 0px;
line-height: 1.4;
position: relative;
}
h1.page-title {
font-size: 2em;
letter-spacing: -.021em;
padding-bottom:.75em;
padding-bottom: .75em;
@include MQ(M) {
font-size: 2.25em;
padding-top: 1em;
}
}
h2,
h3 {
padding-bottom: 24px;
padding-right:1.5em;
}
h2 {
font-size: 1.5em;
padding-bottom: 24px;
}
h3 {
font-size: 1.2em;
padding-bottom: 24px;
}
h4 {
font-size: 1em;
padding-top:50px;
padding-top: 50px;
color: $hugo-gray;
text-transform: uppercase;
}
@@ -46,17 +46,21 @@ a {
border-bottom: 1px solid $default-anchor-color;
}
}
a.heading-link {
color:lighten($base-font-color,40%);
font-size:.8em;
position:relative;
left:.3em;
bottom:.05em;
&:before,&:after {
display:none;
}
&:hover {
color:$default-anchor-color;
}
}
//heading links are added on the client (see pipeline/js/scripts/add-icons-to-external-links-and-pdfs-anchors.js)
a.heading-link {
color: lighten($base-font-color, 50%);
font-size: .8em;
position: relative;
display:inline;
top:-.1em;
right:0px;
&:before,
&:after {
display: none;
}
&:hover {
color: $default-anchor-color;
}
}
@@ -1,15 +1,17 @@
aside#toc {
position: fixed;
max-width: 300px;
max-width: 280px;
min-width:200px;
overflow-y:scroll;
padding-left:1em;
nav {
float:left;
overflow-y:scroll;
ul {
margin-top: .5em;
}
ul li ul {
font-size: .9em;
font-size: .8em;
li {
a {
color: lighten($base-font-color, 25%);
@@ -27,7 +29,12 @@ aside#toc {
}
@include MQ(XL) {
top: $site-header-height + 20px;
right: 3vw;
right: 2vw;
}
@include MQ(HUGE){
max-width:320px;
right:10vw;
}
}
@@ -28,9 +28,9 @@ main.main {
max-width: $content-max-width;
position: relative;
min-height:calc(100vh - #{$site-header-height * 2});
overflow-x: hidden;
@include MQ(L){
margin-left:1em;
// overflow-x: hidden;
@include MQ(XL) {
margin-left: 2em;
}
}
@@ -109,6 +109,7 @@ header.content-header {
.body-copy {
margin-bottom: 2.5em;
display: block;
overflow: visible;
div + h2 {
margin-top: 1em;
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long