From 12ecbf4a1b05c2794281f47909c836b1a005bc19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sat, 10 Feb 2018 12:50:20 +0100 Subject: [PATCH] Squashed 'themes/gohugoioTheme/' changes from ecad8247..fe71e360 fe71e360 Add srcset to the showcase screenshots 919da9a5 Add a simple byline cbe20918 Fix an issue where whitespace wrap caused scrollbars on some browsers cfee86a2 Add section to the title element 3d2ef1ac Iterating on Showcase (#330) c28c5e05 Standardize showcase metadata 551fbcde Adjust showcase image size on front page 159d5c98 Use .RelPermalink and not .URL 53eb89ec Move showcase items in list view to a template in the layout 7797cfe3 Tweak details box for mobile 90cafcfd Improve showcase single layout 083c3123 Improve styling of showcase prev/next buttons c0701abf Remove extra div that was breaking mobile layout of the showcase e277d36c Add block class to to images on mobile so they behave as expected 97c12851 Add a proper RSS feed to home page 660f3dfd Move showcase images to proper Resources a0668630 Add Showcase to Home page and internal pages d9e80db6 Revert "Add some temporary baseURL debug" 46de36ab Add some temporary baseURL debug 8fb218a5 Fix mobile menu display so it shows on mid-size displays 98a831f7 Add featured image to news articles 5beafd1e Revert the recent change made to default list template befee494 Add rough draft for page and section bundles git-subtree-dir: themes/gohugoioTheme git-subtree-split: fe71e3601c8bd5f0df3396df6d7f5e761c6bb08c --- archetypes/showcase.md | 7 + layouts/_default/baseof.html | 4 + layouts/index.html | 2 + layouts/news/single.html | 9 +- .../partials/home-page-sections/showcase.html | 35 + ...ious-next-links-in-section-with-title.html | 14 + layouts/partials/site-footer.html | 6 +- layouts/showcase/list.html | 45 + layouts/showcase/single.html | 98 + src/css/_carousel.css | 25 + src/css/main.css | 1 + src/js/lazysizes.js | 1 + src/package-lock.json | 34 +- src/package.json | 2 +- static/dist/app.bundle.js | 11698 +--------------- static/dist/main.css | 2 +- 16 files changed, 267 insertions(+), 11716 deletions(-) create mode 100644 archetypes/showcase.md create mode 100644 layouts/partials/home-page-sections/showcase.html create mode 100644 layouts/partials/previous-next-links-in-section-with-title.html create mode 100644 layouts/showcase/list.html create mode 100644 layouts/showcase/single.html create mode 100644 src/css/_carousel.css diff --git a/archetypes/showcase.md b/archetypes/showcase.md new file mode 100644 index 000000000..d852bb1ca --- /dev/null +++ b/archetypes/showcase.md @@ -0,0 +1,7 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +description: +siteURL: +siteSource: +--- diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index d6c854db0..b7ad4f10e 100755 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -22,6 +22,10 @@ {{ end }} + {{ range .AlternativeOutputFormats -}} + + {{ end -}} + {{- partial "head-additions.html" . -}} {{- template "_internal/opengraph.html" . -}} diff --git a/layouts/index.html b/layouts/index.html index 5e8ebbdd4..9dcee424d 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -9,6 +9,8 @@ {{- partial "home-page-sections/features-icons" . -}} + {{- partial "home-page-sections/showcase.html" . -}} + {{- partial "home-page-sections/features-single" . -}}
diff --git a/layouts/news/single.html b/layouts/news/single.html index 4fef8e74d..33a0043d8 100644 --- a/layouts/news/single.html +++ b/layouts/news/single.html @@ -47,8 +47,13 @@ diff --git a/layouts/partials/home-page-sections/showcase.html b/layouts/partials/home-page-sections/showcase.html new file mode 100644 index 000000000..337fd2fc8 --- /dev/null +++ b/layouts/partials/home-page-sections/showcase.html @@ -0,0 +1,35 @@ +
+

Showcase

+ {{/* NOTE: transitions for this section are in themes/gohugoioTheme/src/css/_carousel.css */}} +
+
+
+ {{ range $p := first 10 (where .Site.RegularPages "Section" "showcase") }} + {{ $img := (.Resources.ByType "image").GetMatch "*featured*" }} + {{ with $img }} + {{ $big := .Fill "1024x512 top" }} + {{ $small := $big.Resize "512x" }} + + {{with $p.Title}} +
+
+ {{.}} → +
+
+ {{end}} +
+ {{ end }} + {{end}} +
+
+
+ {{/* END */}} +
{{/* using Flex to make the button show up on the right side */}} + See All +
+
\ No newline at end of file diff --git a/layouts/partials/previous-next-links-in-section-with-title.html b/layouts/partials/previous-next-links-in-section-with-title.html new file mode 100644 index 000000000..71a14c0ef --- /dev/null +++ b/layouts/partials/previous-next-links-in-section-with-title.html @@ -0,0 +1,14 @@ +{{ if or .PrevInSection .NextInSection }} +{{/* this div holds these a tags as a unit for flex-box display */}} + +{{ end }} diff --git a/layouts/partials/site-footer.html b/layouts/partials/site-footer.html index fb5b04b81..ef32025eb 100755 --- a/layouts/partials/site-footer.html +++ b/layouts/partials/site-footer.html @@ -1,7 +1,7 @@
- + @@ -41,8 +41,8 @@ -
  - {{ partial "nav-mobile.html" . }} +
+ {{- partial "nav-mobile.html" . -}}
diff --git a/layouts/showcase/list.html b/layouts/showcase/list.html new file mode 100644 index 000000000..709219947 --- /dev/null +++ b/layouts/showcase/list.html @@ -0,0 +1,45 @@ +{{ define "main" }} +
+
+

+ {{ .Title }} +

+
+ {{ .Content }} +
+
+
+ {{ range (.Paginator 20).Pages }} + {{template "showcase_items" .}} + {{ end }} +
+ +
+{{ end }} + + +{{define "showcase_items"}} + +
+ {{ $img := (.Resources.ByType "image").GetMatch "*featured*" }} + {{ with $img }} + {{ $big := .Fill "1024x512 top" }} + {{ $small := $big.Resize "512x" }} + + {{end}} +
{{/* the margin aligns to the bottom */}} +

+ {{- .Title -}} +

+
+
+
+ + +{{end}} diff --git a/layouts/showcase/single.html b/layouts/showcase/single.html new file mode 100644 index 000000000..c3e15127e --- /dev/null +++ b/layouts/showcase/single.html @@ -0,0 +1,98 @@ +{{ define "title" }} +Showcase: {{ .Title }} +{{ end }} + +{{ define "main" }} +
+ + +
+ +
+ {{template "details" .}} +
+ +
+ {{template "main-column" .}} +
+ + + +
+ +
{{/* bottom row */}} + Last Update: {{ .Lastmod.Format "January 2, 2006" }}
+ {{ partial "page-edit.html" . }} +
+ +
+{{ end }} + + + +{{define "main-column"}} + {{ $img := (.Resources.ByType "image").GetMatch "*featured*" }} + {{ with $img }} + {{ $big := .Fill "1024x512 top" }} + {{ $small := $big.Resize "512x" }} + {{ $img.Title }} + {{ end }} + +{{end}} + +{{define "details"}} + +{{end}} + +{{define "navigation"}} + {{$section := where .Site.RegularPages "Section" .Section}} + {{$number_of_entries := $section | len}} + +{{end}} diff --git a/src/css/_carousel.css b/src/css/_carousel.css new file mode 100644 index 000000000..11fae8702 --- /dev/null +++ b/src/css/_carousel.css @@ -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; +} diff --git a/src/css/main.css b/src/css/main.css index 912bf5ce5..3f59a8c06 100755 --- a/src/css/main.css +++ b/src/css/main.css @@ -11,6 +11,7 @@ @import '_documentation-styles'; @import '_algolia'; +@import '_carousel'; @import '_code'; @import '_color-scheme'; @import '_columns'; diff --git a/src/js/lazysizes.js b/src/js/lazysizes.js index dc4ab1186..4eb3950af 100644 --- a/src/js/lazysizes.js +++ b/src/js/lazysizes.js @@ -1,2 +1,3 @@ var lazysizes = require('lazysizes'); // var lsnoscript = require('lazysizes/plugins/noscript/ls.noscript.js'); +var unveilhooks = require('lazysizes/plugins/unveilhooks/ls.unveilhooks.js'); diff --git a/src/package-lock.json b/src/package-lock.json index a977ac90a..c07d45b2f 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -2585,14 +2585,6 @@ } } }, - "string_decoder": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "5.0.1" - } - }, "string-width": { "version": "1.0.2", "bundled": true, @@ -2603,6 +2595,14 @@ "strip-ansi": "3.0.1" } }, + "string_decoder": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, "stringstream": { "version": "0.0.5", "bundled": true, @@ -5411,15 +5411,6 @@ "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", "dev": true }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "dev": true, - "requires": { - "safe-buffer": "5.1.1" - } - }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -5431,6 +5422,15 @@ "strip-ansi": "3.0.1" } }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", diff --git a/src/package.json b/src/package.json index f0847492b..04bd261f3 100755 --- a/src/package.json +++ b/src/package.json @@ -8,7 +8,7 @@ "license": "MIT", "scripts": { "build:production": "rm -rf ../static/dist && webpack -p", - "build": "webpack --progress --colors --watch", + "build": "webpack --progress --colors --watch", "start": "npm run build" }, "devDependencies": { diff --git a/static/dist/app.bundle.js b/static/dist/app.bundle.js index 47a0fa0e0..fc757f71c 100644 --- a/static/dist/app.bundle.js +++ b/static/dist/app.bundle.js @@ -1,11708 +1,22 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // identity function for calling harmony imports with the correct context -/******/ __webpack_require__.i = function(value) { return value; }; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 10); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** -* Anchor for ID BPNY -**/ -var anchorForId = function anchorForId(id) { - var anchor = document.createElement("a"); - anchor.className = "header-link"; - anchor.href = "#" + id; - anchor.innerHTML = ' '; - return anchor; -}; - -var linkifyAnchors = function linkifyAnchors(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 <= 2; level++) { - linkifyAnchors(level, contentBlock); - } - } -}; - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Clipboard = __webpack_require__(11); -new Clipboard('.copy', { - target: function target(trigger) { - 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; -} - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -var article = document.getElementById('prose'); - -if (article) { - var codeBlocks = article.getElementsByTagName('code'); - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = Object.entries(codeBlocks)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var _ref = _step.value; - - var _ref2 = _slicedToArray(_ref, 2); - - var key = _ref2[0]; - var codeBlock = _ref2[1]; - - var widthDif = codeBlock.scrollWidth - codeBlock.clientWidth; - if (widthDif > 0) codeBlock.parentNode.classList.add('expand'); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } -} - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var docsearch = __webpack_require__(12); -docsearch({ - apiKey: '167e7998590aebda7f9fedcf86bc4a55', - indexName: 'hugodocs', - inputSelector: '#search-input', - debug: true // Set debug to true if you want to inspect the dropdown -}); - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var lazysizes = __webpack_require__(13); -// var lsnoscript = require('lazysizes/plugins/noscript/ls.noscript.js'); - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -// 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'); - } -} - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/, 'js'); - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var scrollDir = __webpack_require__(14); - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -// 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 smoothScroll(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 animateScroll() { - 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 stopAnimation() { - 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 stopAnimation() { - 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); - }); - } -})(); - -/***/ }), -/* 9 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _main = __webpack_require__(9); - -var _main2 = _interopRequireDefault(_main); - -__webpack_require__(0); - -__webpack_require__(1); - -__webpack_require__(2); - -__webpack_require__(3); - -__webpack_require__(4); - -__webpack_require__(5); - -__webpack_require__(7); - -__webpack_require__(8); - -__webpack_require__(6); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -var require;var require;/*! +!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=10)}([function(t,e,n){"use strict";var r=function(t){var e=document.createElement("a");return e.className="header-link",e.href="#"+t,e.innerHTML=' ',e},i=function(t,e){for(var n=e.getElementsByTagName("h"+t),i=0;i0&&p.parentNode.classList.add("expand")}}catch(t){a=!0,u=t}finally{try{!s&&l.return&&l.return()}finally{if(a)throw u}}}},function(t,e,n){"use strict";n(12)({apiKey:"167e7998590aebda7f9fedcf86bc4a55",indexName:"hugodocs",inputSelector:"#search-input",debug:!0})},function(t,e,n){"use strict";n(13),n(14)},function(t,e,n){"use strict";function r(){for(var t=this.dataset.target.split(" "),e=document.querySelector(".mobilemenu:not(.dn)"),n=document.querySelector(".desktopmenu:not(.dn)"),r=document.querySelector(".desktopmenu:not(.dn)"),i=0;i=0?function(){var t=window.pageYOffset;(t>=i-s||window.innerHeight+t>=document.body.offsetHeight)&&clearInterval(u)}:function(){window.pageYOffset<=(i||0)&&clearInterval(u)};var u=setInterval(a,16)},e=document.querySelectorAll("#TableOfContents ul li a");[].forEach.call(e,function(e){e.addEventListener("click",function(n){n.preventDefault();var r=e.getAttribute("href"),i=document.querySelector(r),o=e.getAttribute("data-speed");i&&t(i,o||500)},!1)})}}()},function(t,e){},function(t,e,n){"use strict";var r=n(9);!function(t){t&&t.__esModule}(r);n(0),n(1),n(2),n(3),n(4),n(5),n(7),n(8),n(6)},function(t,e,n){var r,r;/*! * clipboard.js v1.7.1 * https://zenorocha.github.io/clipboard.js * * Licensed MIT © Zeno Rocha */ -(function(f){if(true){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Clipboard = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return require(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0 && arguments[0] !== undefined ? arguments[0] : {}; - - this.action = options.action; - this.container = options.container; - this.emitter = options.emitter; - this.target = options.target; - this.text = options.text; - this.trigger = options.trigger; - - this.selectedText = ''; - } - }, { - key: 'initSelection', - value: function initSelection() { - if (this.text) { - this.selectFake(); - } else if (this.target) { - this.selectTarget(); - } - } - }, { - key: 'selectFake', - value: function selectFake() { - var _this = this; - - var isRTL = document.documentElement.getAttribute('dir') == 'rtl'; - - this.removeFake(); - - this.fakeHandlerCallback = function () { - return _this.removeFake(); - }; - this.fakeHandler = this.container.addEventListener('click', this.fakeHandlerCallback) || true; - - this.fakeElem = document.createElement('textarea'); - // Prevent zooming on iOS - this.fakeElem.style.fontSize = '12pt'; - // Reset box model - this.fakeElem.style.border = '0'; - this.fakeElem.style.padding = '0'; - this.fakeElem.style.margin = '0'; - // Move element out of screen horizontally - this.fakeElem.style.position = 'absolute'; - this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px'; - // Move element to the same position vertically - var yPosition = window.pageYOffset || document.documentElement.scrollTop; - this.fakeElem.style.top = yPosition + 'px'; - - this.fakeElem.setAttribute('readonly', ''); - this.fakeElem.value = this.text; - - this.container.appendChild(this.fakeElem); - - this.selectedText = (0, _select2.default)(this.fakeElem); - this.copyText(); - } - }, { - key: 'removeFake', - value: function removeFake() { - if (this.fakeHandler) { - this.container.removeEventListener('click', this.fakeHandlerCallback); - this.fakeHandler = null; - this.fakeHandlerCallback = null; - } - - if (this.fakeElem) { - this.container.removeChild(this.fakeElem); - this.fakeElem = null; - } - } - }, { - key: 'selectTarget', - value: function selectTarget() { - this.selectedText = (0, _select2.default)(this.target); - this.copyText(); - } - }, { - key: 'copyText', - value: function copyText() { - var succeeded = void 0; - - try { - succeeded = document.execCommand(this.action); - } catch (err) { - succeeded = false; - } - - this.handleResult(succeeded); - } - }, { - key: 'handleResult', - value: function handleResult(succeeded) { - this.emitter.emit(succeeded ? 'success' : 'error', { - action: this.action, - text: this.selectedText, - trigger: this.trigger, - clearSelection: this.clearSelection.bind(this) - }); - } - }, { - key: 'clearSelection', - value: function clearSelection() { - if (this.trigger) { - this.trigger.focus(); - } - - window.getSelection().removeAllRanges(); - } - }, { - key: 'destroy', - value: function destroy() { - this.removeFake(); - } - }, { - key: 'action', - set: function set() { - var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy'; - - this._action = action; - - if (this._action !== 'copy' && this._action !== 'cut') { - throw new Error('Invalid "action" value, use either "copy" or "cut"'); - } - }, - get: function get() { - return this._action; - } - }, { - key: 'target', - set: function set(target) { - if (target !== undefined) { - if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) { - if (this.action === 'copy' && target.hasAttribute('disabled')) { - throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute'); - } - - if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) { - throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes'); - } - - this._target = target; - } else { - throw new Error('Invalid "target" value, use a valid Element'); - } - } - }, - get: function get() { - return this._target; - } - }]); - - return ClipboardAction; - }(); - - module.exports = ClipboardAction; -}); - -},{"select":5}],8:[function(require,module,exports){ -(function (global, factory) { - if (typeof define === "function" && define.amd) { - define(['module', './clipboard-action', 'tiny-emitter', 'good-listener'], factory); - } else if (typeof exports !== "undefined") { - factory(module, require('./clipboard-action'), require('tiny-emitter'), require('good-listener')); - } else { - var mod = { - exports: {} - }; - factory(mod, global.clipboardAction, global.tinyEmitter, global.goodListener); - global.clipboard = mod.exports; - } -})(this, function (module, _clipboardAction, _tinyEmitter, _goodListener) { - 'use strict'; - - var _clipboardAction2 = _interopRequireDefault(_clipboardAction); - - var _tinyEmitter2 = _interopRequireDefault(_tinyEmitter); - - var _goodListener2 = _interopRequireDefault(_goodListener); - - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; - } - - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { - return typeof obj; - } : function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - var _createClass = function () { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - return function (Constructor, protoProps, staticProps) { - if (protoProps) defineProperties(Constructor.prototype, protoProps); - if (staticProps) defineProperties(Constructor, staticProps); - return Constructor; - }; - }(); - - function _possibleConstructorReturn(self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return call && (typeof call === "object" || typeof call === "function") ? call : self; - } - - function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; - } - - var Clipboard = function (_Emitter) { - _inherits(Clipboard, _Emitter); - - /** - * @param {String|HTMLElement|HTMLCollection|NodeList} trigger - * @param {Object} options - */ - function Clipboard(trigger, options) { - _classCallCheck(this, Clipboard); - - var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this)); - - _this.resolveOptions(options); - _this.listenClick(trigger); - return _this; - } - - /** - * Defines if attributes would be resolved using internal setter functions - * or custom functions that were passed in the constructor. - * @param {Object} options - */ - - - _createClass(Clipboard, [{ - key: 'resolveOptions', - value: function resolveOptions() { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - this.action = typeof options.action === 'function' ? options.action : this.defaultAction; - this.target = typeof options.target === 'function' ? options.target : this.defaultTarget; - this.text = typeof options.text === 'function' ? options.text : this.defaultText; - this.container = _typeof(options.container) === 'object' ? options.container : document.body; - } - }, { - key: 'listenClick', - value: function listenClick(trigger) { - var _this2 = this; - - this.listener = (0, _goodListener2.default)(trigger, 'click', function (e) { - return _this2.onClick(e); - }); - } - }, { - key: 'onClick', - value: function onClick(e) { - var trigger = e.delegateTarget || e.currentTarget; - - if (this.clipboardAction) { - this.clipboardAction = null; - } - - this.clipboardAction = new _clipboardAction2.default({ - action: this.action(trigger), - target: this.target(trigger), - text: this.text(trigger), - container: this.container, - trigger: trigger, - emitter: this - }); - } - }, { - key: 'defaultAction', - value: function defaultAction(trigger) { - return getAttributeValue('action', trigger); - } - }, { - key: 'defaultTarget', - value: function defaultTarget(trigger) { - var selector = getAttributeValue('target', trigger); - - if (selector) { - return document.querySelector(selector); - } - } - }, { - key: 'defaultText', - value: function defaultText(trigger) { - return getAttributeValue('text', trigger); - } - }, { - key: 'destroy', - value: function destroy() { - this.listener.destroy(); - - if (this.clipboardAction) { - this.clipboardAction.destroy(); - this.clipboardAction = null; - } - } - }], [{ - key: 'isSupported', - value: function isSupported() { - var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut']; - - var actions = typeof action === 'string' ? [action] : action; - var support = !!document.queryCommandSupported; - - actions.forEach(function (action) { - support = support && !!document.queryCommandSupported(action); - }); - - return support; - } - }]); - - return Clipboard; - }(_tinyEmitter2.default); - - /** - * Helper function to retrieve attribute value. - * @param {String} suffix - * @param {Element} element - */ - function getAttributeValue(suffix, element) { - var attribute = 'data-clipboard-' + suffix; - - if (!element.hasAttribute(attribute)) { - return; - } - - return element.getAttribute(attribute); - } - - module.exports = Clipboard; -}); - -},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8) -}); - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -/*! docsearch 2.4.1 | © Algolia | github.com/algolia/docsearch */ -(function webpackUniversalModuleDefinition(root, factory) { - if(true) - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["docsearch"] = factory(); - else - root["docsearch"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; -/******/ -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // identity function for calling harmony imports with the correct context -/******/ __webpack_require__.i = function(value) { return value; }; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 46); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var DOM = __webpack_require__(1); - -function escapeRegExp(str) { - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); -} - -module.exports = { - // those methods are implemented differently - // depending on which build it is, using - // $... or angular... or Zepto... or require(...) - isArray: null, - isFunction: null, - isObject: null, - bind: null, - each: null, - map: null, - mixin: null, - - isMsie: function() { - // from https://github.com/ded/bowser/blob/master/bowser.js - return (/(msie|trident)/i).test(navigator.userAgent) ? - navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2] : false; - }, - - // http://stackoverflow.com/a/6969486 - escapeRegExChars: function(str) { - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); - }, - - isNumber: function(obj) { return typeof obj === 'number'; }, - - toStr: function toStr(s) { - return s === undefined || s === null ? '' : s + ''; - }, - - cloneDeep: function cloneDeep(obj) { - var clone = this.mixin({}, obj); - var self = this; - this.each(clone, function(value, key) { - if (value) { - if (self.isArray(value)) { - clone[key] = [].concat(value); - } else if (self.isObject(value)) { - clone[key] = self.cloneDeep(value); - } - } - }); - return clone; - }, - - error: function(msg) { - throw new Error(msg); - }, - - every: function(obj, test) { - var result = true; - if (!obj) { - return result; - } - this.each(obj, function(val, key) { - result = test.call(null, val, key, obj); - if (!result) { - return false; - } - }); - return !!result; - }, - - any: function(obj, test) { - var found = false; - if (!obj) { - return found; - } - this.each(obj, function(val, key) { - if (test.call(null, val, key, obj)) { - found = true; - return false; - } - }); - return found; - }, - - getUniqueId: (function() { - var counter = 0; - return function() { return counter++; }; - })(), - - templatify: function templatify(obj) { - if (this.isFunction(obj)) { - return obj; - } - var $template = DOM.element(obj); - if ($template.prop('tagName') === 'SCRIPT') { - return function template() { return $template.text(); }; - } - return function template() { return String(obj); }; - }, - - defer: function(fn) { setTimeout(fn, 0); }, - - noop: function() {}, - - formatPrefix: function(prefix, noPrefix) { - return noPrefix ? '' : prefix + '-'; - }, - - className: function(prefix, clazz, skipDot) { - return (skipDot ? '' : '.') + prefix + clazz; - }, - - escapeHighlightedString: function(str, highlightPreTag, highlightPostTag) { - highlightPreTag = highlightPreTag || ''; - var pre = document.createElement('div'); - pre.appendChild(document.createTextNode(highlightPreTag)); - - highlightPostTag = highlightPostTag || ''; - var post = document.createElement('div'); - post.appendChild(document.createTextNode(highlightPostTag)); - - var div = document.createElement('div'); - div.appendChild(document.createTextNode(str)); - return div.innerHTML - .replace(RegExp(escapeRegExp(pre.innerHTML), 'g'), highlightPreTag) - .replace(RegExp(escapeRegExp(post.innerHTML), 'g'), highlightPostTag); - } -}; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = { - element: null -}; - - -/***/ }), -/* 2 */ -/***/ (function(module, exports) { - - -var hasOwn = Object.prototype.hasOwnProperty; -var toString = Object.prototype.toString; - -module.exports = function forEach (obj, fn, ctx) { - if (toString.call(fn) !== '[object Function]') { - throw new TypeError('iterator must be a function'); - } - var l = obj.length; - if (l === +l) { - for (var i = 0; i < l; i++) { - fn.call(ctx, obj[i], i, obj); - } - } else { - for (var k in obj) { - if (hasOwn.call(obj, k)) { - fn.call(ctx, obj[k], k, obj); - } - } - } -}; - - - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - -module.exports = function clone(obj) { - return JSON.parse(JSON.stringify(obj)); -}; - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -// This file hosts our error definitions -// We use custom error "types" so that we can act on them when we need it -// e.g.: if error instanceof errors.UnparsableJSON then.. - -var inherits = __webpack_require__(20); - -function AlgoliaSearchError(message, extraProperties) { - var forEach = __webpack_require__(2); - - var error = this; - - // try to get a stacktrace - if (typeof Error.captureStackTrace === 'function') { - Error.captureStackTrace(this, this.constructor); - } else { - error.stack = (new Error()).stack || 'Cannot get a stacktrace, browser is too old'; - } - - this.name = 'AlgoliaSearchError'; - this.message = message || 'Unknown error'; - - if (extraProperties) { - forEach(extraProperties, function addToErrorObject(value, key) { - error[key] = value; - }); - } -} - -inherits(AlgoliaSearchError, Error); - -function createCustomError(name, message) { - function AlgoliaSearchCustomError() { - var args = Array.prototype.slice.call(arguments, 0); - - // custom message not set, use default - if (typeof args[0] !== 'string') { - args.unshift(message); - } - - AlgoliaSearchError.apply(this, args); - this.name = 'AlgoliaSearch' + name + 'Error'; - } - - inherits(AlgoliaSearchCustomError, AlgoliaSearchError); - - return AlgoliaSearchCustomError; -} - -// late exports to let various fn defs and inherits take place -module.exports = { - AlgoliaSearchError: AlgoliaSearchError, - UnparsableJSON: createCustomError( - 'UnparsableJSON', - 'Could not parse the incoming response as JSON, see err.more for details' - ), - RequestTimeout: createCustomError( - 'RequestTimeout', - 'Request timedout before getting a response' - ), - Network: createCustomError( - 'Network', - 'Network issue, see err.more for details' - ), - JSONPScriptFail: createCustomError( - 'JSONPScriptFail', - '