Merge commit '5ac0f751aa47e52625662215f66efa99a6abfc2e'

This commit is contained in:
Bjørn Erik Pedersen
2019-10-21 10:52:23 +02:00
228 changed files with 9645 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,16 @@
.header-link:after {
position: relative;
left: 0.5em;
opacity: 0;
font-size: 0.8em;
-moz-transition: opacity 0.2s ease-in-out 0.1s;
-ms-transition: opacity 0.2s ease-in-out 0.1s;
}
h2:hover .header-link,
h3:hover .header-link,
h4:hover .header-link,
h5:hover .header-link,
h6:hover .header-link {
opacity: 1;
}

View File

@@ -0,0 +1,21 @@
.animated {
animation-duration: .5s;
animation-fill-mode: forwards;
animation-timing-function: ease-in-out;
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.fadeIn {
animation-name: fadeIn;
}
.animated-delay-1 {
animation-delay: 0.5s;
}

View File

@@ -0,0 +1,25 @@
/* These styles enhance the home page carousel, located here: themes/gohugoioTheme/layouts/partials/home-page-sections/showcase.html */
.overflow-x-scroll{
-webkit-overflow-scrolling: touch;
}
.row {
transition: 450ms transform;
font-size: 0;
}
.tile {
transition: 450ms all;
}
.details {
background: -webkit-gradient(linear, left bottom, left top, from(rgba(0,0,0,0.9)), to(rgba(0,0,0,0)));
background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
transition: 450ms opacity;
}
.tile:hover .details {
opacity: 1;
}
.row:hover .tile {
opacity: 0.3;
}
.row:hover .tile:hover {
opacity: 1;
}

View File

@@ -0,0 +1,65 @@
/* Background */ .chroma { background-color: #ffffff }
/* Error */ .chroma .err { color: #a61717; background-color: #e3d2d2 }
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block; }
/* LineHighlight */ .chroma .hl { display: block; width: 100%;background-color: #ffffcc }
/* LineNumbersTable */ .chroma .lnt { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; }
/* LineNumbers */ .chroma .ln { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; }
/* Keyword */ .chroma .k { font-weight: bold }
/* KeywordConstant */ .chroma .kc { font-weight: bold }
/* KeywordDeclaration */ .chroma .kd { font-weight: bold }
/* KeywordNamespace */ .chroma .kn { font-weight: bold }
/* KeywordPseudo */ .chroma .kp { font-weight: bold }
/* KeywordReserved */ .chroma .kr { font-weight: bold }
/* KeywordType */ .chroma .kt { color: #445588; font-weight: bold }
/* NameAttribute */ .chroma .na { color: #008080 }
/* NameBuiltin */ .chroma .nb { color: #999999 }
/* NameClass */ .chroma .nc { color: #445588; font-weight: bold }
/* NameConstant */ .chroma .no { color: #008080 }
/* NameEntity */ .chroma .ni { color: #800080 }
/* NameException */ .chroma .ne { color: #990000; font-weight: bold }
/* NameFunction */ .chroma .nf { color: #990000; font-weight: bold }
/* NameNamespace */ .chroma .nn { color: #555555 }
/* NameTag */ .chroma .nt { color: #000080 }
/* NameVariable */ .chroma .nv { color: #008080 }
/* LiteralString */ .chroma .s { color: #bb8844 }
/* LiteralStringAffix */ .chroma .sa { color: #bb8844 }
/* LiteralStringBacktick */ .chroma .sb { color: #bb8844 }
/* LiteralStringChar */ .chroma .sc { color: #bb8844 }
/* LiteralStringDelimiter */ .chroma .dl { color: #bb8844 }
/* LiteralStringDoc */ .chroma .sd { color: #bb8844 }
/* LiteralStringDouble */ .chroma .s2 { color: #bb8844 }
/* LiteralStringEscape */ .chroma .se { color: #bb8844 }
/* LiteralStringHeredoc */ .chroma .sh { color: #bb8844 }
/* LiteralStringInterpol */ .chroma .si { color: #bb8844 }
/* LiteralStringOther */ .chroma .sx { color: #bb8844 }
/* LiteralStringRegex */ .chroma .sr { color: #808000 }
/* LiteralStringSingle */ .chroma .s1 { color: #bb8844 }
/* LiteralStringSymbol */ .chroma .ss { color: #bb8844 }
/* LiteralNumber */ .chroma .m { color: #009999 }
/* LiteralNumberBin */ .chroma .mb { color: #009999 }
/* LiteralNumberFloat */ .chroma .mf { color: #009999 }
/* LiteralNumberHex */ .chroma .mh { color: #009999 }
/* LiteralNumberInteger */ .chroma .mi { color: #009999 }
/* LiteralNumberIntegerLong */ .chroma .il { color: #009999 }
/* LiteralNumberOct */ .chroma .mo { color: #009999 }
/* Operator */ .chroma .o { font-weight: bold }
/* OperatorWord */ .chroma .ow { font-weight: bold }
/* Comment */ .chroma .c { color: #999988; font-style: italic }
/* CommentHashbang */ .chroma .ch { color: #999988; font-style: italic }
/* CommentMultiline */ .chroma .cm { color: #999988; font-style: italic }
/* CommentSingle */ .chroma .c1 { color: #999988; font-style: italic }
/* CommentSpecial */ .chroma .cs { color: #999999; font-weight: bold; font-style: italic }
/* CommentPreproc */ .chroma .cp { color: #999999; font-weight: bold }
/* CommentPreprocFile */ .chroma .cpf { color: #999999; font-weight: bold }
/* GenericDeleted */ .chroma .gd { color: #000000; background-color: #ffdddd }
/* GenericEmph */ .chroma .ge { font-style: italic }
/* GenericError */ .chroma .gr { color: #aa0000 }
/* GenericHeading */ .chroma .gh { color: #999999 }
/* GenericInserted */ .chroma .gi { color: #000000; background-color: #ddffdd }
/* GenericOutput */ .chroma .go { color: #888888 }
/* GenericPrompt */ .chroma .gp { color: #555555 }
/* GenericStrong */ .chroma .gs { font-weight: bold }
/* GenericSubheading */ .chroma .gu { color: #aaaaaa }
/* GenericTraceback */ .chroma .gt { color: #aa0000 }
/* TextWhitespace */ .chroma .w { color: #bbbbbb }

View File

@@ -0,0 +1,97 @@
.chroma .lntable pre {
padding: 0;
margin: 0;
border: 0;
}
.chroma .lntable pre code {
padding: 0;
margin: 0;
}
pre, .pre {
overflow-x: auto;
overflow-y: hidden;
overflow: scroll;
}
code {
padding: 0.2em;
margin: 0;
font-size: 85%;
background-color: rgba(27,31,35,0.05);
border-radius: 3px;
}
pre code {
display: block;
padding: 1.5em 1.5em;
font-size: .875rem;
line-height: 2;
overflow-x: auto;
}
pre {
background-color: #fff;
color: #333;
white-space: pre;
hyphens: none;
position: relative;
border-width: 1px;
border-color: #ccc;
border-style: solid;
}
/* The Pygments highlighter comes with its own styles. */
.highlight pre {
background-color: inherit;
color: inherit;
padding: 0.5em;
font-size: .875rem;
}
/*We are adding the copy button content here so we can change it with javascript. See the "Clipboard scripts"*/
.copy:after {
content: "Copy"
}
.copied:after {
content: "Copied"
}
@media (--breakpoint-large) {
.full-width, pre.expand:hover
{
/*width: 100vw;
position: relative;
left: 50%;
right: 50%;
margin-left: -50vw;
margin-right: -50vw;*/
/*width: 60vw;*/
/*position: relative;
left: 50%;
right: 50%;*/
/*margin-left: -30vw;*/
margin-right: -30vw;
max-width: 100vw;
}
}
.code-block .line-numbers-rows {
background: #2f3a46;
border: none;
bottom: -50px;
color: #98a4b3;
left: -178px;
padding: 50px 0;
top: -50px;
width: 138px
}
.code-block .line-numbers-rows>span:before {
color: inherit;
padding-right: 30px
}

View File

@@ -0,0 +1,38 @@
.primary-color {color: var(--primary-color)}
.bg-primary-color {background-color: var(--primary-color)}
.hover-bg-primary-color:hover {background-color: var(--primary-color)}
.primary-color-dark {color: var(--primary-color-dark)}
.bg-primary-color-dark {background-color: var(--primary-color-dark)}
.hover-bg-primary-color-dark:hover {background-color: var(--primary-color-dark)}
.primary-color-light {color: var(--primary-color-light)}
.bg-primary-color-light {background-color: var(--primary-color-light)}
.hover-bg-primary-color-light:hover {background-color: var(--primary-color-light)}
.accent-color {color: var(--accent-color)}
.bg-accent-color {background-color: var(--accent-color)}
.hover-bg-accent-color:hover {background-color: var(--accent-color)}
.accent-color-light {color: var(--accent-color-light)}
.hover-accent-color-light:hover {color: var(--accent-color-light)}
.bg-accent-color-light {background-color: var(--accent-color-light)}
.hover-bg-accent-color-light:hover {background-color: var(--accent-color-light)}
.accent-color-dark {color: var(--accent-color-dark)}
.bg-accent-color-dark {background-color: var(--accent-color-dark)}
.hover-bg-accent-color-dark:hover {background-color: var(--accent-color-dark)}
.text-color-primary {color: var(--text-color-primary)}
.text-on-primary-color {color: var(--text-on-primary-color)}
.text-color-secondary {color: var(--text-color-secondary)}
.text-color-disabled {color: var(--text-color-disabled)}
.divider-color {color: var(--divider-color)}
.warn-color {color: var(--warn-color)}
.nested-links a {
color: var(--primary-color);
text-decoration: none;
}

View File

@@ -0,0 +1,11 @@
.column-count-2 {column-count: 1}
.column-gap-1 {column-gap: 0}
.break-inside-avoid {break-inside: auto}
@media (--breakpoint-large) {
.column-count-3-l {column-count: 3}
.column-count-2-l {column-count: 2}
.column-gap-1-l {column-gap: 1}
.break-inside-avoid-l {break-inside: avoid}
}

View File

@@ -0,0 +1,28 @@
.prose table {
width: 100%;
margin-bottom: 3em;
border-collapse: collapse;
border-spacing: 0;
font-size: 1em;
border: 1px solid var(--light-gray);
& th {
background-color: var(--primary-color);
border-bottom: 1px solid var(--primary-color);
color: white;
font-weight: 400;
text-align: left;
padding: .375em .5em;
}
& td, & tc {
padding: .75em .5em;
text-align: left;
border-right: 1px solid var(--light-gray);
}
}
.prose table tr:nth-child(even) {
background-color: var(--light-gray);
}

View File

@@ -0,0 +1,41 @@
.prose ul, .prose ol {
margin-bottom: 2em;
}
.prose ul li, .prose ol li {
margin-bottom: .5em;
}
.prose li:hover {
background-color: var(--light-gray)
}
.prose ::selection {
background: var(--primary-color); /* WebKit/Blink Browsers */
color: white;
}
body {
line-height: 1.45;
}
p {margin-bottom: 1.3em;}
h1, h2, h3, h4 {
margin: 1.414em 0 0.5em;
line-height: 1.2;
}
h1 {
margin-top: 0;
font-size: 2.441em;
}
h2 {font-size: 1.953em;}
h3 {font-size: 1.563em;}
h4 {font-size: 1.25em;}
small, .font_small {font-size: 0.8em;}

View File

@@ -0,0 +1,9 @@
dl dt {
font-weight: bold;
font-size: 1.125rem;
}
dd {
margin: .5em 0 2em 0;
padding: 0;
}

View File

@@ -0,0 +1,54 @@
.note,
.warning {
border-left-width: 4px;
border-left-style: solid;
position: relative;
border-color: var(--primary-color);
display: block;
}
.note #exclamation-icon,
.warning #exclamation-icon {
fill: var(--primary-color);
position: absolute;
top: 35%;
left: -12px;
/*background-color: white;*/
}
.admonition-content {
display: block;
margin: 0px;
padding: .125em 1em;
/*margin-left: 1em;*/
margin-top: 2em;
margin-bottom: 2em;
overflow-x: auto;
/*font-size: .9375em;*/
background-color: var(--black-05);
}
.hide-child-menu .child-menu {
display: none;
}
.hide-child-menu:hover .child-menu,
.hide-child-menu:focus .child-menu,
.hide-child-menu:active .child-menu {
display: block;
}
/*documentation-copy headings exaggerate spacing and size to chunk content */
.documentation-copy h2 {
margin-top: 3em;
&.minor {
font-size: inherit;
margin-top: inherit;
border-bottom: none;
}
}

View File

@@ -0,0 +1,10 @@
.f2-fluid {
font-size: 2.25rem;
}
@media (--breakpoint-large) {
.f2-fluid {
font-size: 1.25rem;
font-size: calc(0.875rem + 0.5 * ((100vw - 20rem) / 60));
}
}

View File

@@ -0,0 +1,80 @@
/* From http://cssfontstack.com */
code, .code, pre code, .highlight pre {
font-family: 'inconsolata',Menlo,Monaco,'Courier New',monospace;
}
.sans-serif {
font-family: 'Muli',
avenir,
'helvetica neue', helvetica,
ubuntu,
roboto, noto,
'segoe ui', arial,
sans-serif;
}
.serif {
font-family: Palatino,"Palatino Linotype","Palatino LT STD","Book Antiqua",Georgia,serif;
}
/* Monospaced Typefaces (for code) */
.courier {
font-family: 'Courier Next',
courier,
monospace;
}
/* Sans-Serif Typefaces */
.helvetica {
font-family: 'helvetica neue', helvetica,
sans-serif;
}
.avenir {
font-family: 'avenir next', avenir,
sans-serif;
}
/* Serif Typefaces */
.athelas {
font-family: athelas,
georgia,
serif;
}
.georgia {
font-family: georgia,
serif;
}
.times {
font-family: times,
serif;
}
.bodoni {
font-family: "Bodoni MT",
serif;
}
.calisto {
font-family: "Calisto MT",
serif;
}
.garamond {
font-family: garamond,
serif;
}
.baskerville {
font-family: baskerville,
serif;
}

View File

@@ -0,0 +1,11 @@
/* modified from:*/
@import 'highlight.js/styles/atom-one-light.css';
/* hljs-template-variable covers the handlebars templating*/
.hljs-template-variable {
color: var(--primary-color);
}
.hljs-attr {
color: var(--accent-color-light);
}

View File

@@ -0,0 +1,52 @@
/* pagination.html: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/template_embedded.go#L117 */
.pagination {
margin: 3rem 0;
}
.pagination li {
display: inline-block;
margin-right: .375rem;
font-size: .875rem;
margin-bottom: 2.5em;
}
.pagination li a {
padding: .5rem .625rem;
background-color: white;
color: #333;
border: 1px solid #ddd;
border-radius: 3px;
text-decoration: none;
}
.pagination li.disabled {
display: none;
}
.pagination li.active a:link,
.pagination li.active a:active,
.pagination li.active a:visited {
background-color: #ddd;
}
/* Hides non-meaningful TOC items*/
#TableOfContents ul li ul li ul li{
display: none;
}
#TableOfContents ul li {
color: black;
display: block;
margin-bottom: .375em;
line-height: 1.375;
}
#TableOfContents ul li a{
width: 100%;
padding: .25em .375em;
margin-left: -.375em;
}
#TableOfContents ul li a:hover {
background-color: #999;
color: white;
}

View File

@@ -0,0 +1,7 @@
.no-js .needs-js {
opacity: 0
}
.js .needs-js {
opacity: 1;
transition: opacity .15s ease-in;
}

View File

@@ -0,0 +1,23 @@
.facebook, .twitter, .instagram, .youtube {
fill: #BABABA;
}
.facebook:hover {
fill: #3b5998;
}
.twitter {
fill: #55acee;
}
.twitter:hover {
fill: #BABABA;
}
.instagram:hover {
fill: #e95950;
}
.youtube:hover {
fill: #bb0000;
}

View File

@@ -0,0 +1,15 @@
@media (min-width: 75em) {
[data-scrolldir="down"] .sticky {
position: fixed;
top:100px;
right:0;
}
[data-scrolldir="up"] .sticky {
position: fixed;
top:100px;
right:0;
}
}

View File

@@ -0,0 +1 @@
.fill-current { fill: currentColor; }

View File

@@ -0,0 +1,34 @@
.tab-button{
margin-bottom:1px;
position: relative;
z-index: 1;
color:#333;
border-color:#ccc;
outline: none;
background-color:white;
}
.tab-pane code{
background:#f1f2f2;
border-radius:0;
}
.tab-pane .chroma{
background:none;
padding:0;
}
.tab-button.active{
border-bottom-color:#f1f2f2;
background-color: #f1f2f2;
}
.tab-content .tab-pane{
display: none;
}
.tab-content .tab-pane.active{
display: block;
}
/* Treatment of copy buttons inside a tab module */
.tab-content .copy, .tab-content .copied{
display: none;
}
.tab-content .tab-pane.active + .copy, .tab-content .tab-pane.active + .copied{
display: block;
}

View File

@@ -0,0 +1,94 @@
/*! TACHYONS v4.7.0 | http://tachyons.io */
/*
* NOTE: The Tachyons folder is for backup/reference only. This file references the module
* ________ ______
* ___ __/_____ _________ /______ ______________________
* __ / _ __ `/ ___/_ __ \_ / / / __ \_ __ \_ ___/
* _ / / /_/ // /__ _ / / / /_/ // /_/ / / / /(__ )
* /_/ \__,_/ \___/ /_/ /_/_\__, / \____//_/ /_//____/
* /____/
*
* TABLE OF CONTENTS
*
* 1. External Library Includes
* - Normalize.css | http://normalize.css.github.io
* 2. Tachyons Modules
* 3. Variables
* - Media Queries
* - Colors
* 4. Debugging
* - Debug all
* - Debug children
*
*/
/* External Library Includes */
@import 'tachyons/src/_normalize';
/* Modules */
@import 'tachyons/src/_box-sizing';
/*@import 'tachyons/src/_aspect-ratios';*/
@import 'tachyons/src/_images';
@import 'tachyons/src/_background-size';
@import 'tachyons/src/_background-position';
/*@import 'tachyons/src/_outlines';*/
@import 'tachyons/src/_borders';
@import 'tachyons/src/_border-colors';
@import 'tachyons/src/_border-radius';
@import 'tachyons/src/_border-style';
@import 'tachyons/src/_border-widths';
@import 'tachyons/src/_box-shadow';
/*@import 'tachyons/src/_code';*/
@import 'tachyons/src/_coordinates';
@import 'tachyons/src/_clears';
@import 'tachyons/src/_display';
@import 'tachyons/src/_flexbox';
@import 'tachyons/src/_floats';
/*@import 'tachyons/src/_font-family';*/
@import 'tachyons/src/_font-style';
@import 'tachyons/src/_font-weight';
@import 'tachyons/src/_forms';
@import 'tachyons/src/_heights';
@import 'tachyons/src/_letter-spacing';
@import 'tachyons/src/_line-height';
@import 'tachyons/src/_links';
@import 'tachyons/src/_lists';
@import 'tachyons/src/_max-widths';
@import 'tachyons/src/_widths';
@import 'tachyons/src/_overflow';
@import 'tachyons/src/_position';
@import 'tachyons/src/_opacity';
/*@import 'tachyons/src/_rotations';*/
@import 'tachyons/src/_skins';
@import 'tachyons/src/_skins-pseudo';
@import 'tachyons/src/_spacing';
@import 'tachyons/src/_negative-margins';
@import 'tachyons/src/_tables';
@import 'tachyons/src/_text-decoration';
@import 'tachyons/src/_text-align';
@import 'tachyons/src/_text-transform';
@import 'tachyons/src/_type-scale';
@import 'tachyons/src/_typography';
@import 'tachyons/src/_utilities';
@import 'tachyons/src/_visibility';
@import 'tachyons/src/_white-space';
@import 'tachyons/src/_vertical-align';
@import 'tachyons/src/_hovers';
@import 'tachyons/src/_z-index';
@import 'tachyons/src/_nested';
/*@import 'tachyons/src/_styles';*/
/* Variables */
/* Importing here will allow you to override any variables in the modules */
@import 'tachyons/src/_colors';
@import 'tachyons/src/_media-queries';
/* Debugging */
/*@import 'tachyons/src/_debug-children';
@import 'tachyons/src/_debug-grid';*/
/* Uncomment out the line below to help debug layout issues */
/* @import 'tachyons/src/_debug'; */

View File

@@ -0,0 +1,16 @@
:root {
--primary-color: #0594CB;
--primary-color-dark: #0A1922;
--primary-color-light: #f9f9f9;
--accent-color: #EBB951;
--accent-color-light: #FF4088;
--accent-color-dark: #33ba91;
--text-color-primary: #373737;
--text-on-primary-color: #fff;
--text-color-secondary: #ccc;
--text-color-disabled: #F7f7f7;
--divider-color: #f6f6f6;
--warn-color: red;
--blue: var(--primary-color);
}

View File

@@ -0,0 +1,39 @@
/*Base Styles*/
@import '_tachyons';
/* purgecss start ignore */
@import '_anchorforid';
@import '_animation';
@import '_documentation-styles';
@import 'docsearch.js/dist/cdn/docsearch.min';
@import '_carousel';
@import '_code';
@import '_tabs';
@import '_color-scheme';
@import '_columns';
@import '_content';
@import '_content-tables';
@import '_definition-lists';
@import '_fluid-type';
@import '_font-family';
@import '_hugo-internal-template-styling';
@import '_no-js';
@import '_social-icons';
@import '_stickyheader';
@import '_svg';
@import '_chroma';
@import '_variables';
.nested-blockquote blockquote {
border-left: 4px solid var(--primary-color);
padding-left: 1em;
/*margin: 0;*/
}
.mw-90 {
max-width:90%;
}
/* purgecss end ignore */

View File

@@ -0,0 +1,16 @@
require("typeface-muli")
import styles from './css/main.css';
import './js/anchorforid.js'
import './js/clipboardjs.js'
import './js/codeblocks.js'
import './js/docsearch.js'
import './js/hljs.js'
import './js/lazysizes.js'
import './js/menutoggle.js'
import './js/scrolldir.js'
import './js/smoothscroll.js'
import './js/tabs.js'
import './js/nojs.js'

View File

@@ -0,0 +1,34 @@
/**
* Anchor for ID BPNY
**/
var anchorForId = function (id) {
var anchor = document.createElement("a");
anchor.className = "header-link";
anchor.href = "#" + id;
anchor.innerHTML = ' <svg class="fill-current o-60 hover-accent-color-light" height="22px" viewBox="0 0 24 24" width="22px" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>';
return anchor;
};
var linkifyAnchors = function (level, containingElement) {
var headers = containingElement.getElementsByTagName("h" + level);
for (var h = 0; h < headers.length; h++) {
var header = headers[h];
if (typeof header.id !== "undefined" && header.id !== "") {
header.appendChild(anchorForId(header.id));
}
}
};
document.onreadystatechange = function () {
if (this.readyState === "complete") {
var contentBlock = document.getElementsByClassName("prose")[0]
if (!contentBlock) {
return;
}
for (var level = 2; level <= 4; level++) {
linkifyAnchors(level, contentBlock);
}
}
};

View File

@@ -0,0 +1,30 @@
var Clipboard = require('clipboard/dist/clipboard.js');
new Clipboard('.copy', {
target: function(trigger) {
if(trigger.classList.contains('copy-toggle')){
return trigger.previousElementSibling;
}
return trigger.nextElementSibling;
}
}).on('success', function(e) {
successMessage(e.trigger, 'Copied!');
e.clearSelection();
}).on('error', function(e) {
successMessage(e.trigger, fallbackMessage(e.action));
});
function successMessage(elem, msg) {
elem.setAttribute('class', 'copied bg-primary-color-dark f6 absolute top-0 right-0 lh-solid hover-bg-primary-color-dark bn white ph3 pv2');
elem.setAttribute('aria-label', msg);
}
function fallbackMessage(elem, action) {
var actionMsg = '';
var actionKey = (action === 'cut' ? 'X' : 'C');
if (isMac) {
actionMsg = 'Press ⌘-' + actionKey;
} else {
actionMsg = 'Press Ctrl-' + actionKey;
}
return actionMsg;
}

View File

@@ -0,0 +1,10 @@
let article = document.getElementById('prose')
if (article) {
let codeBlocks = article.getElementsByTagName('code')
for (let [key, codeBlock] of Object.entries(codeBlocks)){
var widthDif = codeBlock.scrollWidth - codeBlock.clientWidth
if (widthDif > 0)
codeBlock.parentNode.classList.add('expand')
}
}

View File

@@ -0,0 +1,7 @@
var docsearch = require('docsearch.js/dist/cdn/docsearch.js');
docsearch({
apiKey: '167e7998590aebda7f9fedcf86bc4a55',
indexName: 'hugodocs',
inputSelector: '#search-input',
debug: true // Set debug to true if you want to inspect the dropdown
});

View File

@@ -0,0 +1,19 @@
var hljs = require('highlight.js/lib/highlight.js');
hljs.registerLanguage('bash', require('highlight.js/lib/languages/bash'));
hljs.registerLanguage('css', require('highlight.js/lib/languages/css'));
hljs.registerLanguage('markdown', require('highlight.js/lib/languages/markdown'));
hljs.registerLanguage('diff', require('highlight.js/lib/languages/diff'));
// hljs.registerLanguage('go', require('highlight.js/lib/languages/go'));
hljs.registerLanguage('javascript', require('highlight.js/lib/languages/javascript'));
hljs.registerLanguage('json', require('highlight.js/lib/languages/json'));
hljs.registerLanguage('yaml', require('highlight.js/lib/languages/yaml'));
hljs.registerLanguage('xml', require('highlight.js/lib/languages/xml'));
hljs.registerLanguage('html', require('highlight.js/lib/languages/handlebars'));
hljs.registerLanguage("go", function(e) {
var t = { keyword: "code output note warning break default func interface select case map struct chan else goto package switch const fallthrough if range end type continue for import return var go defer bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune id autoplay Get", literal: "file download copy true false iota nil Pages with", built_in: "append cap close complex highlight copy imag len make new panic print println real recover delete Site Data tweet youtube ref relref vimeo instagram gist figure innershortcode" };
return { aliases: ["golang","hugo"], k: t, i: "</", c: [e.CLCM, e.CBCM, { cN: "string", v: [e.QSM, { b: "'", e: "[^\\\\]'" }, { b: "`", e: "`" }] }, { cN: "number", v: [{ b: e.CNR + "[dflsi]", r: 1 }, e.CNM] }, { b: /:=/ }, { cN: "function", bK: "func", e: /\s*\{/, eE: !0, c: [e.TM, { cN: "params", b: /\(/, e: /\)/, k: t, i: /["']/ }] }] }
});
hljs.initHighlightingOnLoad();

View File

@@ -0,0 +1,3 @@
var lazysizes = require('lazysizes');
// var lsnoscript = require('lazysizes/plugins/noscript/ls.noscript.js');
var unveilhooks = require('lazysizes/plugins/unveilhooks/ls.unveilhooks.js');

View File

@@ -0,0 +1,25 @@
import styles from './../css/main.css';
import './anchorforid.js'
import './clipboardjs.js'
import './codeblocks.js'
import './docsearch.js'
import './lazysizes.js'
import './menutoggle.js'
import './scrolldir.js'
import './smoothscroll.js'
import './tabs.js'
import './nojs.js'
// TO use Jquery, just call the modules you want
// var $ = require('jquery/src/core');
// require('jquery/src/core/init');
// require('jquery/src/manipulation');
// OR, use all of them
// var $ = require('jquery/src/jquery');
// And write your code
// $('body').append('<p>Jquery is working</p>');
//

View File

@@ -0,0 +1,31 @@
// Grab any element that has the 'js-toggle' class and add an event listner for the toggleClass function
var toggleBtns = document.getElementsByClassName('js-toggle')
for (var i = 0; i < toggleBtns.length; i++) {
toggleBtns[i].addEventListener('click', toggleClass, false)
}
function toggleClass() {
// Define the data target via the dataset "target" (e.g. data-target=".docsmenu")
var content = this.dataset.target.split(' ')
// Find any menu items that are open
var mobileCurrentlyOpen = document.querySelector('.mobilemenu:not(.dn)')
var desktopCurrentlyOpen = document.querySelector('.desktopmenu:not(.dn)')
var desktopActive = document.querySelector('.desktopmenu:not(.dn)')
// Loop through the targets' divs
for (var i = 0; i < content.length; i++) {
var matches = document.querySelectorAll(content[i]);
//for each, if the div has the 'dn' class (which is "display:none;"), remove it, otherwise, add that class
[].forEach.call(matches, function(dom) {
dom.classList.contains('dn') ?
dom.classList.remove('dn') :
dom.classList.add('dn');
return false;
});
// close the currently open menu items
if (mobileCurrentlyOpen) mobileCurrentlyOpen.classList.add('dn')
if (desktopCurrentlyOpen) desktopCurrentlyOpen.classList.add('dn')
if (desktopActive) desktopActive.classList.remove('db')
}
}

View File

@@ -0,0 +1 @@
document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/, 'js');

View File

@@ -0,0 +1 @@
var scrollDir = require('scrolldir/dist/scrolldir.auto.min.js');

View File

@@ -0,0 +1,80 @@
// query selector targets Hugo TOC
(function() {
'use strict';
// Feature Test
if ('querySelector' in document && 'addEventListener' in window && Array.prototype.forEach) {
// Function to animate the scroll
var smoothScroll = function(anchor, duration) {
// Calculate how far and how fast to scroll
var startLocation = window.pageYOffset;
var endLocation = anchor.offsetTop;
var distance = endLocation - startLocation;
var increments = distance / (duration / 16);
var stopAnimation;
// Scroll the page by an increment, and check if it's time to stop
var animateScroll = function() {
window.scrollBy(0, increments);
stopAnimation();
};
// If scrolling down
if (increments >= 0) {
// Stop animation when you reach the anchor OR the bottom of the page
stopAnimation = function() {
var travelled = window.pageYOffset;
if ((travelled >= (endLocation - increments)) || ((window.innerHeight + travelled) >= document.body.offsetHeight)) {
clearInterval(runAnimation);
}
};
}
// If scrolling up
else {
// Stop animation when you reach the anchor OR the top of the page
stopAnimation = function() {
var travelled = window.pageYOffset;
if (travelled <= (endLocation || 0)) {
clearInterval(runAnimation);
}
};
}
// Loop the animation function
var runAnimation = setInterval(animateScroll, 16);
};
// Define smooth scroll links
var scrollToggle = document.querySelectorAll('#TableOfContents ul li a');
// For each smooth scroll link
[].forEach.call(scrollToggle, function(toggle) {
// When the smooth scroll link is clicked
toggle.addEventListener('click', function(e) {
// Prevent the default link behavior
e.preventDefault();
// Get anchor link and calculate distance from the top
var dataID = toggle.getAttribute('href');
var dataTarget = document.querySelector(dataID);
var dataSpeed = toggle.getAttribute('data-speed');
// If the anchor exists
if (dataTarget) {
// Scroll to the anchor
smoothScroll(dataTarget, dataSpeed || 500);
}
}, false);
});
}
})();

View File

@@ -0,0 +1,43 @@
/**
* Scripts which manages Code Toggle tabs.
*/
var i;
// store tabs variable
var allTabs = document.querySelectorAll("[data-toggle-tab]");
var allPanes = document.querySelectorAll("[data-pane]");
function toggleTabs(event) {
if(event.target){
event.preventDefault();
var clickedTab = event.currentTarget;
var targetKey = clickedTab.getAttribute("data-toggle-tab")
}else {
var targetKey = event
}
// We store the config language selected in users' localStorage
if(window.localStorage){
window.localStorage.setItem("configLangPref", targetKey)
}
var selectedTabs = document.querySelectorAll("[data-toggle-tab='" + targetKey + "']");
var selectedPanes = document.querySelectorAll("[data-pane='" + targetKey + "']");
for (var i = 0; i < allTabs.length; i++) {
allTabs[i].classList.remove("active");
allPanes[i].classList.remove("active");
}
for (var i = 0; i < selectedTabs.length; i++) {
selectedTabs[i].classList.add("active");
selectedPanes[i].classList.add("active");
}
}
for (i = 0; i < allTabs.length; i++) {
allTabs[i].addEventListener("click", toggleTabs)
}
// Upon page load, if user has a preferred language in its localStorage, tabs are set to it.
if(window.localStorage.getItem('configLangPref')) {
toggleTabs(window.localStorage.getItem('configLangPref'))
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long