mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-13 20:14:58 +00:00
Merge commit '61c27b58b353c73772aae572c7d822fdfdf7791b'
This commit is contained in:
commit
932ae52709
39 files changed
+511
-339
No files matched your search
@@ -10,6 +10,10 @@ Note that this repository contains solely the documentation for Hugo. For contri
|
||||
|
||||
*Pull requests shall **only** contain changes to the actual documentation. However, changes on the code base of Hugo **and** the documentation shall be a single, atomic pull request in the [hugo](https://github.com/gohugoio/hugo) repository.*
|
||||
|
||||
## Branches
|
||||
|
||||
* The `master` branch is where the site is automatically built from, and is the place to put changes relevant to the current Hugo version.
|
||||
* The `next` branch is where we store changes that is related to the next Hugo release. This can be previewed here: https://next--gohugoio.netlify.com/
|
||||
|
||||
## Build
|
||||
|
||||
|
||||
@@ -21,6 +21,11 @@ disableAliases = true
|
||||
# It is (currently) not in use, but you can do ```go in a content file if you want to.
|
||||
pygmentsCodeFences = true
|
||||
|
||||
pygmentsOptions = ""
|
||||
# Use the Chroma stylesheet
|
||||
pygmentsUseClasses = true
|
||||
pygmentsUseClassic = false
|
||||
|
||||
# See https://help.farbox.com/pygments.html
|
||||
pygmentsStyle = "friendly"
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
---
|
||||
title: Command Line Reference
|
||||
linktitle: CLI Overview
|
||||
description: Comprehensive list of Hugo templating functions, including basic and advanced usage examples.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [commands]
|
||||
keywords: [cli,command line]
|
||||
menu:
|
||||
docs:
|
||||
parent: "commands"
|
||||
weight: 1
|
||||
weight: 01 #rem
|
||||
draft: false
|
||||
aliases: [/cli/]
|
||||
---
|
||||
|
||||
The following list contains auto-generated and up-to-date (thanks to [Cobra][]) documentation for all the CLI commands in Hugo.
|
||||
|
||||
|
||||
[Cobra]: https://github.com/spf13/cobra
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo"
|
||||
slug: hugo
|
||||
url: /commands/hugo/
|
||||
@@ -34,6 +34,7 @@ hugo [flags]
|
||||
--cleanDestinationDir remove files from destination not found in static directories
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
-c, --contentDir string filesystem path to content directory
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
--disable404 do not render 404 page
|
||||
--disableKinds stringSlice disable different kind of pages (home, RSS etc.)
|
||||
@@ -77,4 +78,4 @@ hugo [flags]
|
||||
* [hugo undraft](/commands/hugo_undraft/) - Undraft resets the content's draft status
|
||||
* [hugo version](/commands/hugo_version/) - Print the version number of Hugo
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo benchmark"
|
||||
slug: hugo_benchmark
|
||||
url: /commands/hugo_benchmark/
|
||||
@@ -59,6 +59,7 @@ hugo benchmark [flags]
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -69,4 +70,4 @@ hugo benchmark [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo check"
|
||||
slug: hugo_check
|
||||
url: /commands/hugo_check/
|
||||
@@ -23,6 +23,7 @@ Contains some verification checks
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -34,4 +35,4 @@ Contains some verification checks
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
* [hugo check ulimit](/commands/hugo_check_ulimit/) - Check system ulimit settings
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo check ulimit"
|
||||
slug: hugo_check_ulimit
|
||||
url: /commands/hugo_check_ulimit/
|
||||
@@ -28,6 +28,7 @@ hugo check ulimit [flags]
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -38,4 +39,4 @@ hugo check ulimit [flags]
|
||||
### SEE ALSO
|
||||
* [hugo check](/commands/hugo_check/) - Contains some verification checks
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo config"
|
||||
slug: hugo_config
|
||||
url: /commands/hugo_config/
|
||||
@@ -27,6 +27,7 @@ hugo config [flags]
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -37,4 +38,4 @@ hugo config [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo convert"
|
||||
slug: hugo_convert
|
||||
url: /commands/hugo_convert/
|
||||
@@ -28,6 +28,7 @@ See convert's subcommands toJSON, toTOML and toYAML for more information.
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -41,4 +42,4 @@ See convert's subcommands toJSON, toTOML and toYAML for more information.
|
||||
* [hugo convert toTOML](/commands/hugo_convert_totoml/) - Convert front matter to TOML
|
||||
* [hugo convert toYAML](/commands/hugo_convert_toyaml/) - Convert front matter to YAML
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo convert toJSON"
|
||||
slug: hugo_convert_toJSON
|
||||
url: /commands/hugo_convert_tojson/
|
||||
@@ -28,6 +28,7 @@ hugo convert toJSON [flags]
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
-o, --output string filesystem path to write files to
|
||||
@@ -41,4 +42,4 @@ hugo convert toJSON [flags]
|
||||
### SEE ALSO
|
||||
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo convert toTOML"
|
||||
slug: hugo_convert_toTOML
|
||||
url: /commands/hugo_convert_totoml/
|
||||
@@ -28,6 +28,7 @@ hugo convert toTOML [flags]
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
-o, --output string filesystem path to write files to
|
||||
@@ -41,4 +42,4 @@ hugo convert toTOML [flags]
|
||||
### SEE ALSO
|
||||
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo convert toYAML"
|
||||
slug: hugo_convert_toYAML
|
||||
url: /commands/hugo_convert_toyaml/
|
||||
@@ -28,6 +28,7 @@ hugo convert toYAML [flags]
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
-o, --output string filesystem path to write files to
|
||||
@@ -41,4 +42,4 @@ hugo convert toYAML [flags]
|
||||
### SEE ALSO
|
||||
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo env"
|
||||
slug: hugo_env
|
||||
url: /commands/hugo_env/
|
||||
@@ -27,6 +27,7 @@ hugo env [flags]
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -37,4 +38,4 @@ hugo env [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo gen"
|
||||
slug: hugo_gen
|
||||
url: /commands/hugo_gen/
|
||||
@@ -23,6 +23,7 @@ A collection of several useful generators.
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -33,7 +34,8 @@ A collection of several useful generators.
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
* [hugo gen autocomplete](/commands/hugo_gen_autocomplete/) - Generate shell autocompletion script for Hugo
|
||||
* [hugo gen chromastyles](/commands/hugo_gen_chromastyles/) - Generate CSS stylesheet for the Chroma code highlighter
|
||||
* [hugo gen doc](/commands/hugo_gen_doc/) - Generate Markdown documentation for the Hugo CLI.
|
||||
* [hugo gen man](/commands/hugo_gen_man/) - Generate man pages for the Hugo CLI
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo gen autocomplete"
|
||||
slug: hugo_gen_autocomplete
|
||||
url: /commands/hugo_gen_autocomplete/
|
||||
@@ -45,6 +45,7 @@ hugo gen autocomplete [flags]
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -55,4 +56,4 @@ hugo gen autocomplete [flags]
|
||||
### SEE ALSO
|
||||
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -0,0 +1,46 @@
|
||||
---
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo gen chromastyles"
|
||||
slug: hugo_gen_chromastyles
|
||||
url: /commands/hugo_gen_chromastyles/
|
||||
---
|
||||
## hugo gen chromastyles
|
||||
|
||||
Generate CSS stylesheet for the Chroma code highlighter
|
||||
|
||||
### Synopsis
|
||||
|
||||
|
||||
Generate CSS stylesheet for the Chroma code highlighter for a given style. This stylesheet is needed if pygmentsUseClasses is enabled in config.
|
||||
|
||||
See https://help.farbox.com/pygments.html for preview of available styles
|
||||
|
||||
```
|
||||
hugo gen chromastyles [flags]
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for chromastyles
|
||||
--highlightStyle string style used for highlighting lines (see https://github.com/alecthomas/chroma) (default "bg:#ffffcc")
|
||||
--linesStyle string style used for line numbers (see https://github.com/alecthomas/chroma)
|
||||
--style string highlighter style (see https://help.farbox.com/pygments.html) (default "friendly")
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
-v, --verbose verbose output
|
||||
--verboseLog verbose logging
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
|
||||
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo gen doc"
|
||||
slug: hugo_gen_doc
|
||||
url: /commands/hugo_gen_doc/
|
||||
@@ -34,6 +34,7 @@ hugo gen doc [flags]
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -44,4 +45,4 @@ hugo gen doc [flags]
|
||||
### SEE ALSO
|
||||
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo gen man"
|
||||
slug: hugo_gen_man
|
||||
url: /commands/hugo_gen_man/
|
||||
@@ -30,6 +30,7 @@ hugo gen man [flags]
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -40,4 +41,4 @@ hugo gen man [flags]
|
||||
### SEE ALSO
|
||||
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo import"
|
||||
slug: hugo_import
|
||||
url: /commands/hugo_import/
|
||||
@@ -25,6 +25,7 @@ Import requires a subcommand, e.g. `hugo import jekyll jekyll_root_path target_p
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -36,4 +37,4 @@ Import requires a subcommand, e.g. `hugo import jekyll jekyll_root_path target_p
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
* [hugo import jekyll](/commands/hugo_import_jekyll/) - hugo import from Jekyll
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo import jekyll"
|
||||
slug: hugo_import_jekyll
|
||||
url: /commands/hugo_import_jekyll/
|
||||
@@ -30,6 +30,7 @@ hugo import jekyll [flags]
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -40,4 +41,4 @@ hugo import jekyll [flags]
|
||||
### SEE ALSO
|
||||
* [hugo import](/commands/hugo_import/) - Import your site from others.
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo list"
|
||||
slug: hugo_list
|
||||
url: /commands/hugo_list/
|
||||
@@ -26,6 +26,7 @@ List requires a subcommand, e.g. `hugo list drafts`.
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -39,4 +40,4 @@ List requires a subcommand, e.g. `hugo list drafts`.
|
||||
* [hugo list expired](/commands/hugo_list_expired/) - List all posts already expired
|
||||
* [hugo list future](/commands/hugo_list_future/) - List all posts dated in the future
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo list drafts"
|
||||
slug: hugo_list_drafts
|
||||
url: /commands/hugo_list_drafts/
|
||||
@@ -27,6 +27,7 @@ hugo list drafts [flags]
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -38,4 +39,4 @@ hugo list drafts [flags]
|
||||
### SEE ALSO
|
||||
* [hugo list](/commands/hugo_list/) - Listing out various types of content
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo list expired"
|
||||
slug: hugo_list_expired
|
||||
url: /commands/hugo_list_expired/
|
||||
@@ -28,6 +28,7 @@ hugo list expired [flags]
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -39,4 +40,4 @@ hugo list expired [flags]
|
||||
### SEE ALSO
|
||||
* [hugo list](/commands/hugo_list/) - Listing out various types of content
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo list future"
|
||||
slug: hugo_list_future
|
||||
url: /commands/hugo_list_future/
|
||||
@@ -28,6 +28,7 @@ hugo list future [flags]
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -39,4 +40,4 @@ hugo list future [flags]
|
||||
### SEE ALSO
|
||||
* [hugo list](/commands/hugo_list/) - Listing out various types of content
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo new"
|
||||
slug: hugo_new
|
||||
url: /commands/hugo_new/
|
||||
@@ -35,6 +35,7 @@ hugo new [path] [flags]
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -47,4 +48,4 @@ hugo new [path] [flags]
|
||||
* [hugo new site](/commands/hugo_new_site/) - Create a new site (skeleton)
|
||||
* [hugo new theme](/commands/hugo_new_theme/) - Create a new theme
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo new site"
|
||||
slug: hugo_new_site
|
||||
url: /commands/hugo_new_site/
|
||||
@@ -31,6 +31,7 @@ hugo new site [path] [flags]
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -42,4 +43,4 @@ hugo new site [path] [flags]
|
||||
### SEE ALSO
|
||||
* [hugo new](/commands/hugo_new/) - Create new content for your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo new theme"
|
||||
slug: hugo_new_theme
|
||||
url: /commands/hugo_new_theme/
|
||||
@@ -30,6 +30,7 @@ hugo new theme [name] [flags]
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -41,4 +42,4 @@ hugo new theme [name] [flags]
|
||||
### SEE ALSO
|
||||
* [hugo new](/commands/hugo_new/) - Create new content for your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo server"
|
||||
slug: hugo_server
|
||||
url: /commands/hugo_server/
|
||||
@@ -53,10 +53,12 @@ hugo server [flags]
|
||||
--i18n-warnings print missing translations
|
||||
--ignoreCache ignores the cache directory
|
||||
-l, --layoutDir string filesystem path to layout directory
|
||||
--liveReloadPort int port for live reloading (i.e. 443 in HTTPS proxy situations) (default -1)
|
||||
--meminterval string interval to poll memory usage (requires --memstats), valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". (default "100ms")
|
||||
--memstats string log memory usage to this file
|
||||
--navigateToChanged navigate to changed content file on live browser reload
|
||||
--noChmod don't sync permission mode of files
|
||||
--noHTTPCache prevent HTTP caching (default true)
|
||||
--noTimes don't sync modification time of files
|
||||
--pluralizeListTitles pluralize titles in lists using inflect (default true)
|
||||
-p, --port int port on which the server will listen (default 1313)
|
||||
@@ -74,6 +76,7 @@ hugo server [flags]
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -84,4 +87,4 @@ hugo server [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo undraft"
|
||||
slug: hugo_undraft
|
||||
url: /commands/hugo_undraft/
|
||||
@@ -29,6 +29,7 @@ hugo undraft path/to/content [flags]
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -39,4 +40,4 @@ hugo undraft path/to/content [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
date: 2017-09-25T08:30:15+02:00
|
||||
title: "hugo version"
|
||||
slug: hugo_version
|
||||
url: /commands/hugo_version/
|
||||
@@ -27,6 +27,7 @@ hugo version [flags]
|
||||
|
||||
```
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
@@ -37,4 +38,4 @@ hugo version [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
###### Auto generated by spf13/cobra on 25-Sep-2017
|
||||
@@ -0,0 +1,188 @@
|
||||
---
|
||||
title: Syntax Highlighting
|
||||
description: Hugo comes with reallly fast syntax highlighting from Chroma.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
keywords: [highlighting,pygments,chroma,code blocks,syntax]
|
||||
categories: [content management]
|
||||
menu:
|
||||
docs:
|
||||
parent: "content-management"
|
||||
weight: 300
|
||||
weight: 20
|
||||
sections_weight: 20
|
||||
draft: false
|
||||
aliases: [/extras/highlighting/,/extras/highlight/,/tools/syntax-highlighting/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
From Hugo 0.28, the default syntax hightlighter in Hugo is [Chroma](https://github.com/alecthomas/chroma); it is built in Go and is really, really fast -- and for the most important parts compatible with Pygments.
|
||||
|
||||
If you want to continue to use Pygments (see below), set `pygmentsUseClassic=true` in your site config.
|
||||
|
||||
The example below shows a simple code snippet from the Hugo source highlighted with the `highlight` shortcode. Note that the gohugo.io site is generated with `pygmentsUseClasses=true` (see [Generate Syntax Highlighter CSS](#generate-syntax-highlighter-css)).
|
||||
|
||||
* `linenos=inline` turns on line numbers. Note that the `inline` value only has an effect in Pygments.
|
||||
* `hl_lines` lists a set of line numbers or line number ranges to be highlighted. Note that the hyphen range syntax is only supported for Chroma.
|
||||
* `linenostart=199` starts the line number count from 199.
|
||||
|
||||
With that, this:
|
||||
|
||||
```
|
||||
{{</* highlight go "linenos=inline,hl_lines=8 15-17,linenostart=199" */>}}
|
||||
// ... code
|
||||
{{</* / highlight */>}}
|
||||
```
|
||||
|
||||
Gives this:
|
||||
|
||||
{{< highlight go "linenos=inline,hl_lines=8 15-17,linenostart=199" >}}
|
||||
// GetTitleFunc returns a func that can be used to transform a string to
|
||||
// title case.
|
||||
//
|
||||
// The supported styles are
|
||||
//
|
||||
// - "Go" (strings.Title)
|
||||
// - "AP" (see https://www.apstylebook.com/)
|
||||
// - "Chicago" (see http://www.chicagomanualofstyle.org/home.html)
|
||||
//
|
||||
// If an unknown or empty style is provided, AP style is what you get.
|
||||
func GetTitleFunc(style string) func(s string) string {
|
||||
switch strings.ToLower(style) {
|
||||
case "go":
|
||||
return strings.Title
|
||||
case "chicago":
|
||||
tc := transform.NewTitleConverter(transform.ChicagoStyle)
|
||||
return tc.Title
|
||||
default:
|
||||
tc := transform.NewTitleConverter(transform.APStyle)
|
||||
return tc.Title
|
||||
}
|
||||
}
|
||||
{{< / highlight >}}
|
||||
|
||||
|
||||
## Configure Syntax Hightlighter
|
||||
To make the transition from Pygments to Chroma seamless, they share a common set of configuration options:
|
||||
|
||||
pygmentsOptions
|
||||
: A comma separated list of options. See below for a full list.
|
||||
|
||||
pygmentsCodefences
|
||||
: Set to true to enable syntax highlighting in code fences with a language tag in markdown (see below for an example).
|
||||
|
||||
pygmentsStyle
|
||||
: The style of code highlighting. See https://help.farbox.com/pygments.html for a gallery. Note that this option is not relevant when `pygmentsUseClasses` is set.
|
||||
|
||||
pygmentsUseClasses
|
||||
: Set to `true` to use CSS classes to format your highlighted code. See [Generate Syntax Highlighter CSS](#generate-syntax-highlighter-css).
|
||||
|
||||
pygmentsCodefencesGuessSyntax
|
||||
: Set to `true` to try to do syntax highlighting on code fenced blocks in markdown without a language tag.
|
||||
|
||||
pygmentsUseClassic
|
||||
: Set to true to use Pygments instead of the much faster Chroma.
|
||||
|
||||
### Options
|
||||
|
||||
`pygmentsOptions` can be set either in site config or overridden per code block in the Highlight shortcode or template func.
|
||||
|
||||
noclasses
|
||||
: Use inline style.
|
||||
|
||||
linenos
|
||||
: For Chroma, any value in this setting will print line numbers. Pygments has some more fine grained control.
|
||||
|
||||
linenostart
|
||||
: Start the line numbers from this value (default is 1).
|
||||
|
||||
|
||||
hl_lines
|
||||
: Highlight a space separated list of line numbers. For Chroma, you can provide a list of ranges, i.e. "3-8 10-20".
|
||||
|
||||
|
||||
The full set of supported options for Pygments is: `encoding`, `outencoding`, `nowrap`, `full`, `title`, `style`, `noclasses`, `classprefix`, `cssclass`, `cssstyles`, `prestyles`, `linenos`, `hl_lines`, `linenostart`, `linenostep`, `linenospecial`, `nobackground`, `lineseparator`, `lineanchors`, `linespans`, `anchorlinenos`, `startinline`. See the [Pygments Documentation](http://pygments.org/) for details.
|
||||
|
||||
|
||||
## Generate Syntax Highlighter CSS
|
||||
|
||||
If you run with `pygmentsUseClassic=true` in your site config, you need a style sheet.
|
||||
|
||||
You can generate one with Hugo:
|
||||
|
||||
```bash
|
||||
hugo gen chromastyles --style=monokai > syntax.css
|
||||
```
|
||||
|
||||
Run `hugo gen chromastyles -h` for more options. See https://help.farbox.com/pygments.html for a gallery of available styles.
|
||||
|
||||
|
||||
## Highlight Shortcode
|
||||
|
||||
Highlighting is carried out via the [built-in shortcode](/content-management/shortcodes/) `highlight`. `highlight` takes exactly one required parameter for the programming language to be highlighted and requires a closing shortcode. Note that `highlight` is *not* used for client-side javascript highlighting.
|
||||
|
||||
### Example `highlight` Shortcode
|
||||
|
||||
{{< code file="example-highlight-shortcode-input.md" >}}
|
||||
{{</* highlight html */>}}
|
||||
<section id="main">
|
||||
<div>
|
||||
<h1 id="title">{{ .Title }}</h1>
|
||||
{{ range .Data.Pages }}
|
||||
{{ .Render "summary"}}
|
||||
{{ end }}
|
||||
</div>
|
||||
</section>
|
||||
{{</* /highlight */>}}
|
||||
{{< /code >}}
|
||||
|
||||
|
||||
|
||||
## Highlight Template Func
|
||||
|
||||
See [Highlight](/functions/highlight/).
|
||||
|
||||
## Highlight in Code Fences
|
||||
|
||||
It is also possible to add syntax highlighting with GitHub flavored code fences. To enable this, set the `pygmentsCodeFences` to `true` in Hugo's [configuration file](/getting-started/configuration/);
|
||||
|
||||
````
|
||||
```html
|
||||
<section id="main">
|
||||
<div>
|
||||
<h1 id="title">{{ .Title }}</h1>
|
||||
{{ range .Data.Pages }}
|
||||
{{ .Render "summary"}}
|
||||
{{ end }}
|
||||
</div>
|
||||
</section>
|
||||
```
|
||||
````
|
||||
|
||||
|
||||
## Highlight with Pygments Classic
|
||||
|
||||
If you for some reason don't want to use the built-in Chroma highlighter, you can set `pygmentsUseClassic=true` in your config and add Pygments to your path.
|
||||
|
||||
{{% note "Disclaimers on Pygments" %}}
|
||||
* Pygments is relatively slow and _causes a performance hit when building your site_, but Hugo has been designed to cache the results to disk.
|
||||
* The caching can be turned off by setting the `--ignoreCache` flag to `true`.
|
||||
* The languages available for highlighting depend on your Pygments installation.
|
||||
{{% /note %}}
|
||||
|
||||
If you have never worked with Pygments before, here is a brief primer:
|
||||
|
||||
+ Install Python from [python.org](https://www.python.org/downloads/). Version 2.7.x is already sufficient.
|
||||
+ Run `pip install Pygments` in order to install Pygments. Once installed, Pygments gives you a command `pygmentize`. Make sure it sits in your PATH; otherwise, Hugo will not be able to find and use it.
|
||||
|
||||
On Debian and Ubuntu systems, you may also install Pygments by running `sudo apt-get install python3-pygments`.
|
||||
|
||||
|
||||
|
||||
[Prism]: http://prismjs.com
|
||||
[prismdownload]: http://prismjs.com/download.html
|
||||
[Highlight.js]: http://highlightjs.org/
|
||||
[Rainbow]: http://craig.is/making/rainbows
|
||||
[Syntax Highlighter]: http://alexgorbatchev.com/SyntaxHighlighter/
|
||||
[Google Prettify]: https://github.com/google/code-prettify
|
||||
[Yandex]: http://yandex.ru/
|
||||
@@ -11,7 +11,7 @@ menu:
|
||||
docs:
|
||||
parent: "functions"
|
||||
keywords: [highlighting,pygments,code blocks,syntax]
|
||||
signature: ["highlight INPUT"]
|
||||
signature: ["highlight INPUT LANG OPTIONS"]
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: []
|
||||
|
||||
@@ -129,5 +129,3 @@ You can then render your custom Disqus partial template as follows:
|
||||
* `_internal/schema.html`
|
||||
* `_internal/twitter_cards.html`
|
||||
|
||||
[disqus]: https://disqus.com
|
||||
[disqussignup]: https://disqus.com/profile/signup/
|
||||
@@ -1,237 +0,0 @@
|
||||
---
|
||||
title: Syntax Highlighting
|
||||
linktitle:
|
||||
description: Hugo provides server-side syntax highlighting via Pygments and, like most static site generators, works very well with client-side (JavaScript) syntax highlighting libraries as well.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
keywords: [highlighting,pygments,code blocks,syntax]
|
||||
categories: [developer tools]
|
||||
menu:
|
||||
docs:
|
||||
parent: "tools"
|
||||
weight: 20
|
||||
weight: 20
|
||||
sections_weight: 20
|
||||
draft: false
|
||||
aliases: [/extras/highlighting/,/extras/highlight/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
Hugo can highlight source code in _two different ways_—either pre-processed server side from your content or to defer the processing to the client side, using a JavaScript library.
|
||||
|
||||
## Server-side
|
||||
|
||||
For the pre-processed approach, highlighting is performed by an external Python-based program called [Pygments](http://pygments.org/) and is triggered via an embedded Hugo shortcode (see [example](#example-highlight-shortcode-input) below). If Pygments is absent from the path, it will silently simply pass the content along without highlighting.
|
||||
|
||||
### Server-side Advantages
|
||||
|
||||
The advantages of server-side syntax highlighting are that it doesn’t depend on a JavaScript library and, consequently, works very well when read from an RSS feed.
|
||||
|
||||
### Pygments
|
||||
|
||||
If you have never worked with Pygments before, here is a brief primer:
|
||||
|
||||
+ Install Python from [python.org](https://www.python.org/downloads/). Version 2.7.x is already sufficient.
|
||||
+ Run `pip install Pygments` in order to install Pygments. Once installed, Pygments gives you a command `pygmentize`. Make sure it sits in your PATH; otherwise, Hugo will not be able to find and use it.
|
||||
|
||||
On Debian and Ubuntu systems, you may also install Pygments by running `sudo apt-get install python3-pygments`.
|
||||
|
||||
Hugo gives you two options that you can set with the variable `pygmentsuseclasses` (default `false`) in your [site configuration](/getting-started/configuration/).
|
||||
|
||||
1. Color codes for highlighting keywords are directly inserted if `pygmentsuseclasses = false` (default). The color codes depend on your choice of the `pygmentsstyle` (default = `"monokai"`). You can explore the different color styles on [pygments.org](http://pygments.org/) after inserting some example code.
|
||||
2. If you choose `pygmentsuseclasses = true`, Hugo includes class names in your code instead of color codes. For class-names to be meaningful, you need to include a `.css` file in your website representing your color scheme. You can either generate this `.css` files according to the [description from the Pygments documentation](http://pygments.org/docs/cmdline/) or download the one of the many pre-built color schemes from [Pygment's GitHub css repository](https://github.com/richleland/pygments-css).
|
||||
|
||||
### Server-side Usage
|
||||
|
||||
Highlighting is carried out via the [built-in shortcode](/content-management/shortcodes/) `highlight`. `highlight` takes exactly one required parameter for the programming language to be highlighted and requires a closing shortcode. Note that `highlight` is *not* used for client-side javascript highlighting.
|
||||
|
||||
### Example `highlight` Shortcode Input
|
||||
|
||||
{{< code file="example-highlight-shortcode-input.md" >}}
|
||||
{{</* highlight html */>}}
|
||||
<section id="main">
|
||||
<div>
|
||||
<h1 id="title">{{ .Title }}</h1>
|
||||
{{ range .Data.Pages }}
|
||||
{{ .Render "summary"}}
|
||||
{{ end }}
|
||||
</div>
|
||||
</section>
|
||||
{{</* /highlight */>}}
|
||||
{{< /code >}}
|
||||
|
||||
### Example `highlight` Shortcode Output
|
||||
|
||||
{{< output file="example-highlight-shortcode-output.html" >}}
|
||||
<span style="color: #f92672"><section</span> <span style="color: #a6e22e">id=</span><span style="color: #e6db74">"main"</span><span style="color: #f92672">></span>
|
||||
<span style="color: #f92672"><div></span>
|
||||
<span style="color: #f92672"><h1</span> <span style="color: #a6e22e">id=</span><span style="color: #e6db74">"title"</span><span style="color: #f92672">></span>{{ .Title }}<span style="color: #f92672"></h1></span>
|
||||
{{ range .Data.Pages }}
|
||||
{{ .Render "summary"}}
|
||||
{{ end }}
|
||||
<span style="color: #f92672"></div></span>
|
||||
<span style="color: #f92672"></section></span>
|
||||
{{< /output >}}
|
||||
|
||||
### Options
|
||||
|
||||
Options for controlling highlighting can be added in the second argument as a quoted, comma-separated key-value list. The example below will syntax highlight in `go` with inline line numbers and line numbers 2 and 3 highlighted.
|
||||
|
||||
```
|
||||
{{</* highlight go "linenos=inline,hl_lines=2 3" */>}}
|
||||
var a string
|
||||
var b string
|
||||
var c string
|
||||
var d string
|
||||
{{</* / highlight */>}}
|
||||
```
|
||||
|
||||
The `highlight` shortcode includes the following supported keywords:
|
||||
|
||||
* `style`
|
||||
* `encoding`
|
||||
* `noclasses`
|
||||
* `hl_lines`
|
||||
* `linenos`
|
||||
|
||||
Note that `style` and `noclasses` will override the similar setting in the [global config](/getting-started/configuration/).
|
||||
|
||||
The keywords in the `highlight` shortcode mirror those of Pygments from the command line. See the [Pygments documentation](http://pygments.org/docs/) for more information.
|
||||
|
||||
### Code Fences
|
||||
|
||||
It is also possible to add syntax highlighting with GitHub flavored code fences. To enable this, set the `PygmentsCodeFences` to `true` in Hugo's [configuration file](/getting-started/configuration/);
|
||||
|
||||
````
|
||||
```
|
||||
<section id="main">
|
||||
<div>
|
||||
<h1 id="title">{{ .Title }}</h1>
|
||||
{{ range .Data.Pages }}
|
||||
{{ .Render "summary"}}
|
||||
{{ end }}
|
||||
</div>
|
||||
</section>
|
||||
```
|
||||
````
|
||||
|
||||
{{% note "Disclaimers on Pygments" %}}
|
||||
* Pygments is relatively slow and _causes a performance hit when building your site_, but Hugo has been designed to cache the results to disk.
|
||||
* The caching can be turned off by setting the `--ignoreCache` flag to `true`.
|
||||
* The languages available for highlighting depend on your Pygments installation.
|
||||
{{% /note %}}
|
||||
|
||||
## Client-side
|
||||
|
||||
Alternatively, code highlighting can be applied to your code blocks in client-side JavaScript.
|
||||
|
||||
Client-side syntax highlighting is very simple to add. You'll need to pick
|
||||
a library and a corresponding theme. Some popular libraries are:
|
||||
|
||||
- [Highlight.js]
|
||||
- [Prism]
|
||||
- [Rainbow]
|
||||
- [Syntax Highlighter]
|
||||
- [Google Prettify]
|
||||
|
||||
### Client-side Advantages
|
||||
|
||||
The advantages of client-side syntax highlighting are that it doesn’t cost anything when building your site, and some of the highlighting scripts available cover more languages than Pygments does.
|
||||
|
||||
### Highlight.js Example
|
||||
|
||||
This example uses the popular [Highlight.js] library, hosted by [Yandex], a popular Russian search engine.
|
||||
|
||||
In your `./layouts/partials/` (or `./layouts/chrome/`) folder, depending on your specific theme, there will be a snippet that will be included in every generated HTML page, such as `header.html` or `header.includes.html`. Simply add the css and js to initialize [Highlight.js]:
|
||||
|
||||
```
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/styles/default.min.css">
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/highlight.min.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
```
|
||||
|
||||
### Prism example
|
||||
|
||||
Prism is another popular highlighter library and is used on some major sites.
|
||||
The [download section of the prism.js website][prismdownload] is simple to use and affords you a high degree of customization to pick only the languages you'll be using on your site.
|
||||
|
||||
Similar to Highlight.js, you simply load `prism.css` in your `<head>` via whatever Hugo partial template is creating that part of your pages:
|
||||
|
||||
```
|
||||
...
|
||||
<link href="/css/prism.css" rel="stylesheet" />
|
||||
...
|
||||
```
|
||||
|
||||
Add `prism.js` near the bottom of your `<body>` tag in whatever Hugo partial template is appropriate for your site or theme.
|
||||
|
||||
```
|
||||
...
|
||||
<script src="/js/prism.js"></script>
|
||||
</body>
|
||||
```
|
||||
|
||||
In this example, the local paths indicate that your downloaded copy of these files are being added to the site, typically under `./static/css/` and `./static/js/`, respectively.
|
||||
|
||||
### Client-side Usage
|
||||
|
||||
To use client-side highlighting, most of these javascript libraries expect your code to be wrapped in semantically correct `<code>` elements with language-specific class attributes. For example, a code block for HTML would have `class="language-html"`.
|
||||
|
||||
The client-side highlighting script therefore looks for programming language classes according to this convention: `language-go`, `language-html`, `language-css`, `language-bash`, etc. If you look at the page's source, you might see something like the following:
|
||||
|
||||
```
|
||||
<pre>
|
||||
<code class="language-css">
|
||||
body {
|
||||
font-family: "Noto Sans", sans-serif;
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
```
|
||||
|
||||
If you are using markdown, your content pages needs to use the following syntax, with the name of the language to be highlighted entered directly after the first "fence." A fenced code block can be noted by opening and closing triple tilde <kbd>~</kbd> or triple back ticks <kbd>`</kbd>:
|
||||
|
||||
{{< nohighlight >}}
|
||||
~~~css
|
||||
body {
|
||||
font-family: "Noto Sans", sans-serif;
|
||||
}
|
||||
~~~
|
||||
{{< /nohighlight >}}
|
||||
|
||||
Here is the same example but with triple back ticks to denote the fenced code block:
|
||||
|
||||
{{< nohighlight >}}
|
||||
```css
|
||||
body {
|
||||
font-family: "Noto Sans", sans-serif;
|
||||
}
|
||||
```
|
||||
{{< /nohighlight >}}
|
||||
|
||||
Passing the above examples through the highlighter script would yield the following markup:
|
||||
|
||||
{{< nohighlight >}}
|
||||
<pre><code class="language-css hljs">;<span class="hljs-selector-tag">body</span> {
|
||||
<span class="hljs-attribute">font-family</span>: <span class="hljs-string">"Noto Sans"</span>, sans-serif;
|
||||
}
|
||||
{{< /nohighlight >}}
|
||||
|
||||
In the case of the coding color scheme used by the Hugo docs, the resulting output would then look like the following to the website's end users:
|
||||
|
||||
```
|
||||
body {
|
||||
font-family: "Noto Sans", sans-serif;
|
||||
}
|
||||
```
|
||||
|
||||
Please see individual libraries' documentation for how to implement each of the JavaScript-based libraries.
|
||||
|
||||
[Prism]: http://prismjs.com
|
||||
[prismdownload]: http://prismjs.com/download.html
|
||||
[Highlight.js]: http://highlightjs.org/
|
||||
[Rainbow]: http://craig.is/making/rainbows
|
||||
[Syntax Highlighter]: http://alexgorbatchev.com/SyntaxHighlighter/
|
||||
[Google Prettify]: https://github.com/google/code-prettify
|
||||
[Yandex]: http://yandex.ru/
|
||||
+136
-18
@@ -384,6 +384,23 @@
|
||||
}
|
||||
},
|
||||
"compare": {
|
||||
"Conditional": {
|
||||
"Description": "Conditional can be used as a ternary operator.\nIt returns a if condition, else b.",
|
||||
"Args": [
|
||||
"condition",
|
||||
"a",
|
||||
"b"
|
||||
],
|
||||
"Aliases": [
|
||||
"cond"
|
||||
],
|
||||
"Examples": [
|
||||
[
|
||||
"{{ cond (eq (add 2 2) 4) \"2+2 is 4\" \"what?\" | safeHTML }}",
|
||||
"2+2 is 4"
|
||||
]
|
||||
]
|
||||
},
|
||||
"Default": {
|
||||
"Description": "Default checks whether a given value is set and returns a default value if it\nis not. \"Set\" in this context means non-zero for numeric types and times;\nnon-zero length for strings, arrays, slices, and maps;\nany boolean or struct value; or non-nil for any other types.",
|
||||
"Args": [
|
||||
@@ -604,6 +621,22 @@
|
||||
],
|
||||
"Examples": []
|
||||
},
|
||||
"KeyVals": {
|
||||
"Description": "KeyVals creates a key and values wrapper.",
|
||||
"Args": [
|
||||
"key",
|
||||
"vals"
|
||||
],
|
||||
"Aliases": [
|
||||
"keyVals"
|
||||
],
|
||||
"Examples": [
|
||||
[
|
||||
"{{ keyVals \"key\" \"a\" \"b\" }}",
|
||||
"key: [a b]"
|
||||
]
|
||||
]
|
||||
},
|
||||
"Last": {
|
||||
"Description": "Last returns the last N items in a rangeable list.",
|
||||
"Args": [
|
||||
@@ -856,7 +889,7 @@
|
||||
},
|
||||
"fmt": {
|
||||
"Print": {
|
||||
"Description": "",
|
||||
"Description": "Print returns string representation of the passed arguments.",
|
||||
"Args": [
|
||||
"a"
|
||||
],
|
||||
@@ -871,7 +904,7 @@
|
||||
]
|
||||
},
|
||||
"Printf": {
|
||||
"Description": "",
|
||||
"Description": "Printf returns a formatted string representation of the passed arguments.",
|
||||
"Args": [
|
||||
"format",
|
||||
"a"
|
||||
@@ -887,7 +920,7 @@
|
||||
]
|
||||
},
|
||||
"Println": {
|
||||
"Description": "",
|
||||
"Description": "Print returns string representation of the passed arguments ending with a newline.",
|
||||
"Args": [
|
||||
"a"
|
||||
],
|
||||
@@ -1020,7 +1053,7 @@
|
||||
},
|
||||
"math": {
|
||||
"Add": {
|
||||
"Description": "",
|
||||
"Description": "Add adds two numbers.",
|
||||
"Args": [
|
||||
"a",
|
||||
"b"
|
||||
@@ -1036,7 +1069,7 @@
|
||||
]
|
||||
},
|
||||
"Div": {
|
||||
"Description": "",
|
||||
"Description": "Div divides two numbers.",
|
||||
"Args": [
|
||||
"a",
|
||||
"b"
|
||||
@@ -1052,7 +1085,7 @@
|
||||
]
|
||||
},
|
||||
"Log": {
|
||||
"Description": "",
|
||||
"Description": "Log returns the natural logarithm of a number.",
|
||||
"Args": [
|
||||
"a"
|
||||
],
|
||||
@@ -1097,7 +1130,7 @@
|
||||
]
|
||||
},
|
||||
"Mul": {
|
||||
"Description": "",
|
||||
"Description": "Mul multiplies two numbers.",
|
||||
"Args": [
|
||||
"a",
|
||||
"b"
|
||||
@@ -1113,7 +1146,7 @@
|
||||
]
|
||||
},
|
||||
"Sub": {
|
||||
"Description": "",
|
||||
"Description": "Sub subtracts two numbers.",
|
||||
"Args": [
|
||||
"a",
|
||||
"b"
|
||||
@@ -1156,7 +1189,7 @@
|
||||
]
|
||||
},
|
||||
"ReadFile": {
|
||||
"Description": "ReadFilereads the file named by filename relative to the configured\nWorkingDir. It returns the contents as a string. There is a upper size\nlimit set at 1 megabytes.",
|
||||
"Description": "ReadFile reads the file named by filename relative to the configured WorkingDir.\nIt returns the contents as a string.\nThere is an upper size limit set at 1 megabytes.",
|
||||
"Args": [
|
||||
"i"
|
||||
],
|
||||
@@ -1469,6 +1502,10 @@
|
||||
[
|
||||
"{{title \"Bat man\"}}",
|
||||
"Bat Man"
|
||||
],
|
||||
[
|
||||
"{{title \"somewhere over the rainbow\"}}",
|
||||
"Somewhere Over the Rainbow"
|
||||
]
|
||||
]
|
||||
},
|
||||
@@ -1518,20 +1555,72 @@
|
||||
]
|
||||
]
|
||||
},
|
||||
"TrimPrefix": {
|
||||
"Description": "",
|
||||
"Args": null,
|
||||
"TrimLeft": {
|
||||
"Description": "TrimLeft returns a slice of the string s with all leading characters\ncontained in cutset removed.",
|
||||
"Args": [
|
||||
"cutset",
|
||||
"s"
|
||||
],
|
||||
"Aliases": null,
|
||||
"Examples": null
|
||||
"Examples": [
|
||||
[
|
||||
"{{ \"aabbaa\" | strings.TrimLeft \"a\" }}",
|
||||
"bbaa"
|
||||
]
|
||||
]
|
||||
},
|
||||
"TrimPrefix": {
|
||||
"Description": "TrimPrefix returns s without the provided leading prefix string. If s doesn't\nstart with prefix, s is returned unchanged.",
|
||||
"Args": [
|
||||
"prefix",
|
||||
"s"
|
||||
],
|
||||
"Aliases": null,
|
||||
"Examples": [
|
||||
[
|
||||
"{{ \"aabbaa\" | strings.TrimPrefix \"a\" }}",
|
||||
"abbaa"
|
||||
],
|
||||
[
|
||||
"{{ \"aabbaa\" | strings.TrimPrefix \"aa\" }}",
|
||||
"bbaa"
|
||||
]
|
||||
]
|
||||
},
|
||||
"TrimRight": {
|
||||
"Description": "TrimRight returns a slice of the string s with all trailing characters\ncontained in cutset removed.",
|
||||
"Args": [
|
||||
"cutset",
|
||||
"s"
|
||||
],
|
||||
"Aliases": null,
|
||||
"Examples": [
|
||||
[
|
||||
"{{ \"aabbaa\" | strings.TrimRight \"a\" }}",
|
||||
"aabb"
|
||||
]
|
||||
]
|
||||
},
|
||||
"TrimSuffix": {
|
||||
"Description": "",
|
||||
"Args": null,
|
||||
"Description": "TrimSuffix returns s without the provided trailing suffix string. If s\ndoesn't end with suffix, s is returned unchanged.",
|
||||
"Args": [
|
||||
"suffix",
|
||||
"s"
|
||||
],
|
||||
"Aliases": null,
|
||||
"Examples": null
|
||||
"Examples": [
|
||||
[
|
||||
"{{ \"aabbaa\" | strings.TrimSuffix \"a\" }}",
|
||||
"aabba"
|
||||
],
|
||||
[
|
||||
"{{ \"aabbaa\" | strings.TrimSuffix \"aa\" }}",
|
||||
"aabb"
|
||||
]
|
||||
]
|
||||
},
|
||||
"Truncate": {
|
||||
"Description": "",
|
||||
"Description": "Truncate truncates a given string to the specified length.",
|
||||
"Args": [
|
||||
"a",
|
||||
"options"
|
||||
@@ -1565,6 +1654,22 @@
|
||||
]
|
||||
]
|
||||
},
|
||||
"Duration": {
|
||||
"Description": "Duration converts the given number to a time.Duration.\nUnit is one of nanosecond/ns, microsecond/us/µs, millisecond/ms, second/s, minute/m or hour/h.",
|
||||
"Args": [
|
||||
"unit",
|
||||
"number"
|
||||
],
|
||||
"Aliases": [
|
||||
"duration"
|
||||
],
|
||||
"Examples": [
|
||||
[
|
||||
"{{ mul 60 60 | duration \"second\" }}",
|
||||
"1h0m0s"
|
||||
]
|
||||
]
|
||||
},
|
||||
"Format": {
|
||||
"Description": "Format converts the textual representation of the datetime string into\nthe other form or returns it of the time.Time value. These are formatted\nwith the layout string",
|
||||
"Args": [
|
||||
@@ -1588,6 +1693,19 @@
|
||||
"now"
|
||||
],
|
||||
"Examples": []
|
||||
},
|
||||
"ParseDuration": {
|
||||
"Description": "ParseDuration parses a duration string.\nA duration string is a possibly signed sequence of\ndecimal numbers, each with optional fraction and a unit suffix,\nsuch as \"300ms\", \"-1.5h\" or \"2h45m\".\nValid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\".\nSee https://golang.org/pkg/time/#ParseDuration",
|
||||
"Args": [
|
||||
"in"
|
||||
],
|
||||
"Aliases": null,
|
||||
"Examples": [
|
||||
[
|
||||
"{{ \"1h12m10s\" | time.ParseDuration }}",
|
||||
"1h12m10s"
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"transform": {
|
||||
@@ -1763,7 +1881,7 @@
|
||||
"Examples": []
|
||||
},
|
||||
"URLize": {
|
||||
"Description": "",
|
||||
"Description": "URLize returns the given argument formatted as URL.",
|
||||
"Args": [
|
||||
"a"
|
||||
],
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/* Background */ .chroma { background-color: #f0f0f0 }
|
||||
/* Error */ .chroma .ss4 { }
|
||||
/* LineHighlight */ .chroma .hl { background-color: #ffffcc; display: block; width: 100% }
|
||||
/* LineNumbers */ .chroma .ln { ; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; }
|
||||
/* Keyword */ .chroma .s3e8 { color: #007020; font-weight: bold }
|
||||
/* KeywordPseudo */ .chroma .s3ec { color: #007020 }
|
||||
/* KeywordType */ .chroma .s3ee { color: #902000 }
|
||||
/* NameAttribute */ .chroma .s7d1 { color: #4070a0 }
|
||||
/* NameBuiltin */ .chroma .s7d2 { color: #007020 }
|
||||
/* NameClass */ .chroma .s7d4 { color: #0e84b5; font-weight: bold }
|
||||
/* NameConstant */ .chroma .s7d5 { color: #60add5 }
|
||||
/* NameDecorator */ .chroma .s7d6 { color: #555555; font-weight: bold }
|
||||
/* NameEntity */ .chroma .s7d7 { color: #d55537; font-weight: bold }
|
||||
/* NameException */ .chroma .s7d8 { color: #007020 }
|
||||
/* NameFunction */ .chroma .s7d9 { color: #06287e }
|
||||
/* NameLabel */ .chroma .s7dc { color: #002070; font-weight: bold }
|
||||
/* NameNamespace */ .chroma .s7dd { color: #0e84b5; font-weight: bold }
|
||||
/* NameTag */ .chroma .s7e2 { color: #062873; font-weight: bold }
|
||||
/* NameVariable */ .chroma .s7e3 { color: #bb60d5 }
|
||||
/* LiteralString */ .chroma .sc1c { color: #4070a0 }
|
||||
/* LiteralStringDoc */ .chroma .sc23 { color: #4070a0; font-style: italic }
|
||||
/* LiteralStringEscape */ .chroma .sc25 { color: #4070a0; font-weight: bold }
|
||||
/* LiteralStringInterpol */ .chroma .sc27 { color: #70a0d0; font-style: italic }
|
||||
/* LiteralStringOther */ .chroma .sc29 { color: #c65d09 }
|
||||
/* LiteralStringRegex */ .chroma .sc2a { color: #235388 }
|
||||
/* LiteralStringSymbol */ .chroma .sc2c { color: #517918 }
|
||||
/* LiteralNumber */ .chroma .sc80 { color: #40a070 }
|
||||
/* Operator */ .chroma .sfa0 { color: #666666 }
|
||||
/* OperatorWord */ .chroma .sfa1 { color: #007020; font-weight: bold }
|
||||
/* Comment */ .chroma .s1770 { color: #60a0b0; font-style: italic }
|
||||
/* CommentSpecial */ .chroma .s1774 { color: #60a0b0; background-color: #fff0f0 }
|
||||
/* CommentPreproc */ .chroma .s17d4 { color: #007020 }
|
||||
/* GenericDeleted */ .chroma .s1b59 { color: #a00000 }
|
||||
/* GenericEmph */ .chroma .s1b5a { font-style: italic }
|
||||
/* GenericError */ .chroma .s1b5b { color: #ff0000 }
|
||||
/* GenericHeading */ .chroma .s1b5c { color: #000080; font-weight: bold }
|
||||
/* GenericInserted */ .chroma .s1b5d { color: #00a000 }
|
||||
/* GenericOutput */ .chroma .s1b5e { color: #888888 }
|
||||
/* GenericPrompt */ .chroma .s1b5f { color: #c65d09; font-weight: bold }
|
||||
/* GenericStrong */ .chroma .s1b60 { font-weight: bold }
|
||||
/* GenericSubheading */ .chroma .s1b61 { color: #800080; font-weight: bold }
|
||||
/* GenericTraceback */ .chroma .s1b62 { color: #0044dd }
|
||||
/* TextWhitespace */ .chroma .s1f41 { color: #bbbbbb }
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
@import '_stickyheader';
|
||||
|
||||
@import '_svg';
|
||||
|
||||
@import '_chroma';
|
||||
@import '_variables';
|
||||
|
||||
.nested-blockquote blockquote {
|
||||
|
||||
+5
-5
@@ -4,19 +4,19 @@
|
||||
*
|
||||
* Licensed MIT © Zeno Rocha
|
||||
*/
|
||||
!function(e){t.exports=e()}(function(){var t;return function t(e,n,i){function o(a,u){if(!n[a]){if(!e[a]){var c="function"==typeof r&&r;if(!u&&c)return r(a,!0);if(s)return s(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var h=n[a]={exports:{}};e[a][0].call(h.exports,function(t){var n=e[a][1][t];return o(n||t)},h,h.exports,t,e,n,i)}return n[a].exports}for(var s="function"==typeof r&&r,a=0;a<i.length;a++)o(i[a]);return o}({1:[function(t,e,n){function r(t,e){for(;t&&t.nodeType!==i;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}var i=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var o=Element.prototype;o.matches=o.matchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector||o.webkitMatchesSelector}e.exports=r},{}],2:[function(t,e,n){function r(t,e,n,r,o){var s=i.apply(this,arguments);return t.addEventListener(n,s,o),{destroy:function(){t.removeEventListener(n,s,o)}}}function i(t,e,n,r){return function(n){n.delegateTarget=o(n.target,e),n.delegateTarget&&r.call(t,n)}}var o=t("./closest");e.exports=r},{"./closest":1}],3:[function(t,e,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},{}],4:[function(t,e,n){function r(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!a.string(e))throw new TypeError("Second argument must be a String");if(!a.fn(n))throw new TypeError("Third argument must be a Function");if(a.node(t))return i(t,e,n);if(a.nodeList(t))return o(t,e,n);if(a.string(t))return s(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function i(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function o(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function s(t,e,n){return u(document.body,t,e,n)}var a=t("./is"),u=t("delegate");e.exports=r},{"./is":3,delegate:2}],5:[function(t,e,n){function r(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var r=window.getSelection(),i=document.createRange();i.selectNodeContents(t),r.removeAllRanges(),r.addRange(i),e=r.toString()}return e}e.exports=r},{}],6:[function(t,e,n){function r(){}r.prototype={on:function(t,e,n){var r=this.e||(this.e={});return(r[t]||(r[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function r(){i.off(t,r),e.apply(n,arguments)}var i=this;return r._=e,this.on(t,r,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),r=0,i=n.length;for(r;r<i;r++)n[r].fn.apply(n[r].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),r=n[t],i=[];if(r&&e)for(var o=0,s=r.length;o<s;o++)r[o].fn!==e&&r[o].fn._!==e&&i.push(r[o]);return i.length?n[t]=i:delete n[t],this}},e.exports=r},{}],7:[function(e,n,r){!function(i,o){if("function"==typeof t&&t.amd)t(["module","select"],o);else if(void 0!==r)o(n,e("select"));else{var s={exports:{}};o(s,i.select),i.clipboardAction=s.exports}}(this,function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(t){return t&&t.__esModule?t:{default:t}}(e),i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=function(){function t(e){n(this,t),this.resolveOptions(e),this.initSelection()}return o(t,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener(Line truncated
|
||||
!function(e,n){t.exports=n()}(0,function(){return 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={};return 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=46)}([function(t,e,n){"use strict";function r(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var i=n(1);t.exports={isArray:null,isFunction:null,isObject:null,bind:null,each:null,map:null,mixin:null,isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isNumber:function(t){return"number"==typeof t},toStr:function(t){return void 0===t||null===t?"":t+""},cloneDeep:function(t){var e=this.mixin({},t),n=this;return this.each(e,function(t,r){t&&(n.isArray(t)?e[r]=[].concat(t):n.isObject(t)&&(e[r]=n.cloneDeep(t)))}),e},error:function(t){throw new Error(t)},every:function(t,e){var n=!0;return t?(this.each(t,function(r,i){if(!(n=e.call(null,r,i,t)))return!1}),!!n):n},any:function(t,e){var n=!1;return t?(this.each(t,function(r,i){if(e.call(null,r,i,t))return n=!0,!1}),n):n},getUniqueId:function(){var t=0;return function(){return t++}}(),templatify:function(t){if(this.isFunction(t))return t;var e=i.element(t);return"SCRIPT"===e.prop("tagName")?function(){return e.text()}:function(){return String(t)}},defer:function(t){setTimeout(t,0)},noop:function(){},formatPrefix:function(t,e){return e?"":t+"-"},className:function(t,e,n){return(n?"":".")+t+e},escapeHighlightedString:function(t,e,n){e=e||"<em>";var i=document.createElement("div");i.appendChild(document.createTextNode(e)),n=n||"</em>";var o=document.createElement("div");o.appendChild(document.createTextNode(n));var s=document.createElement("div");return s.appendChild(document.createTextNode(t)),s.innerHTML.replace(RegExp(r(i.innerHTML),"g"),e).replace(RegExp(r(o.innerHTML),"g"),n)}}},function(t,e,n){"use strict";t.exports={element:null}},function(t,e){var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,e,i){if("[object Function]"!==r.call(e))throw new TypeError("iterator must be a function");var o=t.length;if(o===+o)for(var s=0;s<o;s++)e.call(i,t[s],s,t);else for(var a in t)n.call(t,a)&&e.call(i,t[a],a,t)}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e,n){"use strict";function r(t,e){var r=n(2),i=this;"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):i.stack=(new Error).stack||"Cannot get a stacktrace, browser is too old",this.name="AlgoliaSearchError",this.message=t||"Unknown error",e&&r(e,function(t,e){i[e]=t})}function i(t,e){function n(){var n=Array.prototype.slice.call(arguments,0);"string"!=typeof n[0]&&n.unshift(e),r.apply(this,n),this.name="AlgoliaSearch"+t+"Error"}return o(n,r),n}var o=n(20);o(r,Error),t.exports={AlgoliaSearchError:r,UnparsableJSON:i("UnparsableJSON","Could not parse the incoming response as JSON, see err.more for details"),RequestTimeout:i("RequestTimeout","Request timedout before getting a response"),Network:i("Network","Network issue, see err.more for details"),JSONPScriptFail:i("JSONPScriptFail","<script> was loaded but did not call our provided callback"),JSONPScriptError:i("JSONPScriptError","<script> unable to load due to an `error` event on it"),Unknown:i("Unknown","Unknown error occured")}},function(t,e,n){(function(r){function i(){return"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function o(){var t=arguments,n=this.useColors;if(t[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+t[0]+(n?"%c ":" ")+"+"+e.humanize(this.diff),!n)return t;var r="color: "+this.color;t=[t[0],r,"color: inherit"].concat(Array.prototype.slice.call(t,1));var i=0,o=0;return t[0].replace(/%[a-z%]/g,function(t){"%%"!==t&&(i++,"%c"===t&&(o=i))}),t.splice(o,0,r),t}function s(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}}function u(){try{return e.storage.debug}catch(t){}if(void 0!==r&&"env"in r)return n.i({NODE_ENV:"production"}).DEBUG}e=t.exports=n(50),e.log=s,e.formatArgs=o,e.save=a,e.load=u,e.useColors=i,e.storage="undefined"!=typeof chrome&&void 0!==cLine truncated
|
||||
!function(e){t.exports=e()}(function(){var t;return function t(e,n,i){function o(a,u){if(!n[a]){if(!e[a]){var c="function"==typeof r&&r;if(!u&&c)return r(a,!0);if(s)return s(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var h=n[a]={exports:{}};e[a][0].call(h.exports,function(t){var n=e[a][1][t];return o(n||t)},h,h.exports,t,e,n,i)}return n[a].exports}for(var s="function"==typeof r&&r,a=0;a<i.length;a++)o(i[a]);return o}({1:[function(t,e,n){function r(t,e){for(;t&&t.nodeType!==i;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}var i=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var o=Element.prototype;o.matches=o.matchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector||o.webkitMatchesSelector}e.exports=r},{}],2:[function(t,e,n){function r(t,e,n,r,o){var s=i.apply(this,arguments);return t.addEventListener(n,s,o),{destroy:function(){t.removeEventListener(n,s,o)}}}function i(t,e,n,r){return function(n){n.delegateTarget=o(n.target,e),n.delegateTarget&&r.call(t,n)}}var o=t("./closest");e.exports=r},{"./closest":1}],3:[function(t,e,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},{}],4:[function(t,e,n){function r(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!a.string(e))throw new TypeError("Second argument must be a String");if(!a.fn(n))throw new TypeError("Third argument must be a Function");if(a.node(t))return i(t,e,n);if(a.nodeList(t))return o(t,e,n);if(a.string(t))return s(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function i(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function o(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function s(t,e,n){return u(document.body,t,e,n)}var a=t("./is"),u=t("delegate");e.exports=r},{"./is":3,delegate:2}],5:[function(t,e,n){function r(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var r=window.getSelection(),i=document.createRange();i.selectNodeContents(t),r.removeAllRanges(),r.addRange(i),e=r.toString()}return e}e.exports=r},{}],6:[function(t,e,n){function r(){}r.prototype={on:function(t,e,n){var r=this.e||(this.e={});return(r[t]||(r[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function r(){i.off(t,r),e.apply(n,arguments)}var i=this;return r._=e,this.on(t,r,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),r=0,i=n.length;for(r;r<i;r++)n[r].fn.apply(n[r].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),r=n[t],i=[];if(r&&e)for(var o=0,s=r.length;o<s;o++)r[o].fn!==e&&r[o].fn._!==e&&i.push(r[o]);return i.length?n[t]=i:delete n[t],this}},e.exports=r},{}],7:[function(e,n,r){!function(i,o){if("function"==typeof t&&t.amd)t(["module","select"],o);else if(void 0!==r)o(n,e("select"));else{var s={exports:{}};o(s,i.select),i.clipboardAction=s.exports}}(this,function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(t){return t&&t.__esModule?t:{default:t}}(e),i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=function(){function t(e){n(this,t),this.resolveOptions(e),this.initSelection()}return o(t,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener(Line truncated
|
||||
!function(e,n){t.exports=n()}(0,function(){return 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={};return 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=46)}([function(t,e,n){"use strict";function r(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var i=n(1);t.exports={isArray:null,isFunction:null,isObject:null,bind:null,each:null,map:null,mixin:null,isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isNumber:function(t){return"number"==typeof t},toStr:function(t){return void 0===t||null===t?"":t+""},cloneDeep:function(t){var e=this.mixin({},t),n=this;return this.each(e,function(t,r){t&&(n.isArray(t)?e[r]=[].concat(t):n.isObject(t)&&(e[r]=n.cloneDeep(t)))}),e},error:function(t){throw new Error(t)},every:function(t,e){var n=!0;return t?(this.each(t,function(r,i){if(!(n=e.call(null,r,i,t)))return!1}),!!n):n},any:function(t,e){var n=!1;return t?(this.each(t,function(r,i){if(e.call(null,r,i,t))return n=!0,!1}),n):n},getUniqueId:function(){var t=0;return function(){return t++}}(),templatify:function(t){if(this.isFunction(t))return t;var e=i.element(t);return"SCRIPT"===e.prop("tagName")?function(){return e.text()}:function(){return String(t)}},defer:function(t){setTimeout(t,0)},noop:function(){},formatPrefix:function(t,e){return e?"":t+"-"},className:function(t,e,n){return(n?"":".")+t+e},escapeHighlightedString:function(t,e,n){e=e||"<em>";var i=document.createElement("div");i.appendChild(document.createTextNode(e)),n=n||"</em>";var o=document.createElement("div");o.appendChild(document.createTextNode(n));var s=document.createElement("div");return s.appendChild(document.createTextNode(t)),s.innerHTML.replace(RegExp(r(i.innerHTML),"g"),e).replace(RegExp(r(o.innerHTML),"g"),n)}}},function(t,e,n){"use strict";t.exports={element:null}},function(t,e){var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,e,i){if("[object Function]"!==r.call(e))throw new TypeError("iterator must be a function");var o=t.length;if(o===+o)for(var s=0;s<o;s++)e.call(i,t[s],s,t);else for(var a in t)n.call(t,a)&&e.call(i,t[a],a,t)}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e,n){"use strict";function r(t,e){var r=n(2),i=this;"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):i.stack=(new Error).stack||"Cannot get a stacktrace, browser is too old",this.name="AlgoliaSearchError",this.message=t||"Unknown error",e&&r(e,function(t,e){i[e]=t})}function i(t,e){function n(){var n=Array.prototype.slice.call(arguments,0);"string"!=typeof n[0]&&n.unshift(e),r.apply(this,n),this.name="AlgoliaSearch"+t+"Error"}return o(n,r),n}var o=n(20);o(r,Error),t.exports={AlgoliaSearchError:r,UnparsableJSON:i("UnparsableJSON","Could not parse the incoming response as JSON, see err.more for details"),RequestTimeout:i("RequestTimeout","Request timedout before getting a response"),Network:i("Network","Network issue, see err.more for details"),JSONPScriptFail:i("JSONPScriptFail","<script> was loaded but did not call our provided callback"),JSONPScriptError:i("JSONPScriptError","<script> unable to load due to an `error` event on it"),Unknown:i("Unknown","Unknown error occured")}},function(t,e,n){(function(r){function i(){return"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function o(){var t=arguments,n=this.useColors;if(t[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+t[0]+(n?"%c ":" ")+"+"+e.humanize(this.diff),!n)return t;var r="color: "+this.color;t=[t[0],r,"color: inherit"].concat(Array.prototype.slice.call(t,1));var i=0,o=0;return t[0].replace(/%[a-z%]/g,function(t){"%%"!==t&&(i++,"%c"===t&&(o=i))}),t.splice(o,0,r),t}function s(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}}function u(){try{return e.storage.debug}catch(t){}if(void 0!==r&&"env"in r)return n.i({NODE_ENV:"production"}).DEBUG}e=t.exports=n(50),e.log=s,e.formatArgs=o,e.save=a,e.load=u,e.useColors=i,e.storage="undefined"!=typeof chrome&&void 0!==cLine truncated
|
||||
* @overview es6-promise - a tiny implementation of Promises/A+.
|
||||
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
||||
* @license Licensed under MIT license
|
||||
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
|
||||
* @version 4.0.5
|
||||
*/
|
||||
!function(e,n){t.exports=n()}(0,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function i(t){return"function"==typeof t}function o(t){V=t}function s(t){K=t}function a(){return void 0!==U?function(){U(c)}:u()}function u(){var t=setTimeout;return function(){return t(c,1)}}function c(){for(var t=0;t<B;t+=2){(0,Z[t])(Z[t+1]),Z[t]=void 0,Z[t+1]=void 0}B=0}function l(t,e){var n=arguments,r=this,i=new this.constructor(f);void 0===i[tt]&&I(i);var o=r._state;return o?function(){var t=n[o-1];K(function(){return k(o,i,t,r._result)})}():C(r,i,t,e),i}function h(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(f);return w(n,t),n}function f(){}function p(){return new TypeError("You cannot resolve a promise with itself")}function d(){return new TypeError("A promises callback cannot return that same promise.")}function g(t){try{return t.then}catch(t){return it.error=t,it}}function m(t,e,n,r){try{t.call(e,n,r)}catch(t){return t}}function v(t,e,n){K(function(t){var r=!1,i=m(n,e,function(n){r||(r=!0,e!==n?w(t,n):x(t,n))},function(e){r||(r=!0,S(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&i&&(r=!0,S(t,i))},t)}function y(t,e){e._state===nt?x(t,e._result):e._state===rt?S(t,e._result):C(e,void 0,function(e){return w(t,e)},function(e){return S(t,e)})}function b(t,e,n){e.constructor===t.constructor&&n===l&&e.constructor.resolve===h?y(t,e):n===it?S(t,it.error):void 0===n?x(t,e):i(n)?v(t,e,n):x(t,e)}function w(e,n){e===n?S(e,p()):t(n)?b(e,n,g(n)):x(e,n)}function _(t){t._onerror&&t._onerror(t._result),E(t)}function x(t,e){t._state===et&&(t._result=e,t._state=nt,0!==t._subscribers.length&&K(E,t))}function S(t,e){t._state===et&&(t._state=rt,t._result=e,K(_,t))}function C(t,e,n,r){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=e,i[o+nt]=n,i[o+rt]=r,0===o&&t._state&&K(E,t)}function E(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,i=void 0,o=t._result,s=0;s<e.length;s+=3)r=e[s],i=e[s+n],r?k(n,r,i,o):i(o);t._subscribers.length=0}}function A(){this.error=null}function T(t,e){try{return t(e)}catch(t){return ot.error=t,ot}}function k(t,e,n,r){var o=i(n),s=void 0,a=void 0,u=void 0,c=void 0;if(o){if(s=T(n,r),s===ot?(c=!0,a=s.error,s=null):u=!0,e===s)return void S(e,d())}else s=r,u=!0;e._state!==et||(o&&u?w(e,s):c?S(e,a):t===nt?x(e,s):t===rt&&S(e,s))}function O(t,e){try{e(function(e){w(t,e)},function(e){S(t,e)})}catch(e){S(t,e)}}function N(){return st++}function I(t){t[tt]=st++,t._state=void 0,t._result=void 0,t._subscribers=[]}function j(t,e){this._instanceConstructor=t,this.promise=new t(f),this.promise[tt]||I(this.promise),z(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?x(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&x(this.promise,this._result))):S(this.promise,P())}function P(){return new Error("Array Methods must be provided an Array")}function R(t){return new j(this,t).promise}function D(t){var e=this;return new e(z(t)?function(n,r){for(var i=t.length,o=0;o<i;o++)e.resolve(t[o]).then(n,r)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function L(t){var e=this,n=new e(f);return S(n,t),n}function $(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function M(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function H(t){this[tt]=N(),this._result=this._state=void 0,this._subscribers=[],f!==t&&("function"!=typeof t&&$(),this instanceof H?O(this,t):M())}function q(){var t=void 0;if(void 0!==r)t=r;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var n=null;try{n=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===n&&!e.cast)return}t.Promise=H}var F=void 0;F=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var z=F,B=0,U=void 0,V=void 0,K=function(t,e){Z[B]=t,Z[B+1]=e,2===(B+=2)&&(V?V(c):Y())},J="undefined"!=typeof window?window:void 0,W=J||{},X=W.MutationObserver||W.WebKitMutationObserver,Q="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),G="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,Z=new Array(1e3),Y=void 0;Y=Q?function(){return function(){return e.nextTick(c)}}():X?function(){var t=0,e=new X(c),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}():G?function(){var t=new MessageChannel;return t.port1.onmessage=c,function(){return t.port2.postMessage(0)}}():void 0===J?function(){try{var t=n(67);return U=t.runOnLoop||t.runOnContext,a()}catch(t){return u()}}():u();var tt=Math.randLine truncated
|
||||
!function(e,n){t.exports=n()}(0,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function i(t){return"function"==typeof t}function o(t){V=t}function s(t){K=t}function a(){return void 0!==U?function(){U(c)}:u()}function u(){var t=setTimeout;return function(){return t(c,1)}}function c(){for(var t=0;t<B;t+=2){(0,Y[t])(Y[t+1]),Y[t]=void 0,Y[t+1]=void 0}B=0}function l(t,e){var n=arguments,r=this,i=new this.constructor(f);void 0===i[tt]&&I(i);var o=r._state;return o?function(){var t=n[o-1];K(function(){return k(o,i,t,r._result)})}():C(r,i,t,e),i}function h(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(f);return w(n,t),n}function f(){}function p(){return new TypeError("You cannot resolve a promise with itself")}function d(){return new TypeError("A promises callback cannot return that same promise.")}function g(t){try{return t.then}catch(t){return it.error=t,it}}function m(t,e,n,r){try{t.call(e,n,r)}catch(t){return t}}function v(t,e,n){K(function(t){var r=!1,i=m(n,e,function(n){r||(r=!0,e!==n?w(t,n):x(t,n))},function(e){r||(r=!0,S(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&i&&(r=!0,S(t,i))},t)}function y(t,e){e._state===nt?x(t,e._result):e._state===rt?S(t,e._result):C(e,void 0,function(e){return w(t,e)},function(e){return S(t,e)})}function b(t,e,n){e.constructor===t.constructor&&n===l&&e.constructor.resolve===h?y(t,e):n===it?S(t,it.error):void 0===n?x(t,e):i(n)?v(t,e,n):x(t,e)}function w(e,n){e===n?S(e,p()):t(n)?b(e,n,g(n)):x(e,n)}function _(t){t._onerror&&t._onerror(t._result),E(t)}function x(t,e){t._state===et&&(t._result=e,t._state=nt,0!==t._subscribers.length&&K(E,t))}function S(t,e){t._state===et&&(t._state=rt,t._result=e,K(_,t))}function C(t,e,n,r){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=e,i[o+nt]=n,i[o+rt]=r,0===o&&t._state&&K(E,t)}function E(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,i=void 0,o=t._result,s=0;s<e.length;s+=3)r=e[s],i=e[s+n],r?k(n,r,i,o):i(o);t._subscribers.length=0}}function A(){this.error=null}function T(t,e){try{return t(e)}catch(t){return ot.error=t,ot}}function k(t,e,n,r){var o=i(n),s=void 0,a=void 0,u=void 0,c=void 0;if(o){if(s=T(n,r),s===ot?(c=!0,a=s.error,s=null):u=!0,e===s)return void S(e,d())}else s=r,u=!0;e._state!==et||(o&&u?w(e,s):c?S(e,a):t===nt?x(e,s):t===rt&&S(e,s))}function O(t,e){try{e(function(e){w(t,e)},function(e){S(t,e)})}catch(e){S(t,e)}}function N(){return st++}function I(t){t[tt]=st++,t._state=void 0,t._result=void 0,t._subscribers=[]}function j(t,e){this._instanceConstructor=t,this.promise=new t(f),this.promise[tt]||I(this.promise),z(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?x(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&x(this.promise,this._result))):S(this.promise,P())}function P(){return new Error("Array Methods must be provided an Array")}function R(t){return new j(this,t).promise}function D(t){var e=this;return new e(z(t)?function(n,r){for(var i=t.length,o=0;o<i;o++)e.resolve(t[o]).then(n,r)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function L(t){var e=this,n=new e(f);return S(n,t),n}function $(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function M(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function H(t){this[tt]=N(),this._result=this._state=void 0,this._subscribers=[],f!==t&&("function"!=typeof t&&$(),this instanceof H?O(this,t):M())}function q(){var t=void 0;if(void 0!==r)t=r;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var n=null;try{n=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===n&&!e.cast)return}t.Promise=H}var F=void 0;F=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var z=F,B=0,U=void 0,V=void 0,K=function(t,e){Y[B]=t,Y[B+1]=e,2===(B+=2)&&(V?V(c):Z())},J="undefined"!=typeof window?window:void 0,W=J||{},X=W.MutationObserver||W.WebKitMutationObserver,Q="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),G="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,Y=new Array(1e3),Z=void 0;Z=Q?function(){return function(){return e.nextTick(c)}}():X?function(){var t=0,e=new X(c),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}():G?function(){var t=new MessageChannel;return t.port1.onmessage=c,function(){return t.port2.postMessage(0)}}():void 0===J?function(){try{var t=n(67);return U=t.runOnLoop||t.runOnContext,a()}catch(t){return u()}}():u();var tt=Math.randLine truncated
|
||||
* scrolldir - Vertical scroll direction in CSS
|
||||
* @version v1.2.8
|
||||
* @version v1.2.17
|
||||
* @link https://github.com/dollarshaveclub/scrolldir.git
|
||||
* @author Patrick Fisher <patrick@pwfisher.com>
|
||||
* @license MIT
|
||||
**/
|
||||
!function(t,e){e()}(0,function(){"use strict";!function(){var t=document.documentElement,e=window,n=document.body,r=Array(32),i="down",o=void 0,s=void 0,a=0,u=function(){var u=e.scrollY,c=o.timeStamp,l="down"===i?Math.max:Math.min,h=n.offsetHeight-e.innerHeight;if(u=Math.max(0,u),u=Math.min(h,u),r.unshift({y:u,t:c}),r.pop(),u===l(s,u))return a=c,void(s=u);var f=c-512;if(f>a){s=u;for(var p=0;p<32&&r[p]&&!(r[p].t<f);p+=1)s=l(s,r[p].y)}Math.abs(u-s)>64&&(s=u,a=c,i="down"===i?"up":"down",t.setAttribute("data-scrolldir",i))},c=function(t){o=t,e.requestAnimationFrame(u)};s=e.scrollY,t.setAttribute("data-scrolldir",i),e.addEventListener("scroll",c)}()})}]);
|
||||
!function(t,e){e()}(0,function(){"use strict";function t(){var t=i.scrollY||i.pageYOffset,e=f.timeStamp,n="down"===s?Math.max:Math.min,g=a.offsetHeight-i.innerHeight;if(t=Math.max(0,t),t=Math.min(g,t),h.unshift({y:t,t:e}),h.pop(),t===n(p,t))return d=e,void(p=t);var m=e-c;if(m>d){p=t;for(var v=0;v<u&&h[v]&&!(h[v].t<m);v+=1)p=n(p,h[v].y)}Math.abs(t-p)>l&&(p=t,d=e,s="down"===s?"up":"down",r.setAttribute(o,s))}function e(e){return f=e,i.requestAnimationFrame(t)}var n={el:document.documentElement,win:window,attribute:"data-scrolldir",dir:"down"},r=void 0,i=void 0,o=void 0,s=void 0,a=document.body,u=32,c=512,l=64,h=Array(u),f=void 0,p=void 0,d=0;!function(t){r=n.el,i=n.win,o=n.attribute,s=n.dir,p=i.scrollY||i.pageYOffset,r.setAttribute(o,s),i.addEventListener("scroll",e)}()})}]);
|
||||
+1
-1
@@ -1 +1 @@
|
||||
html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit;font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}[hidden],template{display:none}.border-box,a,article,body,code,dd,div,dl,dt,fieldset,footer,form,h1,h2,h3,h4,h5,h6,header,html,input[type=email],input[type=number],input[type=password],input[type=tel],input[type=text],input[type=url],legend,li,main,ol,p,pre,section,table,td,textarea,th,tr,ul{box-sizing:border-box}img{max-width:100%}.cover{background-size:cover!important}.contain{background-size:contain!important}@media screen and (min-width:30em){.cover-ns{background-size:cover!important}.contain-ns{background-size:contain!important}}@media screen and (min-width:30em) and (max-width:60em){.cover-m{background-size:cover!important}.contain-m{background-size:contain!important}}@media screen and (min-width:60em){.cover-l{background-size:cover!important}.contain-l{background-size:contain!important}}.bg-center{background-position:50%}.bg-center,.bg-top{background-repeat:no-repeat}.bg-top{background-position:top}.bg-right{background-position:100%}.bg-bottom,.bg-right{background-repeat:no-repeat}.bg-bottom{background-position:bottom}.bg-left{background-repeat:no-repeat;background-position:0}@media screen and (min-width:30em){.bg-center-ns{background-position:50%}.bg-center-ns,.bg-top-ns{background-repeat:no-repeat}.bg-top-ns{background-position:top}.bg-right-ns{background-position:100%}.bg-bottom-ns,.bg-right-ns{background-repeat:no-repeat}.bg-bottom-ns{background-position:bottom}.bg-left-ns{background-repeat:no-repeat;background-position:0}}@media screen and (min-width:30em) and (max-width:60em){.bg-center-m{background-position:50%}.bg-center-m,.bg-top-m{background-repeat:no-repeat}.bg-top-m{background-position:top}.bg-right-m{background-position:100%}.bg-bottom-m,.bg-right-m{background-repeat:no-repeat}.bg-bottom-m{background-position:bottom}.bg-left-m{background-repeat:no-repeat;background-position:0}}@media screen and (min-width:60em){.bg-center-l{background-position:50%}.bg-center-l,.bg-top-l{background-repeat:no-repeat}.bg-top-l{background-position:top}.bg-right-l{background-position:100%}.bg-bottom-l,.bg-right-l{background-repeat:no-repeat}.bg-bottom-l{background-position:bottom}.bg-left-l{background-repeat:no-repeat;background-position:0}}.ba{border-style:solid;border-width:1px}.bt{border-top-style:solid;border-top-width:1px}.br{border-right-style:solid;border-right-width:1px}.bb{border-bottom-style:solid;border-bottom-width:1px}.bl{border-left-style:solid;border-left-width:1px}.bn{border-style:none;border-width:0}@media screen and (min-width:30em){.ba-ns{border-style:solid;border-width:1px}.bt-ns{border-top-style:solid;border-top-width:1px}.br-ns{border-right-style:solid;border-right-width:1px}.bb-ns{border-bottom-style:solid;border-bottom-width:1px}.bl-ns{border-left-style:solid;border-left-width:1px}.bn-ns{border-style:none;border-width:0}}@media screen and (min-width:30em) and (max-width:60em){.baLine truncated
|
||||
html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit;font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}[hidden],template{display:none}.border-box,a,article,body,code,dd,div,dl,dt,fieldset,footer,form,h1,h2,h3,h4,h5,h6,header,html,input[type=email],input[type=number],input[type=password],input[type=tel],input[type=text],input[type=url],legend,li,main,ol,p,pre,section,table,td,textarea,th,tr,ul{box-sizing:border-box}img{max-width:100%}.cover{background-size:cover!important}.contain{background-size:contain!important}@media screen and (min-width:30em){.cover-ns{background-size:cover!important}.contain-ns{background-size:contain!important}}@media screen and (min-width:30em) and (max-width:60em){.cover-m{background-size:cover!important}.contain-m{background-size:contain!important}}@media screen and (min-width:60em){.cover-l{background-size:cover!important}.contain-l{background-size:contain!important}}.bg-center{background-position:50%}.bg-center,.bg-top{background-repeat:no-repeat}.bg-top{background-position:top}.bg-right{background-position:100%}.bg-bottom,.bg-right{background-repeat:no-repeat}.bg-bottom{background-position:bottom}.bg-left{background-repeat:no-repeat;background-position:0}@media screen and (min-width:30em){.bg-center-ns{background-position:50%}.bg-center-ns,.bg-top-ns{background-repeat:no-repeat}.bg-top-ns{background-position:top}.bg-right-ns{background-position:100%}.bg-bottom-ns,.bg-right-ns{background-repeat:no-repeat}.bg-bottom-ns{background-position:bottom}.bg-left-ns{background-repeat:no-repeat;background-position:0}}@media screen and (min-width:30em) and (max-width:60em){.bg-center-m{background-position:50%}.bg-center-m,.bg-top-m{background-repeat:no-repeat}.bg-top-m{background-position:top}.bg-right-m{background-position:100%}.bg-bottom-m,.bg-right-m{background-repeat:no-repeat}.bg-bottom-m{background-position:bottom}.bg-left-m{background-repeat:no-repeat;background-position:0}}@media screen and (min-width:60em){.bg-center-l{background-position:50%}.bg-center-l,.bg-top-l{background-repeat:no-repeat}.bg-top-l{background-position:top}.bg-right-l{background-position:100%}.bg-bottom-l,.bg-right-l{background-repeat:no-repeat}.bg-bottom-l{background-position:bottom}.bg-left-l{background-repeat:no-repeat;background-position:0}}.ba{border-style:solid;border-width:1px}.bt{border-top-style:solid;border-top-width:1px}.br{border-right-style:solid;border-right-width:1px}.bb{border-bottom-style:solid;border-bottom-width:1px}.bl{border-left-style:solid;border-left-width:1px}.bn{border-style:none;border-width:0}@media screen and (min-width:30em){.ba-ns{border-style:solid;border-width:1px}.bt-ns{border-top-style:solid;border-top-width:1px}.br-ns{border-right-style:solid;border-right-width:1px}.bb-ns{border-bottom-style:solid;border-bottom-width:1px}.bl-ns{border-left-style:solid;border-left-width:1px}.bn-ns{border-style:none;border-width:0}}@media screen and (min-width:30em) and (max-width:60em){.baLine truncated
|
||||
Reference in new issue
Block a user