diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-02-10 12:52:31 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-02-10 12:52:31 +0100 |
commit | b5cb8866e9797efa28072e4eac68abd8a1b9c5d3 (patch) | |
tree | 712eccff7bd9f4d3748cdb45b7801503e1b0db4f /docs/themes | |
parent | d382502d6dfa1c066545e215ba83e2e0a9d2c8d7 (diff) | |
parent | 9cc9bab46288d8d5f9fda7009c5f746258cec1b4 (diff) |
Merge commit '9cc9bab46288d8d5f9fda7009c5f746258cec1b4'
Diffstat (limited to 'docs/themes')
15 files changed, 262 insertions, 11714 deletions
diff --git a/docs/themes/gohugoioTheme/archetypes/showcase.md b/docs/themes/gohugoioTheme/archetypes/showcase.md new file mode 100644 index 000000000..d852bb1ca --- /dev/null +++ b/docs/themes/gohugoioTheme/archetypes/showcase.md @@ -0,0 +1,7 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +description: +siteURL: +siteSource: +--- diff --git a/docs/themes/gohugoioTheme/layouts/_default/baseof.html b/docs/themes/gohugoioTheme/layouts/_default/baseof.html index d6c854db0..b7ad4f10e 100755 --- a/docs/themes/gohugoioTheme/layouts/_default/baseof.html +++ b/docs/themes/gohugoioTheme/layouts/_default/baseof.html @@ -22,6 +22,10 @@ <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"> {{ end }} + {{ range .AlternativeOutputFormats -}} + <link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}"> + {{ end -}} + <link href='{{ "dist/main.css" | relURL }}' rel='stylesheet' type="text/css" /> {{- partial "head-additions.html" . -}} {{- template "_internal/opengraph.html" . -}} diff --git a/docs/themes/gohugoioTheme/layouts/index.html b/docs/themes/gohugoioTheme/layouts/index.html index 5e8ebbdd4..9dcee424d 100644 --- a/docs/themes/gohugoioTheme/layouts/index.html +++ b/docs/themes/gohugoioTheme/layouts/index.html @@ -9,6 +9,8 @@ {{- partial "home-page-sections/features-icons" . -}} </section> + {{- partial "home-page-sections/showcase.html" . -}} + {{- partial "home-page-sections/features-single" . -}} <section class="w-100 ph4 ph5-ns pv4 pv6-ns mid-gray bg-white bb bt b--light-gray"> diff --git a/docs/themes/gohugoioTheme/layouts/partials/home-page-sections/showcase.html b/docs/themes/gohugoioTheme/layouts/partials/home-page-sections/showcase.html new file mode 100644 index 000000000..337fd2fc8 --- /dev/null +++ b/docs/themes/gohugoioTheme/layouts/partials/home-page-sections/showcase.html @@ -0,0 +1,35 @@ +<section class="bg-near-white mid-gray pb5 ph4 ph5-ns pt4 w-100"> + <h3 class="black f1 fw4 lh-title ma0 pb3 pt0-l pt4">Showcase</h3> + {{/* NOTE: transitions for this section are in themes/gohugoioTheme/src/css/_carousel.css */}} + <div class="w-100"> + <div class="w-100 overflow-x-scroll"> + <div class="row nowrap mv2 pb1"> + {{ 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" }} + <a href="{{ $p.RelPermalink}}" class="tile lazyload cover dib f4 h5 ml1 mr4 bg-black relative mw-100 shadow-5" style="width:{{ $small.Width }}px;" + data-bg="{{ $img.RelPermalink }}" + data-sizes="auto" + data-srcset="{{ $small.RelPermalink }} 1x, + {{ $big.RelPermalink }} 2x" data-src="small" + > + {{with $p.Title}} + <div class="details absolute bottom-0 f3-ns f4 left-0 o-0 right-0 top-0"> + <div class="absolute bottom-0 pa2 tc white"> + {{.}} → + </div> + </div> + {{end}} + </a> + {{ end }} + {{end}} + </div> + </div> + </div> + {{/* END */}} + <div class="flex w-100 mt4 justify-end">{{/* using Flex to make the button show up on the right side */}} + <a href="/showcase/" class="br2 f6 bg-primary-color-dark hover-bg-primary-color link ph3 pv2 ttu white">See All</a> + </div> +</section>
\ No newline at end of file diff --git a/docs/themes/gohugoioTheme/layouts/partials/previous-next-links-in-section-with-title.html b/docs/themes/gohugoioTheme/layouts/partials/previous-next-links-in-section-with-title.html new file mode 100644 index 000000000..71a14c0ef --- /dev/null +++ b/docs/themes/gohugoioTheme/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 */}} + <div date-pref class="white"> + {{if .NextInSection}} + <a href="{{.NextInSection.Permalink }}" class="br2 db f6 ph2 pv2 bg-light-gray white" title="{{ .NextInSection.Title }} ">{{ partial "svg/ic_chevron_left_black_24px.svg" (dict "fill" "#fff" "size" "12px") }} {{.NextInSection.Title}}</a> + {{end}} + + {{if .PrevInSection}} + <a href="{{ .PrevInSection.Permalink }}" class="br2 db f6 pr1 mt3 bg-light-gray ph2 pv2 white" title="{{ .PrevInSection.Title }}"> + {{.PrevInSection.Title}} {{ partial "svg/ic_chevron_right_black_24px.svg" (dict "fill" "#fff" "size" "12px") }} + </a> + {{end}} + </div> +{{ end }} diff --git a/docs/themes/gohugoioTheme/layouts/partials/site-footer.html b/docs/themes/gohugoioTheme/layouts/partials/site-footer.html index fb5b04b81..ef32025eb 100755 --- a/docs/themes/gohugoioTheme/layouts/partials/site-footer.html +++ b/docs/themes/gohugoioTheme/layouts/partials/site-footer.html @@ -1,7 +1,7 @@ <footer class="bg-primary-color-dark ph4-ns pt4 relative w-100" role="contentinfo"> <div class="center flex-ns flex-wrap justify-between mw9 w-90"> <div class="pb3 pt4 w-100 w-50-ns"> - + <div class="b f3 light-gray mb3 nested-links tc"> By the <a href="https://github.com/gohugoio/hugo/contributors" class="link">Hugo Authors</a><br /> </div> @@ -41,8 +41,8 @@ <img src="/images/gopher-side_color.svg" class="absolute-l bottom-0 dn db-l h4 right-0 z-999"/> - <div class="bg-primary-color-dark bottom-0 dn-ns fixed pb3 ph3 w-100"> - {{ partial "nav-mobile.html" . }} + <div class="bg-primary-color-dark bottom-0 left-0 right-0 dn-l fixed pb3 ph3 w-100"> + {{- partial "nav-mobile.html" . -}} </div> </footer> diff --git a/docs/themes/gohugoioTheme/layouts/showcase/list.html b/docs/themes/gohugoioTheme/layouts/showcase/list.html new file mode 100644 index 000000000..89565f342 --- /dev/null +++ b/docs/themes/gohugoioTheme/layouts/showcase/list.html @@ -0,0 +1,46 @@ +{{ define "main" }} +<div class="w-100 ph4 ph5-ns pb5 pb6-ns pt1 pt3-ns "> + <article class="cf pa3 pa4-m pa4-l nested-copy-line-height nested-img"> + <h1 class="primary-color-dark"> + {{ .Title }} + </h1> + <div class="nested-copy-line-height"> + {{ .Content }} + </div> + </article> + <section class="flex-ns flex-wrap justify-between w-100 v-top"> + {{ range (.Paginator 20).Pages }} + {{template "showcase_items" .}} + {{ end }} + </section> + <div class="nested-list-reset nested-links"> + {{/* pagination.html: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/template_embedded.go#L117 */}} + {{ template "_internal/pagination.html" . }} + </div> + <div class="dib f3 mt4">The Showcase articles are copyright the content authors. Any open source license will be attached.</div> +</div> +{{ end }} + + +{{define "showcase_items"}} + <a href="{{.Permalink}}" class="b--moon-gray ba bg-animate bg-white db flex-auto-ns hover-bg-near-white mb3 mr3 w-100 w-30-l" style="max-width: 1024px;"> + <div class="flex flex-column black h-100 mb2 pa3 pa4-l"> + {{ $img := (.Resources.ByType "image").GetMatch "*featured*" }} + {{ with $img }} + {{ $big := .Fill "1024x512 top" }} + {{ $small := $big.Resize "512x" }} + <img src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYwMCIgaGVpZ2h0PSI5MDAiIHZpZXdCb3g9IjAgMCAxNjAwIDkwMCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48dGl0bGU+UmVjdGFuZ2xlPC90aXRsZT48ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz48ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBpZD0iUmVjdGFuZ2xlIiB4PSIwIiB5PSIwIiB3aWR0aD0iMTYwMCIgaGVpZ2h0PSI5MDAiLz48L2c+PC9zdmc+" + data-sizes="auto" + data-srcset="{{ $small.RelPermalink }} 1x, + {{ $big.RelPermalink }} 2x" data-bg="{{ $small.RelPermalink }}" class="grow img lazyload" style="display: block; width: 100%; height: auto;" /> + {{end}} + <div style="margin-top:auto;">{{/* the margin aligns to the bottom */}} + <h2 class="dib f3 mt4"> + {{- .Title -}} + </h2> + </div> + </div> + </a> + + +{{end}} diff --git a/docs/themes/gohugoioTheme/layouts/showcase/single.html b/docs/themes/gohugoioTheme/layouts/showcase/single.html new file mode 100644 index 000000000..c396f7b05 --- /dev/null +++ b/docs/themes/gohugoioTheme/layouts/showcase/single.html @@ -0,0 +1,99 @@ +{{ define "title" }} +Showcase: {{ .Title }} +{{ end }} + +{{ define "main" }} + <article class="center ph3 ph4-ns pv3 pv5-ns mw9"> + + <!-- header spans the full width --> + <div class="flex flex-wrap"> + + <div class="w-100 w-20-l order-1 order-0-l"> + {{template "details" .}} + </div> + + <div class="w-100 w-60-l order-0 order-1-l"> + {{template "main-column" .}} + </div> + + <aside class="dn mid-gray w-100 w-20-ns flex-l justify-center order-2"> + {{template "navigation" .}} + </aside> + + </div> + + <div class="f6 gray mv6">{{/* bottom row */}} + Last Update: {{ .Lastmod.Format "January 2, 2006" }} <br> + {{ partial "page-edit.html" . }} + </div> + <div class="b">The Showcase articles are copyright the content authors. Any open source license will be attached.</div> + </article> +{{ end }} + + + +{{define "main-column"}} + {{ $img := (.Resources.ByType "image").GetMatch "*featured*" }} + {{ with $img }} + {{ $big := .Fill "1024x512 top" }} + {{ $small := $big.Resize "512x" }} + <img srcset="{{ $small.RelPermalink }} 1x, {{ $big.RelPermalink }} 2x" alt="{{ $img.Title }}" width="{{ $big.Width }}" class="mw-100 b--light-gray ba"> + {{ end }} + <div class="mid-gray nested-copy-line-height nested-img nested-links"> + {{with .Params.byline }} + <div style="margin-top: 20px; font-style: italic;">By {{ . | markdownify -}}</div> + {{ end }} + {{with .Content}} + {{- . -}} + {{end}} + </div> + +{{end}} + +{{define "details"}} + <div class="mt4 mt0-ns nested-links mr3-m mr4-l"> + <div class="ba b--light-gray bg-white pa3"> + <h1 class="f3 mt0">{{.Title}}</h1> + {{ with .Params.siteURL }} + <a href="{{ . }}" class="db f5 mb1">{{ . | replaceRE "^https?://([^/]+).*" "$1"}} {{ partial "svg/link-ext.svg" (dict "size" "10") }}</a> + {{ end }} + {{ with .Params.siteSource }} + <a href="{{ . }}" class="db mb4">source {{ partial "svg/link-ext.svg" (dict "size" "10") }}</a> + {{ end }} + {{ $bio := (.Resources.ByType "page").GetMatch "bio*" }} + {{ with $bio }} + <div class="f6 mid-gray nested-copy-line-height nested-links"> + {{- .Content -}} + </div> + {{ end }} + </div> + <div class="b--light-gray bt dn-l pt3"> + <div class="f6 gray mb2">Previous/Next</div> + {{- partial "previous-next-links-in-section-with-title.html" . -}} + </div> + </div> +{{end}} + +{{define "navigation"}} + {{$section := where .Site.RegularPages "Section" .Section}} + {{$number_of_entries := $section | len}} + <ul class="pa0 list"> + <li class="b f5 blTK b--light-gray pb2 pl2"> + More Sites + </li> + {{range first 20 $section}} + <li class="bl b--light-gray pl2 f6 hover-bg-light-gray hover-accent-color-light {{if eq $ .}} bg-light-gray{{end}}"> + <a href="{{.RelPermalink}}" class="db link w-100 pv1 ph1 {{ if eq $ . }} b primary-color{{else}} mid-gray {{end}}"> + {{- .Title -}} + </a> + </li> + {{end}} + {{if ge $number_of_entries 20}} + <li class="mt3"> + <a href="/showcase/page/2/" class="link blue"> + See More » + </a> + </li> + {{end}} + </ul> +{{end}} diff --git a/docs/themes/gohugoioTheme/src/css/_carousel.css b/docs/themes/gohugoioTheme/src/css/_carousel.css new file mode 100644 index 000000000..11fae8702 --- /dev/null +++ b/docs/themes/gohugoioTheme/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/docs/themes/gohugoioTheme/src/css/main.css b/docs/themes/gohugoioTheme/src/css/main.css index 912bf5ce5..3f59a8c06 100755 --- a/docs/themes/gohugoioTheme/src/css/main.css +++ b/docs/themes/gohugoioTheme/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/docs/themes/gohugoioTheme/src/js/lazysizes.js b/docs/themes/gohugoioTheme/src/js/lazysizes.js index dc4ab1186..4eb3950af 100644 --- a/docs/themes/gohugoioTheme/src/js/lazysizes.js +++ b/docs/themes/gohugoioTheme/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/docs/themes/gohugoioTheme/src/package-lock.json b/docs/themes/gohugoioTheme/src/package-lock.json index a977ac90a..c07d45b2f 100644 --- a/docs/themes/gohugoioTheme/src/package-lock.json +++ b/docs/themes/gohugoioTheme/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/docs/themes/gohugoioTheme/src/package.json b/docs/themes/gohugoioTheme/src/package.json index f0847492b..04bd261f3 100755 --- a/docs/themes/gohugoioTheme/src/package.json +++ b/docs/themes/gohugoioTheme/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/docs/themes/gohugoioTheme/static/dist/app.bundle.js b/docs/themes/gohugoioTheme/static/dist/app.bundle.js index 47a0fa0e0..fc757f71c 100644 --- a/docs/themes/gohugoioTheme/static/dist/app.bundle.js +++ b/docs/themes/gohugoioTheme/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 = ' <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 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 -}); |