Squashed 'docs/' changes from 9cece6640..fb551cc75

fb551cc75 Update index.md
7af894857 Update index.md
d235753ea Hugo 0.82.1
e03e72deb Merge branch 'temp0821'
e62648961 Merge branch 'release-0.82.1'
e1ab0f6eb releaser: Add release notes to /docs for release of 0.82.1
5d354c38d Replaced ``` code blocks with Code Toggler
c9d065c20 Remove duplicate YAML keys (#1420)
8ae31e701 Add webp image encoding support
848f2af26 Update internal.md (#1407)
c103a86a4 Fix `ref` shortcode example output (#1409)
9f8ba56dc Remove leading dot from where function KEY (#1419)
363251a51 Improve presentation of template lookup order (#1382)
b73da986d Improve description of Page Resources (#1381)
4e0bb96d5 Rework robots.txt page (#1405)
edf893e6f Update migrations.md (#1412)
450f1580b Add link to `site` function doc (#1417)
cfffa6e6f Added one extension to the list (#1414)
05f1665a0 Update theme
5de0b1c6a Update theme
250e20552 Add hugo.IsExtended
dea5e1fd7 Fix typo on merge function page (#1408)
1bbed2cf3 Update configuration.md
be0b64a46 Omit ISO
cbb5b8367 Fix `dateFormat` documentation
698f15466 Regenerate the docshelper
f9a8a7cb6 Update multilingual.md
a22dc6267 Fix grammar (#1398)
eb98b0997 Fix pretty URL example (#1397)
f4c4153dc Mention date var complementation in post scheduling (#1396)
17fae284c Fix resources.ExecuteAsTemplate argument order (#1394)
97e2c2abb Use code-toggle shortcode in `multilingual.md` (#1388)
3a84929bb Harmonize capitalization (#1393)
17f15daa6 fix file naming used in example (#1392)
5d97b6a18 Add slice syntax to sections permalinks config
00665b97b Improve description of `site.md`
edcf5e3fc Fix example in `merge.md`
f275ab778 Update postprocess.md
9593e3991 Fix file name
59bd9656f Update postprocess.md
1172fb6d0 Update to theNewDynamic repository (#1263)
f5b5c1d2c Update Hugo container image
4f2e92f2a Adapt anchorize.md to Goldmark
98aa19073 Directly link to `highlight` shortcode (#1384)
4c75c2422 Fix header level
f15c06f23 markdownify: add note about render-hooks and .RenderString (#1281)
69c82eb68 Remove Blackfriday reference from shortcode desc (#1380)
36de478df Update description of ignoreFiles config setting (#1377)
6337699d8 Remove "Authors" page from documentation (#1371)
35e73ca90 fix indent in example (#1372)
d3f01f19a Remove opening body tag from header example (#1376)
341a5a7d8 Update index.md
c9bfdbee6 Release 0.82.0
119644949 releaser: Add release notes to /docs for release of 0.82.0
32efaed78 docs: Regenerate docs helper
dea5449a2 docs: Regen CLI docs
eeab18fce Merge commit '81689af79901f0cdaff765cda6322dd4a9a7ccb3'
d508a1259 Attributes for code fences should be placed after the lang indicator only
c80905cef deps: Update to esbuild v0.9.0
95350eb79 Add support for Google Analytics v4
02d36f9bc Allow markdown attribute lists to be used in title render hooks
7df220a64 Merge commit '9d31f650da964a52f05fc27b7fb99cf3e09778cf'
d80bf61b7 Fixes #7698.

git-subtree-dir: docs
git-subtree-split: fb551cc750faa83a1493b0e0d0898cd98ab74465
This commit is contained in:
Bjørn Erik Pedersen 2021-04-20 20:21:45 +02:00
parent 81689af799
commit 07b8d9466d
108 changed files with 661 additions and 612 deletions

View File

@ -9,12 +9,6 @@
margin: 0;
}
pre, .pre {
overflow-x: auto;
overflow-y: hidden;
overflow: scroll;
}
code {
padding: 0.2em;
margin: 0;
@ -23,8 +17,7 @@ code {
border-radius: 3px;
}
pre code {
pre code {
display: block;
padding: 1.5em 1.5em;
font-size: .875rem;
@ -32,7 +25,6 @@ pre code {
overflow-x: auto;
}
pre {
background-color: #fff;
color: #333;

View File

@ -4083,7 +4083,7 @@ img { max-width: 100%; }
max-width: 30em;
}
.measure-wide-l {
max-width: 34em;
max-width: 40em;
}
.measure-narrow-l {
max-width: 20em;

View File

@ -1 +1 @@
# github.com/gohugoio/gohugoioTheme v0.0.0-20210301124928-2c15837dfec3
# github.com/gohugoio/gohugoioTheme v0.0.0-20210409071416-c88da48134b7

View File

@ -92,6 +92,9 @@ respectDoNotTrack
useSessionStorage
: Enabling this will disable the use of Cookies and use Session Storage to Store the GA Client ID.
{{% warning %}}
`useSessionStorage` is not supported when using Google Analytics v4 (gtag.js).
{{% /warning %}}
### Instagram
simple

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo"
slug: hugo
url: /commands/hugo/
@ -81,4 +81,4 @@ hugo [flags]
* [hugo server](/commands/hugo_server/) - A high performance webserver
* [hugo version](/commands/hugo_version/) - Print the version number of Hugo
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo check"
slug: hugo_check
url: /commands/hugo_check/
@ -37,4 +37,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 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo check ulimit"
slug: hugo_check_ulimit
url: /commands/hugo_check_ulimit/
@ -45,4 +45,4 @@ hugo check ulimit [flags]
* [hugo check](/commands/hugo_check/) - Contains some verification checks
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo config"
slug: hugo_config
url: /commands/hugo_config/
@ -45,4 +45,4 @@ hugo config [flags]
* [hugo](/commands/hugo/) - hugo builds your site
* [hugo config mounts](/commands/hugo_config_mounts/) - Print the configured file mounts
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo config mounts"
slug: hugo_config_mounts
url: /commands/hugo_config_mounts/
@ -40,4 +40,4 @@ hugo config mounts [flags]
* [hugo config](/commands/hugo_config/) - Print the site configuration
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo convert"
slug: hugo_convert
url: /commands/hugo_convert/
@ -47,4 +47,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 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo convert toJSON"
slug: hugo_convert_toJSON
url: /commands/hugo_convert_tojson/
@ -47,4 +47,4 @@ hugo convert toJSON [flags]
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo convert toTOML"
slug: hugo_convert_toTOML
url: /commands/hugo_convert_totoml/
@ -47,4 +47,4 @@ hugo convert toTOML [flags]
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo convert toYAML"
slug: hugo_convert_toYAML
url: /commands/hugo_convert_toyaml/
@ -47,4 +47,4 @@ hugo convert toYAML [flags]
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo deploy"
slug: hugo_deploy
url: /commands/hugo_deploy/
@ -54,4 +54,4 @@ hugo deploy [flags]
* [hugo](/commands/hugo/) - hugo builds your site
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo env"
slug: hugo_env
url: /commands/hugo_env/
@ -44,4 +44,4 @@ hugo env [flags]
* [hugo](/commands/hugo/) - hugo builds your site
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo gen"
slug: hugo_gen
url: /commands/hugo_gen/
@ -40,4 +40,4 @@ A collection of several useful generators.
* [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 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo gen autocomplete"
slug: hugo_gen_autocomplete
url: /commands/hugo_gen_autocomplete/
@ -58,4 +58,4 @@ hugo gen autocomplete [flags]
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo gen chromastyles"
slug: hugo_gen_chromastyles
url: /commands/hugo_gen_chromastyles/
@ -49,4 +49,4 @@ hugo gen chromastyles [flags]
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo gen doc"
slug: hugo_gen_doc
url: /commands/hugo_gen_doc/
@ -51,4 +51,4 @@ hugo gen doc [flags]
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo gen man"
slug: hugo_gen_man
url: /commands/hugo_gen_man/
@ -47,4 +47,4 @@ hugo gen man [flags]
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo import"
slug: hugo_import
url: /commands/hugo_import/
@ -43,4 +43,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 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo import jekyll"
slug: hugo_import_jekyll
url: /commands/hugo_import_jekyll/
@ -47,4 +47,4 @@ hugo import jekyll [flags]
* [hugo import](/commands/hugo_import/) - Import your site from others.
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo list"
slug: hugo_list
url: /commands/hugo_list/
@ -46,4 +46,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 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo list all"
slug: hugo_list_all
url: /commands/hugo_list_all/
@ -44,4 +44,4 @@ hugo list all [flags]
* [hugo list](/commands/hugo_list/) - Listing out various types of content
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo list drafts"
slug: hugo_list_drafts
url: /commands/hugo_list_drafts/
@ -44,4 +44,4 @@ hugo list drafts [flags]
* [hugo list](/commands/hugo_list/) - Listing out various types of content
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo list expired"
slug: hugo_list_expired
url: /commands/hugo_list_expired/
@ -44,4 +44,4 @@ hugo list expired [flags]
* [hugo list](/commands/hugo_list/) - Listing out various types of content
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo list future"
slug: hugo_list_future
url: /commands/hugo_list_future/
@ -44,4 +44,4 @@ hugo list future [flags]
* [hugo list](/commands/hugo_list/) - Listing out various types of content
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo mod"
slug: hugo_mod
url: /commands/hugo_mod/
@ -84,4 +84,4 @@ See https://gohugo.io/hugo-modules/ for more information.
* [hugo mod vendor](/commands/hugo_mod_vendor/) - Vendor all module dependencies into the _vendor directory.
* [hugo mod verify](/commands/hugo_mod_verify/) - Verify dependencies.
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo mod clean"
slug: hugo_mod_clean
url: /commands/hugo_mod_clean/
@ -52,4 +52,4 @@ hugo mod clean [flags]
* [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers.
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo mod get"
slug: hugo_mod_get
url: /commands/hugo_mod_get/
@ -70,4 +70,4 @@ hugo mod get [flags]
* [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers.
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo mod graph"
slug: hugo_mod_graph
url: /commands/hugo_mod_graph/
@ -46,4 +46,4 @@ hugo mod graph [flags]
* [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers.
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo mod init"
slug: hugo_mod_init
url: /commands/hugo_mod_init/
@ -51,4 +51,4 @@ hugo mod init [flags]
* [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers.
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo mod npm"
slug: hugo_mod_npm
url: /commands/hugo_mod_npm/
@ -45,4 +45,4 @@ hugo mod npm [flags]
* [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers.
* [hugo mod npm pack](/commands/hugo_mod_npm_pack/) - Experimental: Prepares and writes a composite package.json file for your project.
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo mod npm pack"
slug: hugo_mod_npm_pack
url: /commands/hugo_mod_npm_pack/
@ -54,4 +54,4 @@ hugo mod npm pack [flags]
* [hugo mod npm](/commands/hugo_mod_npm/) - Various npm helpers.
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo mod tidy"
slug: hugo_mod_tidy
url: /commands/hugo_mod_tidy/
@ -40,4 +40,4 @@ hugo mod tidy [flags]
* [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers.
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo mod vendor"
slug: hugo_mod_vendor
url: /commands/hugo_mod_vendor/
@ -47,4 +47,4 @@ hugo mod vendor [flags]
* [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers.
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo mod verify"
slug: hugo_mod_verify
url: /commands/hugo_mod_verify/
@ -46,4 +46,4 @@ hugo mod verify [flags]
* [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers.
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo new"
slug: hugo_new
url: /commands/hugo_new/
@ -79,4 +79,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 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo new site"
slug: hugo_new_site
url: /commands/hugo_new_site/
@ -48,4 +48,4 @@ hugo new site [path] [flags]
* [hugo new](/commands/hugo_new/) - Create new content for your site
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo new theme"
slug: hugo_new_theme
url: /commands/hugo_new_theme/
@ -10,7 +10,7 @@ Create a new theme
### Synopsis
Create a new theme (skeleton) called [name] in the current directory.
Create a new theme (skeleton) called [name] in ./themes.
New theme is a skeleton. Please add content to the touched files. Add your
name to the copyright line in the license and adjust the theme.toml file
as you see fit.
@ -47,4 +47,4 @@ hugo new theme [name] [flags]
* [hugo new](/commands/hugo_new/) - Create new content for your site
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo server"
slug: hugo_server
url: /commands/hugo_server/
@ -92,4 +92,4 @@ hugo server [flags]
* [hugo](/commands/hugo/) - hugo builds your site
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,5 +1,5 @@
---
date: 2021-02-20
date: 2021-03-21
title: "hugo version"
slug: hugo_version
url: /commands/hugo_version/
@ -44,4 +44,4 @@ hugo version [flags]
* [hugo](/commands/hugo/) - hugo builds your site
###### Auto generated by spf13/cobra on 20-Feb-2021
###### Auto generated by spf13/cobra on 21-Mar-2021

View File

@ -1,182 +0,0 @@
---
title: Authors
linktitle: Authors
description:
date: 2016-08-22
publishdate: 2017-03-12
lastmod: 2017-03-12
keywords: [authors]
categories: ["content management"]
menu:
docs:
parent: "content-management"
weight: 55
weight: 55 #rem
draft: true
aliases: [/content/archetypes/]
toc: true
comments: Before this page is published, need to also update both site- and page-level variables documentation.
---
Larger sites often have multiple content authors. Hugo provides standardized author profiles to organize relationships between content and content creators for sites operating under a distributed authorship model.
## Author Profiles
You can create a profile containing metadata for each author on your website. These profiles have to be saved under `data/_authors/`. The filename of the profile will later be used as an identifier. This way Hugo can associate content with one or multiple authors. An author's profile can be defined in the JSON, YAML, or TOML format.
### Example: Author Profile
Let's suppose Alice Allison is a blogger. A simple unique identifier would be `alice`. Now, we have to create a file called `alice.toml` in the `data/_authors/` directory. The following example is the standardized template written in TOML:
{{< code file="data/_authors/alice.toml" >}}
givenName = "Alice" # or firstName as alias
familyName = "Allison" # or lastName as alias
displayName = "Alice Allison"
thumbnail = "static/authors/alice-thumb.jpg"
image = "static/authors/alice-full.jpg"
shortBio = "My name is Alice and I'm a blogger."
bio = "My name is Alice and I'm a blogger... some other stuff"
email = "alice.allison@email.com"
weight = 10
[social]
facebook = "alice.allison"
twitter = "alice"
website = "www.example.com"
[params]
random = "whatever you want"
{{< /code >}}
All variables are optional but it's advised to fill all important ones (e.g. names and biography) because themes can vary in their usage.
You can store files for the `thumbnail` and `image` attributes in the `static` folder. Then add the path to the photos relative to `static`; e.g., `/static/path/to/thumbnail.jpg`.
`weight` allows you to define the order of an author in an `.Authors` list and can be accessed on list or via the `.Site.Authors` variable.
The `social` section contains all the links to the social network accounts of an author. Hugo is able to generate the account links for the most popular social networks automatically. This way, you only have to enter your username. You can find a list of all supported social networks [here](#linking-social-network-accounts-automatically). All other variables, like `website` in the example above remain untouched.
The `params` section can contain arbitrary data much like the same-named section in the config file. What it contains is up to you.
## Associate Content Through Identifiers
Earlier it was mentioned that content can be associated with an author through their corresponding identifier. In our case, blogger Alice has the identifier `alice`. In the front matter of a content file, you can create a list of identifiers and assign it to the `authors` variable. Here are examples for `alice` using YAML and TOML, respectively.
```
---
title: Why Hugo is so Awesome
date: 2016-08-22T14:27:502:00
authors: ["alice"]
---
Nothing to read here. Move along...
```
```
+++
title = Why Hugo is so Awesome
date = "2016-08-22T14:27:502:00"
authors: ["alice"]
+++
Nothing to read here. Move along...
```
Future authors who might work on this blog post can append their identifiers to the `authors` array in the front matter as well.
## Work with Templates
After a successful setup it's time to give some credit to the authors by showing them on the website. Within the templates Hugo provides a list of the author's profiles if they are listed in the `authors` variable within the front matter.
The list is accessible via the `.Authors` template variable. Printing all authors of a the blog post is straight forward:
```
{{ range .Authors }}
{{ .DisplayName }}
{{ end }}
=> Alice Allison
```
Even if there are co-authors you may only want to show the main author. For this case you can use the `.Author` template variable **(note the singular form)**. The template variable contains the profile of the author that is first listed with his identifier in the front matter.
{{% note %}}
You can find a list of all template variables to access the profile information in [Author Variables](/variables/authors/).
{{% /note %}}
### Link Social Network Accounts
As aforementioned, Hugo is able to generate links to profiles of the most popular social networks. The following social networks with their corresponding identifiers are supported: `github`, `facebook`, `twitter`, `pinterest`, `instagram`, `youtube` and `linkedin`.
This is can be done with the `.Social.URL` function. Its only parameter is the name of the social network as they are defined in the profile (e.g. `facebook`, `twitter`). Custom variables like `website` remain as they are.
Most articles feature a small section with information about the author at the end. Let's create one containing the author's name, a thumbnail, a (summarized) biography and links to all social networks:
{{< code file="layouts/partials/author-info.html" download="author-info.html" >}}
{{ with .Author }}
<h3>{{ .DisplayName }}</h3>
<img src="{{ .Thumbnail | absURL }}" alt="{{ .DisplayName }}">
<p>{{ .ShortBio }}</p>
<ul>
{{ range $network, $username := .Social }}
<li><a href="{{ $.Author.Social.URL $network }}">{{ $network }}</a></li>
{{ end }}
</ul>
{{ end }}
{{< /code >}}
## Who Published What?
That question can be answered with a list of all authors and another list containing all articles that they each have written. Now we have to translate this idea into templates. The [taxonomy][] feature allows us to logically group content based on information that they have in common; e.g. a tag or a category. Well, many articles share the same author, so this should sound familiar, right?
In order to let Hugo know that we want to group content based on their author, we have to create a new taxonomy called `author` (the name corresponds to the variable in the front matter). Here is the snippet in a `config.yaml` and `config.toml`, respectively:
```
taxonomies:
author: authors
```
```
[taxonomies]
author = "authors"
```
### List All Authors
In the next step we can create a template to list all authors of your website. Later, the list can be accessed at `www.example.com/authors/`. Create a new template in the `layouts/taxonomy/` directory called `authors.term.html`. This template will be exclusively used for this taxonomy.
{{< code file="layouts/taxonomy/author.term.html" download="author.term.html" >}}
<ul>
{{ range $author, $v := .Data.Terms }}
{{ $profile := $.Authors.Get $author }}
<li>
<a href="{{ printf "%s/%s/" $.Data.Plural $author | absURL }}">
{{ $profile.DisplayName }} - {{ $profile.ShortBio }}
</a>
</li>
{{ end }}
</ul>
{{< /code >}}
`.Data.Terms` contains the identifiers of all authors and we can range over it to create a list with all author names. The `$profile` variable gives us access to the profile of the current author. This allows you to generate a nice info box with a thumbnail, a biography and social media links, like at the [end of a blog post](#linking-social-network-accounts-automatically).
### List Each Author's Publications
Last but not least, we have to create the second list that contains all publications of an author. Each list will be shown in its own page and can be accessed at `www.example.com/authors/<IDENTIFIER>`. Replace `<IDENTIFIER>` with a valid author identifier like `alice`.
The layout for this page can be defined in the template `layouts/taxonomy/author.html`.
{{< code file="layouts/taxonomy/author.html" download="author.html" >}}
{{ range .Pages }}
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<span>written by {{ .Author.DisplayName }}</span>
{{ .Summary }}
{{ end }}
{{< /code >}}
The example above generates a simple list of all posts written by a single author. Inside the loop you've access to the complete set of [page variables][pagevars]. Therefore, you can add additional information about the current posts like the publishing date or the tags.
With a lot of content this list can quickly become very long. Consider to use the [pagination][] feature. It splits the list into smaller chunks and spreads them over multiple pages.
[pagevars]: /variables/page/
[pagination]: /templates/pagination/

View File

@ -100,6 +100,8 @@ Below are all the AsciiDoc related settings in Hugo with their default values:
{{< code-toggle config="markup.asciidocExt" />}}
Notice that for security concerns only extensions that do not have path separators (either `\`, `/` or `.`) are allowed. That means that extensions can only be invoked if they are in one's ruby's `$LOAD_PATH` (ie. most likely, the extension has been installed by the user). Any extension declared relative to the website's path will not be accepted.
Example of how to set extensions and attributes:
```

View File

@ -167,14 +167,28 @@ For color codes, see https://www.google.com/search?q=color+picker
**Note** that you also set a default background color to use, see [Image Processing Config](#image-processing-config).
### JPEG Quality
### JPEG and Webp Quality
Only relevant for JPEG images, values 1 to 100 inclusive, higher is better. Default is 75.
Only relevant for JPEG and Webp images, values 1 to 100 inclusive, higher is better. Default is 75.
```go
{{ $image.Resize "600x q50" }}
```
{{< new-in "0.83.0" >}} Webp support was added in Hugo 0.83.0.
### Hint {{< new-in "0.83.0" >}}
Hint about what type of image this is. Currently only used when encoding to Webp.
Default value is `photo`.
Valid values are `picture`, `photo`, `drawing`, `icon`, or `text`.
```go
{{ $image.Resize "600x webp drawing" }}
```
### Rotate
Rotates an image by the given angle counter-clockwise. The rotation will be performed first to get the dimensions correct. The main use of this is to be able to manually correct for [EXIF orientation](https://github.com/golang/go/issues/4341) of JPEG images.
@ -258,9 +272,14 @@ You can configure an `imaging` section in `config.toml` with default image proce
# See https://github.com/disintegration/imaging
resampleFilter = "box"
# Default JPEG quality setting. Default is 75.
# Default JPEG or WEBP quality setting. Default is 75.
quality = 75
# Default hint about what type of image. Currently only used for Webp encoding.
# Default is "photo".
# Valid values are "picture", "photo", "drawing", "icon", or "text".
hint = "photo"
# Anchor used when cropping pictures.
# Default is "smart" which does Smart Cropping, using https://github.com/muesli/smartcrop
# Smart Cropping is content aware and tries to find the best crop for each image.

View File

@ -77,9 +77,9 @@ Only the obvious non-global options can be overridden per language. Examples of
You can disable one or more languages. This can be useful when working on a new translation.
```toml
{{< code-toggle file="config" >}}
disableLanguages = ["fr", "ja"]
```
{{< /code-toggle >}}
Note that you cannot disable the default content language.
@ -330,12 +330,12 @@ From within your templates, use the `i18n` function like this:
{{ i18n "home" }}
```
The function will search for the `"home"` id from `i18n/en-US.toml` file:
The function will search for the `"home"` id:
```
{{< code-toggle file="i18n/en-US" >}}
[home]
other = "Home"
```
{{< /code-toggle >}}
The result will be
@ -345,18 +345,18 @@ Home
### Query a flexible translation with variables
Often you will want to use to the page variables in the translations strings. To do that, pass on the `.` context when calling `i18n`:
Often you will want to use the page variables in the translation strings. To do so, pass the `.` context when calling `i18n`:
```
{{ i18n "wordCount" . }}
```
The function will pass the `.` context to the `"wordCount"` id in `i18n/en-US.toml` file:
The function will pass the `.` context to the `"wordCount"` id:
```
{{< code-toggle file="i18n/en-US" >}}
[wordCount]
other = "This article has {{ .WordCount }} words."
```
{{< /code-toggle >}}
Assume `.WordCount` in the context has value is 101. The result will be:
@ -372,13 +372,13 @@ In order to meet singular/plural requirement, you must pass a dictionary (map) w
{{ i18n "readingTime" .ReadingTime }}
```
The function will read `.Count` from `.ReadingTime` and evaluate where the number is singular (`one`) or plural (`other`). After that, it will pass to `readingTime` id in `i18n/en-US.toml` file:
The function will read `.Count` from `.ReadingTime` and evaluate where the number is singular (`one`) or plural (`other`). After that, it will pass to `readingTime` id:
```
{{< code-toggle file="i18n/en-US" >}}
[readingTime]
one = "One minute to read"
other = "{{.Count}} minutes to read"
```
{{< /code-toggle >}}
Assume `.ReadingTime.Count` in the context has value of 525600. The result will be:
@ -389,7 +389,7 @@ Assume `.ReadingTime.Count` in the context has value of 525600. The result will
If `.ReadingTime.Count` in the context has value is 1. The result is:
```
One minutes to read
One minute to read
```
In case you need to pass custom data: (`(dict "Count" 25)` is minimum requirement)
@ -433,7 +433,7 @@ This technique extracts the day, month and year by specifying ``.Date.Day``, ``.
You can define your menus for each language independently. Creating multilingual menus works just like [creating regular menus][menus], except they're defined in language-specific blocks in the configuration file:
```
{{< code-toggle file="config" >}}
defaultContentLanguage = "en"
[languages.en]
@ -454,7 +454,7 @@ languageName = "Deutsch"
url = "/"
name = "Startseite"
weight = 0
```
{{< /code-toggle >}}
The rendering of the main navigation works as usual. `.Site.Menus` will just contain the menu in the current language. Note that `absLangURL` below will link to the correct locale of your website. Without it, menu entries in all languages would link to the English version, since it's the default content language that resides in the root directory.

View File

@ -33,7 +33,7 @@ The bundle documentation is **work in progress**. We will publish more comprehen
{{% /note %}}
# Organization of Content Source
## Organization of Content Source
In Hugo, your content should be organized in a manner that reflects the rendered website.

View File

@ -1,6 +1,6 @@
---
title : "Page Resources"
description : "Page Resources -- images, other pages, documents etc. -- have page-relative URLs and their own metadata."
description : "Page resources -- images, other pages, documents, etc. -- have page-relative URLs and their own metadata."
date: 2018-01-24
categories: ["content management"]
keywords: [bundle,content,resources]
@ -13,10 +13,32 @@ menu:
parent: "content-management"
weight: 31
---
Page resources are only accessible from [page bundles]({{< relref
"/content-management/page-bundles" >}}), those directories with `index.md` or
`_index.md` files at their root. Page resources are only available to the
page with which they are bundled.
Page resources are available for [page bundles]({{< relref "/content-management/page-bundles" >}}) only,
i.e. a directory with either a `index.md`, or `_index.md` file at its root. Resources are only attached to
the lowest page they are bundled with, and simple which names does not contain `index.md` are not attached any resource.
In this example, `first-post` is a page bundle with access to 10 page resources including audio, data, documents, images, and video. Although `second-post` is also a page bundle, it has no page resources and is unable to directly access the page resources associated with `first-post`.
```text
content
└── post
├── first-post
│ ├── images
│ │ ├── a.jpg
│ │ ├── b.jpg
│ │ └── c.jpg
│ ├── index.md (root of page bundle)
│ ├── latest.html
│ ├── manual.json
│ ├── notice.md
│ ├── office.mp3
│ ├── pocket.mp4
│ ├── rating.pdf
│ └── safety.txt
└── second-post
└── index.md (root of page bundle)
```
## Properties

View File

@ -64,7 +64,7 @@ and a new line with a "quoted string".` */>}}
### Shortcodes with Markdown
In Hugo `0.55` we changed how the `%` delimiter works. Shortcodes using the `%` as the outer-most delimiter will now be fully rendered when sent to the content renderer (e.g. Blackfriday for Markdown), meaning they can be part of the generated table of contents, footnotes, etc.
In Hugo `0.55` we changed how the `%` delimiter works. Shortcodes using the `%` as the outer-most delimiter will now be fully rendered when sent to the content renderer. They can be part of the generated table of contents, footnotes, etc.
If you want the old behavior, you can put the following line in the start of your shortcode template:
@ -302,8 +302,8 @@ Read a more extensive description of `ref` and `relref` in the [cross references
Assuming that standard Hugo pretty URLs are turned on.
```
<a href="/blog/neat">Neat</a>
<a href="/about/#who:c28654c202e73453784cfd2c5ab356c0">Who</a>
<a href="https://example.com/blog/neat">Neat</a>
<a href="/about/#who">Who</a>
```
### `tweet`

View File

@ -36,7 +36,7 @@ Run `hugo gen chromastyles -h` for more options. See https://xyproto.github.io/s
## 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.
Highlighting is carried out via the built-in [`highlight` shortcode](https://gohugo.io/content-management/shortcodes/#highlight). It 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.
Options:

View File

@ -83,7 +83,7 @@ The following is a list of values that can be used in a `permalink` definition i
: the content's section
`:sections`
: the content's sections hierarchy
: the content's sections hierarchy. {{< new-in "0.83.0" >}} Since Hugo 0.83 you can use a selection of the sections using _slice syntax_: `:sections[1:]` includes all but the first, `:sections[:last]` includes all but the last, `:sections[last]` includes only the last, `:sections[1:2]` includes section 2 and 3. Note that this slice access will not throw any out-of-bounds errors, so you don't have to be exact.
`:title`
: the content's title
@ -202,7 +202,7 @@ The following demonstrates the concept:
```
content/posts/_index.md
=> example.com/posts/index.html
=> example.com/posts/
content/posts/post-1.md
=> example.com/posts/post-1/
```

View File

@ -2,7 +2,6 @@
title: lang.NumFmt
description: "Formats a number with a given precision using the requested `negative`, `decimal`, and `grouping` options. The `options` parameter is a string consisting of `<negative> <decimal> <grouping>`."
godocref: ""
workson: []
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-08-21

View File

@ -25,14 +25,14 @@ The `AddDate` function takes three arguments in logical order of `years`, `month
Let's assume you have a file at `data/tweets.toml` that contains a list of Tweets to display on your site's homepage. The file is filled with `[[tweet]]` blocks; e.g.---
```
{{< code-toggle file="data/tweets" >}}
[[tweet]]
name = "Steve Francia"
twitter_handle = "@spf13"
quote = "I'm creator of Hugo. #metadocreference"
link = "https://twitter.com/spf13"
date = "2017-01-07T00:00:00Z"
```
{{< /code-toggle >}}
Let's assume you want to grab Tweets from the last two years and present them in a random order. In conjunction with the [`where`](/functions/where/) and [`now`](/functions/now/) functions, you can limit our range to the last two years via `now.AddDate -2 0 0`, which represents a point in time 2 years, 0 days, and 0 hours before the time of your last site build.

View File

@ -1,6 +1,6 @@
---
title: anchorize
description: Takes a string and sanitizes it the same way as Blackfriday does for markdown headers.
description: Takes a string and sanitizes it the same way as the [`defaultMarkdownHandler`](https://gohugo.io/getting-started/configuration-markup#configure-markup) does for markdown headers.
date: 2018-10-13
categories: [functions]
menu:
@ -13,8 +13,9 @@ workson: []
relatedfuncs: [humanize]
---
The template function uses the [`SanitizedAnchorName` logic from Blackfriday](https://github.com/russross/blackfriday#sanitized-anchor-names).
Since the same sanitizing logic is used as the markdown parser, you can determine the ID of a header for linking with anchor tags.
If [Goldmark](https://gohugo.io/getting-started/configuration-markup#goldmark) is set as `defaultMarkdownHandler`, the sanitizing logic adheres to the setting [`markup.goldmark.parser.autoHeadingIDType`](https://gohugo.io/getting-started/configuration-markup#goldmark). If [Blackfriday](https://gohugo.io/getting-started/configuration-markup#blackfriday) is set as `defaultMarkdownHandler`, this template function uses the [`SanitizedAnchorName` logic from Blackfriday](https://github.com/russross/blackfriday#sanitized-anchor-names) (the same applies when `markup.goldmark.parser.autoHeadingIDType` is set to `blackfriday`).
Since the `defaultMarkdownHandler` and this template function use the same sanitizing logic, you can use the latter to determine the ID of a header for linking with anchor tags.
```
{{anchorize "This is a header"}} → "this-is-a-header"

View File

@ -17,7 +17,7 @@ relatedfuncs: [Format,now,Unix,time]
deprecated: false
---
`dateFormat` converts the textual representation of the `datetime` into the specified format or returns it as a Go `time.Time` type value. These are formatted with the layout string.
`dateFormat` converts a timestamp string `INPUT` into the format specified by the `LAYOUT` string.
```
{{ dateFormat "Monday, Jan 2, 2006" "2015-01-21" }} → "Wednesday, Jan 21, 2015"
@ -27,5 +27,6 @@ deprecated: false
As of v0.19 of Hugo, the `dateFormat` function is *not* supported as part of Hugo's [multilingual feature](/content-management/multilingual/).
{{% /warning %}}
See the [`Format` function](/functions/format/) for a more complete list of date formatting options in your templates.
See [Gos Layout String](/functions/format/#gos-layout-string) to learn about how the `LAYOUT` string has to be formatted. There are also some useful examples.
See the [`time` function](/functions/time/) to convert a timestamp string to a Go `time.Time` type value.

View File

@ -2,7 +2,6 @@
title: delimit
description: Loops through any array, slice, or map and returns a string of all the values separated by a delimiter.
godocref:
workson: []
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-01

View File

@ -2,7 +2,6 @@
title: dict
description: Creates a dictionary from a list of key and value pairs.
godocref:
workson: []
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-26

View File

@ -41,6 +41,9 @@ hugo.CommitHash
hugo.BuildDate
: the compile date of the current Hugo binary formatted with RFC 3339 e.g. `2002-10-02T10:00:00-05:00`
hugo.IsExtended {{< new-in "0.83.0" >}}
: whether this is the extended Hugo binary.
hugo.IsProduction
: returns true if `hugo.Environment` is set to the production environment

View File

@ -52,13 +52,13 @@ Assume you want to add a `location = ""` field to your front matter for every ar
└── provo.toml
```
Here is an example of the data inside `data/locations/oslo.toml`:
Here is an example:
```
{{< code-toggle file="data/locations/oslo" >}}
website = "https://www.oslo.kommune.no"
pop_city = 658390
pop_metro = 1717900
```
{{< /code-toggle >}}
The example we will use will be an article on Oslo, whose front matter should be set to exactly the same name as the corresponding file name in `data/locations/`:

View File

@ -2,7 +2,6 @@
title: lang.Merge
description: "Merge missing translations from other languages."
godocref: ""
workson: []
date: 2018-03-16
categories: [functions]
keywords: [multilingual]

View File

@ -23,3 +23,8 @@ aliases: []
```
{{ .Title | markdownify }}
```
*Note*: if you need [Render Hooks][], which `markdownify` doesn't currently
support, use [.RenderString](/functions/renderstring/) instead.
[Render Hooks]: /getting-started/configuration-markup/#markdown-render-hooks

View File

@ -14,14 +14,14 @@ relatedfuncs: [dict, append, reflect.IsMap, reflect.IsSlice]
aliases: []
---
Merge creates a copy of the final `MAP` and merges any preceeding `MAP` into it in reverse order.
Merge creates a copy of the final `MAP` and merges any preceding `MAP` into it in reverse order.
Key handling is case-insensitive.
An example merging two maps.
```go-html-template
{{ $default_params := dict "color" "blue" "width" "50%" "height" "25%" }}
{{ $user_params := dict "color" "red" "extra" (dict "duration" 2) }}
{{ $default_params := dict "color" "blue" "width" "50%" "height" "25%" "icon" "star" }}
{{ $user_params := dict "color" "red" "icon" "mail" "extra" (dict "duration" 2) }}
{{ $params := merge $default_params $user_params }}
```
@ -39,5 +39,3 @@ Resulting __$params__:
{{% note %}}
Regardless of depth, merging only applies to maps. For slices, use [append]({{< ref "functions/append" >}})
{{% /note %}}

View File

@ -25,7 +25,7 @@ If there is no slash in `PATH`, it returns an empty directory and the base is se
**Note:** On Windows, `PATH` is converted to slash (`/`) separators.
```
{{ $dirFile := path.Split "a/news.html" }} → $dirDile.Dir → "a/", $dirFile.File → "news.html"
{{ $dirFile := path.Split "news.html" }} → $dirDile.Dir → "", $dirDile.File → "news.html"
{{ $dirFile := path.Split "a/b/c" }} → $dirDile.Dir → "a/b/", $dirDile.File → "c"
{{ $dirFile := path.Split "a/news.html" }} → $dirFile.Dir → "a/", $dirFile.File → "news.html"
{{ $dirFile := path.Split "news.html" }} → $dirFile.Dir → "", $dirFile.File → "news.html"
{{ $dirFile := path.Split "a/b/c" }} → $dirFile.Dir → "a/b/", $dirFile.File → "c"
```

View File

@ -22,9 +22,9 @@ It should not be used for HTML from a third-party, or HTML with unclosed tags or
Given a site-wide [`config.toml`][config] with the following `copyright` value:
```
{{< code-toggle file="config" >}}
copyright = "© 2015 Jane Doe. <a href=\"https://creativecommons.org/licenses/by/4.0/\">Some rights reserved</a>."
```
{{< /code-toggle >}}
`{{ .Site.Copyright | safeHTML }}` in a template would then output:

View File

@ -21,11 +21,11 @@ aliases: []
Example: Given a site-wide `config.toml` that contains this menu entry:
```
{{< code-toggle file="config" >}}
[[menu.main]]
name = "IRC: #golang at freenode"
url = "irc://irc.freenode.net/#golang"
```
{{< /code-toggle >}}
* <span class="bad">`<a href="{{ .URL }}">` &rarr; `<a href="#ZgotmplZ">`</span>
* <span class="good">`<a {{ printf "href=%q" .URL | safeHTMLAttr }}>` &rarr; `<a href="irc://irc.freenode.net/#golang">`</span>

View File

@ -1,7 +1,7 @@
---
title: site
linktitle: site
description: The `site` function provides global access the same data as `.Site` page method
description: The `site` function provides global access to the same data as the `.Site` page method.
godocref:
date: 2021-02-11
publishdate: 2021-02-11

View File

@ -86,7 +86,7 @@ The following logical operators are available with `where`:
## Use `where` with `Booleans`
When using booleans you should not put quotation marks.
```go-html-template
{{range where .Pages ".Draft" true}}
{{range where .Pages "Draft" true}}
<p>{{.Title}}</p>
{{end}}
```
@ -95,7 +95,7 @@ When using booleans you should not put quotation marks.
## Use `where` with `intersect`
```go-html-template
{{ range where .Site.Pages ".Params.tags" "intersect" .Params.tags }}
{{ range where .Site.Pages "Params.tags" "intersect" .Params.tags }}
{{ if ne .Permalink $.Permalink }}
{{ .Render "summary" }}
{{ end }}
@ -131,7 +131,7 @@ then ranges through only the first 5 posts in that list:
You can also nest `where` clauses to drill down on lists of content by more than one parameter. The following first grabs all pages in the "blog" section and then ranges through the result of the first `where` clause and finds all pages that are *not* featured:
```go-html-template
{{ range where (where .Pages "Section" "blog" ) ".Params.featured" "!=" true }}
{{ range where (where .Pages "Section" "blog" ) "Params.featured" "!=" true }}
```
## Unset Fields
@ -146,7 +146,7 @@ Only the following operators are available for `nil`
* `!=`, `<>`, `ne`: True if the given field is set.
```go-html-template
{{ range where .Pages ".Params.specialpost" "!=" nil }}
{{ range where .Pages "Params.specialpost" "!=" nil }}
{{ .Content }}
{{ end }}
```
@ -166,12 +166,12 @@ section names to hard-coded values like `"posts"` or `"post"`.
If the user has not set this config parameter in their site config, it
will default to the _section with the most pages_.
The user can override the default in `config.toml`:
The user can override the default:
```toml
{{< code-toggle file="config" >}}
[params]
mainSections = ["blog", "docs"]
```
{{< /code-toggle >}}
[intersect]: /functions/intersect/
[wherekeyword]: https://www.techonthenet.com/sql/where.php

View File

@ -68,6 +68,14 @@ There are some current limitations: For tables you can currently only apply it t
{.list}
```
Note that attributes in [code fences](/content-management/syntax-highlighting/#highlighting-in-code-fences) must come after the opening tag, with any other highlighting processing instruction, e.g.:
````
```go {.myclass linenos=table,hl_lines=[8,"15-17"],linenostart=199}
// ... code
```
````
autoHeadingIDType ("github") {{< new-in "0.62.2" >}}
: The strategy used for creating auto IDs (anchor names). Available types are `github`, `github-ascii` and `blackfriday`. `github` produces GitHub-compatible IDs, `github-ascii` will drop any non-Ascii characters after accent normalization, and `blackfriday` will make the IDs work as with [Blackfriday](#blackfriday), the default Markdown engine before Hugo 0.60. Note that if Goldmark is your default Markdown engine, this is also the strategy used in the [anchorize](/functions/anchorize/) template func.
@ -179,6 +187,9 @@ Text
PlainText
: The plain variant of the above.
Attributes (map) {{< new-in "0.82.0" >}}
: A map of attributes (e.g. `id`, `class`)
#### Link with title Markdown example:
```md

View File

@ -47,15 +47,15 @@ In addition to using a single site config file, one can use the `configDir` dire
- Each file represents a configuration root object, such as `params.toml` for `[Params]`, `menu(s).toml` for `[Menu]`, `languages.toml` for `[Languages]` etc...
- Each file's content must be top-level, for example:
In `config.toml` is:
```toml
[Params]
foo = "bar"
```
In `params.toml` is:
```
{{< code-toggle file="config" >}}
[Params]
foo = "bar"
```
{{< /code-toggle >}}
{{< code-toggle file="params" >}}
foo = "bar"
{{< /code-toggle >}}
- Each directory holds a group of files containing settings unique to an environment.
- Files can be localized to become language specific.
@ -325,6 +325,8 @@ useResourceCacheWhen
writeStats {{< new-in "0.69.0" >}}
: When enabled, a file named `hugo_stats.json` will be written to your project root with some aggregated data about the build, e.g. list of HTML entities published to be used to do [CSS pruning](/hugo-pipes/postprocess/#css-purging-with-postcss). If you're only using this for the production build, you should consider placing it below [config/production](/getting-started/configuration/#configuration-directory). It's also worth mentioning that, due to the nature of the partial server builds, new HTML entities will be added when you add or change them while the server is running, but the old values will not be removed until you restart the server or run a regular `hugo` build.
**Note** that the prime use case for this is purging of unused CSS; it is build for speed and there may be false positives (e.g. elements that isn't really a HTML element).
noJSConfigInAssets {{< new-in "0.78.0" >}}
: Turn off writing a `jsconfig.json` into your `/assets` folder with mapping of imports from running [js.Build](https://gohugo.io/hugo-pipes/js). This file is intended to help with intellisense/navigation inside code editors such as [VS Code](https://code.visualstudio.com/). Note that if you do not use `js.Build`, no file will be written.
@ -444,15 +446,15 @@ To set config params, prefix the name with `HUGO_PARAMS_`
Test and document setting params via JSON env var.
{{< /todo >}}
## Ignore Content Files When Rendering
## Ignore Content and Data Files when Rendering
The following statement inside `./config.toml` will cause Hugo to ignore content files ending with `.foo` and `.boo` when rendering:
To exclude specific files from the content and data directories when rendering your site, set `ignoreFiles` to one or more regular expressions.
```
ignoreFiles = [ "\\.foo$", "\\.boo$" ]
```
For example, to ignore content and data files ending with `.foo` and `.boo`:
The above is a list of regular expressions. Note that the backslash (`\`) character is escaped in this example to keep TOML happy.
{{< code-toggle >}}
ignoreFiles = [ "\\.foo$","\\.boo$"]
{{< /code-toggle >}}
## Configure Front Matter
@ -463,20 +465,20 @@ Dates are important in Hugo, and you can configure how Hugo assigns dates to you
The default configuration is:
```toml
{{< code-toggle file="config" >}}
[frontmatter]
date = ["date", "publishDate", "lastmod"]
lastmod = [":git", "lastmod", "date", "publishDate"]
publishDate = ["publishDate", "date"]
expiryDate = ["expiryDate"]
```
{{< /code-toggle >}}
If you, as an example, have a non-standard date parameter in some of your content, you can override the setting for `date`:
```toml
{{< code-toggle file="config" >}}
[frontmatter]
date = ["myDate", ":default"]
```
{{< /code-toggle >}}
The `:default` is a shortcut to the default settings. The above will set `.Date` to the date value in `myDate` if present, if not we will look in `date`,`publishDate`, `lastmod` and pick the first valid date.
@ -490,10 +492,10 @@ The special date handlers are:
An example:
```toml
{{< code-toggle file="config" >}}
[frontmatter]
lastmod = ["lastmod", ":fileModTime", ":default"]
```
{{< /code-toggle >}}
The above will try first to extract the value for `.Lastmod` starting with the `lastmod` front matter parameter, then the content file's modification timestamp. The last, `:default` should not be needed here, but Hugo will finally look for a valid date in `:git`, `date` and then `publishDate`.
@ -504,10 +506,10 @@ The above will try first to extract the value for `.Lastmod` starting with the `
An example:
```toml
{{< code-toggle file="config" >}}
[frontmatter]
date = [":filename", ":default"]
```
{{< /code-toggle >}}
The above will try first to extract the value for `.Date` from the filename, then it will look in front matter parameters `date`, `publishDate` and lastly `lastmod`.

View File

@ -65,13 +65,13 @@ First, download the theme from GitHub and add it to your site's `themes` directo
```bash
cd quickstart
git init
git submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/ananke
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
```
*Note for non-git users:*
- If you do not have git installed, you can download the archive of the latest
version of this theme from:
https://github.com/budparr/gohugo-theme-ananke/archive/master.zip
https://github.com/theNewDynamic/gohugo-theme-ananke/archive/master.zip
- Extract that .zip file to get a "gohugo-theme-ananke-master" directory.
- Rename that directory to "ananke", and move it into the "themes/" directory.
@ -163,7 +163,7 @@ Replace the `title` above with something more personal. Also, if you already hav
**Tip:** Make the changes to the site configuration or any other file in your site while the Hugo server is running, and you will see the changes in the browser right away, though you may need to [clear your cache](https://kb.iu.edu/d/ahic).
{{% /note %}}
For theme specific configuration options, see the [theme site](https://github.com/budparr/gohugo-theme-ananke).
For theme specific configuration options, see the [theme site](https://github.com/theNewDynamic/gohugo-theme-ananke).
**For further theme customization, see [Customize a Theme](/themes/customizing/).**

View File

@ -183,15 +183,11 @@ Or...
hugo server --disableLiveReload
```
The latter flag can be omitted by adding the following key-value to your `config.toml` or `config.yml` file, respectively:
The latter flag can be omitted by adding the following:
```
{{< code-toggle file="config" >}}
disableLiveReload = true
```
```
disableLiveReload: true
```
{{< /code-toggle >}}
## Deploy Your Website

View File

@ -38,7 +38,7 @@ cd your-hugo-site
In the root directory of your Hugo site, create a `.gitlab-ci.yml` file. The `.gitlab-ci.yml` configures the GitLab CI on how to build your page. Simply add the content below.
{{< code file=".gitlab-ci.yml" >}}
image: monachus/hugo
image: registry.gitlab.com/pages/hugo:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
@ -53,6 +53,10 @@ pages:
- master
{{< /code >}}
{{% note %}}
All available Hugo versions are listed [here](https://gitlab.com/pages/hugo/container_registry)
{{% /note %}}
## Push Your Hugo Website to GitLab
Next, create a new repository on GitLab. It is *not* necessary to make the repository public. In addition, you might want to add `/public` to your .gitignore file, as there is no need to push compiled assets to GitLab or keep your output website in version control.

View File

@ -65,10 +65,10 @@ You can [set Hugo version](https://www.netlify.com/blog/2017/04/11/netlify-plus-
For production:
```
{{< code-toggle file="netlify" >}}
[context.production.environment]
HUGO_VERSION = "0.53"
```
{{< /code-toggle >}}
For testing:

View File

@ -36,13 +36,13 @@ Also see the [CLI Doc](/commands/hugo_mod_init/).
The easiest way to use a Module for a theme is to import it in the config.
1. Initialize the hugo module system: `hugo mod init github.com/<your_user>/<your_project>`
2. Import the theme in your `config.toml`:
2. Import the theme:
```toml
{{< code-toggle file="config" >}}
[module]
[[module.imports]]
path = "github.com/spf13/hyde"
```
{{< /code-toggle >}}
## Update Modules

View File

@ -40,9 +40,6 @@ Note that this is meant for small data sets, e.g. config settings. For larger da
minify [bool]
: Let `js.Build` handle the minification.
avoidTDZ {{< new-in "0.78.0" >}}
: There is/was a bug in WebKit with severe performance issue with the tracking of TDZ checks in JavaScriptCore. Enabling this flag removes the TDZ and `const` assignment checks and may improve performance of larger JS codebases until the WebKit fix is in widespread use. See https://bugs.webkit.org/show_bug.cgi?id=199866
inject [slice] {{< new-in "0.81.0" >}}
: This option allows you to automatically replace a global variable with an import from another file. The path names must be relative to `assets`. See https://esbuild.github.io/api/#inject

View File

@ -35,10 +35,12 @@ There are several ways to set up CSS purging with PostCSS in Hugo. If you have a
The below configuration will write a `hugo_stats.json` file to the project root as part of the build. If you're only using this for the production build, you should consider placing it below [config/production](/getting-started/configuration/#configuration-directory).
```toml
{{< code-toggle file="config" >}}
[build]
writeStats = true
```
{{< /code-toggle >}}
`postcss.config.js`
```js
const purgecss = require('@fullhuman/postcss-purgecss')({
@ -50,12 +52,10 @@ const purgecss = require('@fullhuman/postcss-purgecss')({
});
module.exports = {
plugins: [
require('tailwindcss'),
require('autoprefixer'),
...(process.env.HUGO_ENVIRONMENT === 'production' ? [ purgecss ] : [])
]
};
plugins: [
...(process.env.HUGO_ENVIRONMENT === 'production' ? [ purgecss ] : [])
]
};
```
Note that in the example above, the "CSS purge step" will only be applied to the production build. This means that you need to do something like this in your head template to build and include your CSS:

View File

@ -18,7 +18,7 @@ draft: false
In order to use Hugo Pipes function on an asset file containing Go Template magic the function `resources.ExecuteAsTemplate` must be used.
The function takes three arguments, the resource object, the resource target path and the template context.
The function takes three arguments: the resource target path, the template context, and the resource object.
```go-html-template
// assets/sass/template.scss
@ -35,4 +35,4 @@ body{
```go-html-template
{{ $sassTemplate := resources.Get "sass/template.scss" }}
{{ $style := $sassTemplate | resources.ExecuteAsTemplate "main.scss" . | resources.ToCSS }}
```
```

View File

@ -33,9 +33,9 @@ Hugo `0.18` was bringing full-parallel page rendering, so workarounds depending
With Hugo `0.19`, you can control this behaviour by turning off page types you do not want ({{<gh 2534 >}}). In its most extreme case, if you put the below setting in your [`config.toml`](/getting-started/configuration/), you will get **nothing!**:
```
{{< code-toggle file="config" >}}
disableKinds = ["page", "home", "section", "taxonomy", "taxonomyTerm", "RSS", "sitemap", "robotsTXT", "404"]
```
{{< /code-toggle >}}
### Other New Features

View File

@ -23,10 +23,12 @@ In `layouts/partials/mystyles.css`:
Then in `config.toml` (note that by using the `.Param` lookup func, we can override the color in a pages front matter if we want):
[params]
[params.colors]
main = "green"
text = "blue"
{{< code-toggle file="config" >}}
[params]
[params.colors]
main = "green"
text = "blue"
{{< /code-toggle >}}
And then in `layouts/partials/head.html` (or the partial used to include the head section into your layout):

View File

@ -8,14 +8,14 @@ images:
- images/blog/hugo-26-poster.png
---
This release brings a choice of **AP Style or Chicago Style Title Case** ([8fb594bf](https://github.com/gohugoio/hugo/commit/8fb594bfb090c017d4e5cbb2905780221e202c41) [#989](https://github.com/gohugoio/hugo/issues/989)). You can also now configure Blackfriday to render **« French Guillemets »** ([cb9dfc26](https://github.com/gohugoio/hugo/commit/cb9dfc2613ae5125cafa450097fb0f62dd3770e7) [#3725](https://github.com/gohugoio/hugo/issues/3725)). To enable French Guillemets, put this in your site `config.toml`:
This release brings a choice of **AP Style or Chicago Style Title Case** ([8fb594bf](https://github.com/gohugoio/hugo/commit/8fb594bfb090c017d4e5cbb2905780221e202c41) [#989](https://github.com/gohugoio/hugo/issues/989)). You can also now configure Blackfriday to render **« French Guillemets »** ([cb9dfc26](https://github.com/gohugoio/hugo/commit/cb9dfc2613ae5125cafa450097fb0f62dd3770e7) [#3725](https://github.com/gohugoio/hugo/issues/3725)). To enable French Guillemets:
```bash
{{< code-toggle file="config" >}}
[blackfriday]
angledQuotes = true
smartypantsQuotesNBSP = true
```
{{< /code-toggle >}}
Oh, and this release also fixes it so you should see no ugly long crashes no more when you step wrong in your templates ([794ea21e](https://github.com/gohugoio/hugo/commit/794ea21e9449b876c5514f1ce8fe61449bbe4980)).

View File

@ -25,12 +25,13 @@ Hugo now has:
## Notes
Hugo now defaults to **smart crop** when cropping images, if you don't specify it when calling `.Fill`.
You can get the old default by adding this to your `config.toml`:
You can get the old default by adding this:
```toml
{{< code-toggle file="config" >}}
[imaging]
anchor = "center"
```
{{< /code-toggle >}}
Also, we have removed the superflous anchor name from the processed filenames that does not use this anchor, so it can be wise to run `hugo --gc` once to remove unused images.
## Enhancements

View File

@ -13,7 +13,7 @@ This is a bug-fix release with a couple of important fixes. After getting feedba
It adds support for overlapping file mounts, even for the filesystems where we walk down the directory structure. One relevant example that is fixed by this release:
```toml
{{< code-toggle file="config" >}}
[module]
[[module.mounts]]
source="content1"
@ -21,7 +21,7 @@ target="content"
[[module.mounts]]
source="content2"
target="content/docs"
```
{{< /code-toggle >}}
The above is obviously both common and very useful. This was never an issue with the situations where you load a specific file/directory (e.g. `resources.Get "a/b/c/d/sunset.jpg"`).

View File

@ -6,12 +6,12 @@ description: "Native inline, recursive import support in PostCSS/Tailwind, \"dep
categories: ["Releases"]
---
This release adds [inline `@import`](/hugo-pipes/postcss/#options) support to `resources.PostCSS`, with imports relative to Hugo's virtual, composable file system. Another useful addition is the new `build` [configuration section](/getting-started/configuration/#configure-build). As an example in `config.toml`:
This release adds [inline `@import`](/hugo-pipes/postcss/#options) support to `resources.PostCSS`, with imports relative to Hugo's virtual, composable file system. Another useful addition is the new `build` [configuration section](/getting-started/configuration/#configure-build). As an example:
```toml
{{< code-toggle file="config" >}}
[build]
useResourceCacheWhen = "always"
```
{{< /code-toggle >}}
The above will tell Hugo to _always_ use the cached build resources inside `resources/_gen` for the build steps requiring a non-standard dependency (PostCSS and SCSS/SASS). Valid values are `never`, `always` and `fallback` (default).

View File

@ -10,7 +10,7 @@ The two main items in Hugo 0.67.0 is custom HTTP header support in `hugo server`
Being able to [configure HTTP headers](https://gohugo.io/getting-started/configuration/#configure-server) in your development server means that you can now verify how your site behaves with the intended Content Security Policy settings etc., e.g.:
```toml
{{< code-toggle file="config" >}}
[server]
[[server.headers]]
for = "/**.html"
@ -21,7 +21,7 @@ X-XSS-Protection = "1; mode=block"
X-Content-Type-Options = "nosniff"
Referrer-Policy = "strict-origin-when-cross-origin"
Content-Security-Policy = "script-src localhost:1313"
```
{{< /code-toggle >}}
**Note:** This release also changes how raw HTML files inside /content is processed to be in line with the documentation. See [#7030](https://github.com/gohugoio/hugo/issues/7030).

View File

@ -46,13 +46,13 @@ We have added a `force` flag to the [server redirects](https://gohugo.io/getting
This is set to default `false`. If you want the old behaviour you need to add this flag to your configuration:
```toml
{{< code-toggle file="config" >}}
[[redirects]]
from = "/myspa/**"
to = "/myspa/"
status = 200
force = true
```
{{< /code-toggle >}}
## Enhancements

View File

@ -128,12 +128,12 @@ There are several [Hugo Modules](https://gohugo.io/hugo-modules/)-related improv
## Minify - Keep Comments
Keep comments when running `hugo --minify` with a new setting in config.toml.
Keep comments when running `hugo --minify` with a new setting:
```toml
{{< code-toggle file="config" >}}
[minify.tdewolff.html]
keepComments = true
```
{{< /code-toggle >}}
The default value for this setting is `false`.

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

@ -0,0 +1,78 @@
---
date: 2021-03-21
title: "Hugo 0.82: Mostly bugfixes"
description: "Mostly bug fixes, but some useful improvements with Markdown attributes."
categories: ["Releases"]
---
This is a small release, mostly a maintainance/bugfix release. But also notable is that you can now add custom Markdown attributes (e.g. CSS classes) to code fences ([aed7df62](https://github.com/gohugoio/hugo/commit/aed7df62a811b07b73ec5cbbf03e69e4bbf00919) [@bep](https://github.com/bep) [#8278](https://github.com/gohugoio/hugo/issues/8278)) and that you can use the attribute lists in title render hooks (`.Attributes`; see [cd0c5d7e](https://github.com/gohugoio/hugo/commit/cd0c5d7ef32cbd570af00c50ce760452381df64e) [@bep](https://github.com/bep) [#8270](https://github.com/gohugoio/hugo/issues/8270)).
This release represents **28 contributions by 8 contributors** to the main Hugo code base.[@bep](https://github.com/bep) leads the Hugo development with a significant amount of contributions, but also a big shoutout to [@moorereason](https://github.com/moorereason), and [@gzagatti](https://github.com/gzagatti) for their ongoing contributions.
And a big thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) for his relentless work on keeping the themes site in pristine condition and to [@davidsneighbour](https://github.com/davidsneighbour), [@coliff](https://github.com/coliff) and [@kaushalmodi](https://github.com/kaushalmodi) for all the great work on the documentation site.
Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs),
which has received **20 contributions by 12 contributors**. A special thanks to [@bep](https://github.com/bep), [@jmooring](https://github.com/jmooring), [@rootkea](https://github.com/rootkea), and [@PaulPineda](https://github.com/PaulPineda) for their work on the documentation site.
Hugo now has:
* 50763+ [stars](https://github.com/gohugoio/hugo/stargazers)
* 435+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
* 370+ [themes](http://themes.gohugo.io/)
## Notes
* We have made `.MediaType` comparable [ba1d0051](https://github.com/gohugoio/hugo/commit/ba1d0051b44fdd242b20899e195e37ab26501516) [@bep](https://github.com/bep) [#8317](https://github.com/gohugoio/hugo/issues/8317)[#8324](https://github.com/gohugoio/hugo/issues/8324). This also means that the old `MediaType.Suffix` and `MediaType.FullSuffix` is moved to `MediaType.FirstSuffix.Suffix` and `MediaType.FirstSuffix.FullSuffix`, which also better describes what they represent.
## Enhancements
### Templates
* Add method mappings for strings.Contains, strings.ContainsAny [7f853003](https://github.com/gohugoio/hugo/commit/7f8530039aa018f23bad9d58e97777705a6d19ac) [@bep](https://github.com/bep)
### Output
* Make Type comparable [ba1d0051](https://github.com/gohugoio/hugo/commit/ba1d0051b44fdd242b20899e195e37ab26501516) [@bep](https://github.com/bep) [#8317](https://github.com/gohugoio/hugo/issues/8317)[#8324](https://github.com/gohugoio/hugo/issues/8324)
* Add a basic benchmark [4d24e2a3](https://github.com/gohugoio/hugo/commit/4d24e2a3261d8c7dc0395db3ac4de89ebb0974a5) [@bep](https://github.com/bep)
### Other
* Regenerate docs helper [86b4fd35](https://github.com/gohugoio/hugo/commit/86b4fd35e78f545510f19b49246a3ccf5487831b) [@bep](https://github.com/bep)
* Regen CLI docs [195d108d](https://github.com/gohugoio/hugo/commit/195d108da75c9e5b9ef790bc4a5879c1e913964b) [@bep](https://github.com/bep)
* Simplify some config loading code [df8bb881](https://github.com/gohugoio/hugo/commit/df8bb8812f466bce563cdba297db3cd3f954a799) [@bep](https://github.com/bep)
* Update github.com/evanw/esbuild v0.9.0 => v0.9.6 [57d8d208](https://github.com/gohugoio/hugo/commit/57d8d208ed2245858c6439f19803bf2749f9377f) [@bep](https://github.com/bep)
* Apply OS env overrides twice [fc06e850](https://github.com/gohugoio/hugo/commit/fc06e85082b63a54d9403e57c8d01a7d5a62fc04) [@bep](https://github.com/bep)
* Attributes for code fences should be placed after the lang indicator only [b725253f](https://github.com/gohugoio/hugo/commit/b725253f9e3033e18bd45096c0622e6fb7b1ff79) [@bep](https://github.com/bep) [#8313](https://github.com/gohugoio/hugo/issues/8313)
* Bump github.com/tdewolff/minify/v2 v2.9.15 [35dedf15](https://github.com/gohugoio/hugo/commit/35dedf15c04a605df4d4a09263b0b299e5161f86) [@bep](https://github.com/bep) [#8332](https://github.com/gohugoio/hugo/issues/8332)
* More explicit support link to discourse [137d2dab](https://github.com/gohugoio/hugo/commit/137d2dab3285e9b0f8fe4dcc65ab6ecf8bb09002) [@davidsneighbour](https://github.com/davidsneighbour)
* Update to esbuild v0.9.0 [1b1dcf58](https://github.com/gohugoio/hugo/commit/1b1dcf586e220c3a8ad5ecfa8e4c3dac97f0ab44) [@bep](https://github.com/bep)
* Allow more spacing characters in strings [0a2ab3f8](https://github.com/gohugoio/hugo/commit/0a2ab3f8feb961f8394b1f9964fab36bfa468027) [@moorereason](https://github.com/moorereason) [#8079](https://github.com/gohugoio/hugo/issues/8079)[#8079](https://github.com/gohugoio/hugo/issues/8079)
* Rename a test [35bfb662](https://github.com/gohugoio/hugo/commit/35bfb662229226d5f3cc3077ca74323f0aa88b7d) [@bep](https://github.com/bep)
* Add a debug helper [6d21559f](https://github.com/gohugoio/hugo/commit/6d21559fb55cda39c7b92bb61fd8e65a84465fe5) [@bep](https://github.com/bep)
* Add support for Google Analytics v4 [ba16a14c](https://github.com/gohugoio/hugo/commit/ba16a14c6e884e309380610331aff78213f84751) [@djatwood](https://github.com/djatwood)
* Bump go.mod to Go 1.16 [782c79ae](https://github.com/gohugoio/hugo/commit/782c79ae61a5ec30746ce3729933d6b4d31e0540) [@bep](https://github.com/bep) [#8294](https://github.com/gohugoio/hugo/issues/8294)
* #8210 Upgrade golang version for Dockerfile [5afcae7e](https://github.com/gohugoio/hugo/commit/5afcae7e0b4c08bc37db6e34ab4cf960558f4b6e) [@systemkern](https://github.com/systemkern)
* Update CONTRIBUTING.md [60469f42](https://github.com/gohugoio/hugo/commit/60469f429e227631d76d951f2ed92986f0bd92e9) [@bep](https://github.com/bep)
* Handle attribute lists in code fences [aed7df62](https://github.com/gohugoio/hugo/commit/aed7df62a811b07b73ec5cbbf03e69e4bbf00919) [@bep](https://github.com/bep) [#8278](https://github.com/gohugoio/hugo/issues/8278)
* Allow markdown attribute lists to be used in title render hooks [cd0c5d7e](https://github.com/gohugoio/hugo/commit/cd0c5d7ef32cbd570af00c50ce760452381df64e) [@bep](https://github.com/bep) [#8270](https://github.com/gohugoio/hugo/issues/8270)
* bump github.com/kyokomi/emoji/v2 from 2.2.7 to 2.2.8 [88a85dce](https://github.com/gohugoio/hugo/commit/88a85dcea951b0b5622cf02b167ec9299d93118b) [@dependabot[bot]](https://github.com/apps/dependabot)
## Fixes
### Output
* Fix output format handling for render hooks [18074d0c](https://github.com/gohugoio/hugo/commit/18074d0c2375cc4bf4d7933dd4206cb878a23d1c) [@bep](https://github.com/bep) [#8176](https://github.com/gohugoio/hugo/issues/8176)
### Other
* Fix OS env override for nested config param only available in theme [7ed56c69](https://github.com/gohugoio/hugo/commit/7ed56c6941edfdfa42eef2b779020b5d46ca194a) [@bep](https://github.com/bep) [#8346](https://github.com/gohugoio/hugo/issues/8346)
* Fix `new theme` command description [24c716ca](https://github.com/gohugoio/hugo/commit/24c716cac35b0c5476944108e545058749c43e61) [@rootkea](https://github.com/rootkea)
* Fix handling of utf8 runes in nullString() [f6612d8b](https://github.com/gohugoio/hugo/commit/f6612d8bd8c4c3bb498178d14f45d3acdf86aa7c) [@moorereason](https://github.com/moorereason)
* Fixes #7698. [01dd7c16](https://github.com/gohugoio/hugo/commit/01dd7c16af6204d18d530f9d3018689215482170) [@gzagatti](https://github.com/gzagatti)
* Fix autocomplete docs [c8f45d1d](https://github.com/gohugoio/hugo/commit/c8f45d1d861f596821afc068bd12eb1213aba5ce) [@bep](https://github.com/bep)

View File

@ -0,0 +1,19 @@
---
date: 2021-04-20
title: "Hugo 0.82.1: One Bug Fix"
description: "This version fixes a bug introduced in 0.82.0."
categories: ["Releases"]
images:
- images/blog/hugo-bug-poster.png
---
This is a bug-fix release with one important fix.
* Regression in media type suffix lookup [6e9d2bf0](https://github.com/gohugoio/hugo/commit/6e9d2bf0c936900f8f676d485098755b3f463373) [@bep](https://github.com/bep) [#8406](https://github.com/gohugoio/hugo/issues/8406)

View File

@ -23,7 +23,8 @@ If you navigate to https://gohugo.io and look in the Chrome developer network co
## 1. Configure Netlify Output Formats
Add a new custom media type and two new output formats to `config.toml`. For more on output formats in Hugo, see [Custom Output Formats](/templates/output-formats/).
```bash
```toml
[outputs]
home = [ "HTML", "RSS", "REDIR", "HEADERS" ]

View File

@ -51,7 +51,7 @@ The example below is a bit contrived, but it illustrates the flexibility of data
`jacopastorius.toml` contains the content below. `johnpatitucci.toml` contains a similar list:
```
{{< code-toggle file="jacopastorius" >}}
discography = [
"1974 Modern American Music … Period! The Criteria Sessions",
"1974 Jaco",
@ -69,7 +69,7 @@ discography = [
"2003 - Punk Jazz: The Jaco Pastorius Anthology (compilation)",
"2007 - The Essential Jaco Pastorius (compilation)"
]
```
{{< /code-toggle >}}
The list of bass players can be accessed via `.Site.Data.jazz.bass`, a single bass player by adding the filename without the suffix, e.g. `.Site.Data.jazz.bass.jacopastorius`.

View File

@ -27,14 +27,20 @@ While the following internal templates are called similar to partials, they do *
## Google Analytics
Hugo ships with internal templates for Google Analytics tracking, including both synchronous and asynchronous tracking codes.
Hugo ships with internal templates for Google Analytics tracking, including both synchronous and asynchronous tracking codes. As well as support for both v3 and v4 of Google Analytics.
### Configure Google Analytics
Provide your tracking id in your configuration file:
**Google Analytics v3 (analytics.js)**
{{< code-toggle file="config" >}}
googleAnalytics = "UA-123-45"
googleAnalytics = "UA-PROPERTY_ID"
{{</ code-toggle >}}
**Google Analytics v4 (gtag.js)**
{{< code-toggle file="config" >}}
googleAnalytics = "G-MEASUREMENT_ID"
{{</ code-toggle >}}
### Use the Google Analytics Template
@ -50,6 +56,8 @@ You can then include the Google Analytics internal template:
{{ template "_internal/google_analytics_async.html" . }}
```
When using Google Analytics v4 use `_internal/google_analytics.html`.
A `.Site.GoogleAnalytics` variable is also exposed from the config.
## Disqus
@ -58,7 +66,7 @@ Hugo also ships with an internal template for [Disqus comments][disqus], a popul
### Configure Disqus
To use Hugo's Disqus template, you first need to set a single value in your site's `config.toml` or `config.yml`:
To use Hugo's Disqus template, you first need to set a single configuration value:
{{< code-toggle file="config" >}}
disqusShortname = "yourdiscussshortname"
@ -144,6 +152,7 @@ tags = []
Hugo uses the page title and description for the title and description metadata.
The first 6 URLs from the `images` array are used for image metadata.
If [page bundles](/content-management/page-bundles/) are used and the `images` array is empty or undefined, images with filenames matching `*feature*` or `*cover*,*thumbnail*` are used for image metadata.
Various optional metadata can also be set:

View File

@ -24,15 +24,15 @@ The real power of Hugo pagination shines when combined with the [`where` functio
Pagination can be configured in your [site configuration][configuration]:
`Paginate`
`paginate`
: default = `10`. This setting can be overridden within the template.
`PaginatePath`
`paginatePath`
: default = `page`. Allows you to set a different path for your pagination pages.
Setting `Paginate` to a positive value will split the list pages for the homepage, sections and taxonomies into chunks of that size. But note that the generation of the pagination pages for sections, taxonomies and homepage is *lazy* --- the pages will not be created if not referenced by a `.Paginator` (see below).
Setting `paginate` to a positive value will split the list pages for the homepage, sections and taxonomies into chunks of that size. But note that the generation of the pagination pages for sections, taxonomies and homepage is *lazy* --- the pages will not be created if not referenced by a `.Paginator` (see below).
`PaginatePath` is used to adapt the `URL` to the pages in the paginator (the default setting will produce URLs on the form `/page/1/`.
`paginatePath` is used to adapt the `URL` to the pages in the paginator (the default setting will produce URLs on the form `/page/1/`.
## List Paginator Pages

View File

@ -99,7 +99,7 @@ Value: {{ partial "my-inline-partial" . }}
### Example GetFeatured
```go-html-template
{{/* layouts/partials/GetFeatured.html */}}
{{ return first . (where site.RegularPages ".Params.featured" true) }}
{{ return first . (where site.RegularPages "Params.featured" true) }}
```
```go-html-template
@ -175,7 +175,6 @@ The following `header.html` partial template is used for [spf13.com](https://spf
{{ partial "head_includes.html" . }}
</head>
<body lang="en">
{{< /code >}}
{{% note %}}

View File

@ -18,37 +18,49 @@ aliases: [/extras/robots-txt/]
toc: false
---
To create your robots.txt as a template, first set the `enableRobotsTXT` value to `true` in your [configuration file][config]. By default, this option generates a robots.txt with the following content, which tells search engines that they are allowed to crawl everything:
To generate a robots.txt file from a template, change the [site configuration][config]:
```
{{< code-toggle file="config">}}
enableRobotsTXT = true
{{< /code-toggle >}}
By default, Hugo generates robots.txt using an [internal template][internal].
```text
User-agent: *
```
Search engines that honor the Robots Exclusion Protocol will interpret this as permission to crawl everything on the site.
## Robots.txt Template Lookup Order
The [lookup order][lookup] for the `robots.txt` template is as follows:
You may overwrite the internal template with a custom template. Hugo selects the template using this lookup order:
* `/layouts/robots.txt`
* `/themes/<THEME>/layouts/robots.txt`
{{% note %}}
If you do not want Hugo to create a default `robots.txt` or leverage the `robots.txt` template, you can hand code your own and place the file in `static`. Remember that everything in the [static directory](/getting-started/directory-structure/) is copied over as-is when Hugo builds your site.
{{% /note %}}
1. `/layouts/robots.txt`
2. `/themes/<THEME>/layouts/robots.txt`
## Robots.txt Template Example
The following is an example `robots.txt` layout:
{{< code file="layouts/robots.txt" download="robots.txt" >}}
User-agent: *
{{range .Pages}}
Disallow: {{.RelPermalink}}
{{end}}
{{ range .Pages }}
Disallow: {{ .RelPermalink }}
{{ end }}
{{< /code >}}
This template disallows all the pages of the site by creating one `Disallow` entry for each page.
This template creates a robots.txt file with a `Disallow` directive for each page on the site. Search engines that honor the Robots Exclusion Protocol will not crawl any page on the site.
{{% note %}}
To create a robots.txt file without using a template:
1. Set `enableRobotsTXT` to `false` in the [site configuration][config].
2. Create a robots.txt file in the `static` directory.
Remember that Hugo copies everything in the [static directory][static] to the root of `publishDir` (typically `public`) when you build your site.
[config]: /getting-started/configuration/
[lookup]: /templates/lookup-order/
[robots]: https://www.robotstxt.org/
[static]: /getting-started/directory-structure/
{{% /note %}}
[config]: /getting-started/configuration/
[internal]: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_default/robots.txt

View File

@ -43,15 +43,15 @@ The table below shows the RSS template lookup order for the different page kinds
By default, Hugo will create an unlimited number of RSS entries. You can limit the number of articles included in the built-in RSS templates by assigning a numeric value to `rssLimit:` field in your project's [`config` file][config].
The following values will also be included in the RSS output if specified in your sites configuration:
The following values will also be included in the RSS output if specified:
```toml
{{< code-toggle file="config" >}}
languageCode = "en-us"
copyright = "This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License."
[author]
name = "My Name Here"
```
{{< /code-toggle >}}
## The Embedded rss.xml

View File

@ -206,7 +206,7 @@ Because we are leveraging the front matter system to define taxonomies for conte
<ul>
{{ range (.GetTerms "tags") }}
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
{{ end }}
{{ end }}
</ul>
```

View File

@ -23,6 +23,7 @@ The Hugo community uses a wide range of preferred tools and has developed plug-i
## Sublime Text
* [Hugofy](https://github.com/akmittal/Hugofy). Hugofy is a plugin for Sublime Text 3 to make life easier to use Hugo static site generator.
* [Hugo Snippets](https://packagecontrol.io/packages/Hugo%20Snippets). Hugo Snippets is a useful plugin for adding automatic snippets to Sublime Text 3.
## Visual Studio Code

View File

@ -73,7 +73,7 @@ Alternatively, you can use the new [Jekyll import command](/commands/hugo_import
## Blogger
- [blogimport](https://github.com/natefinch/blogimport) - A tool to import from Blogger posts to Hugo.
- [blogger-to-hugo](https://bitbucket.org/petraszd/blogger-to-hugo) - Another tool to import Blogger posts to Hugo. It also downloads embedded images so they will be stored locally.
- [blogger-to-hugo](https://pypi.org/project/blogger-to-hugo/) - Another tool to import Blogger posts to Hugo. It also downloads embedded images so they will be stored locally.
- [blog2md](https://github.com/palaniraja/blog2md) - Works with [exported xml](https://support.google.com/blogger/answer/41387?hl=en) file of your YOUR-TLD.blogspot.com website. It also saves comments to `YOUR-POST-NAME-comments.md` file along with posts.
- [BloggerToHugo](https://github.com/huanlin/blogger-to-hugo) - Yet another tool to import Blogger posts to Hugo. For Windows platform only, and .NET Framework 4.5 is required. See README.md before using this tool.

View File

@ -27,7 +27,7 @@ Yes you can! See [Configure with Environment Variables](/getting-started/configu
## How do I schedule posts?
1. Set `publishDate` in the page [Front Matter](/content-management/front-matter/) to a date in the future.
1. Set `publishDate` in the page [Front Matter](/content-management/front-matter/) to a datetime in the future. If you want the creation and publication datetime to be the same, it's also sufficient to only set `date`[^date-hierarchy].
2. Build and publish at intervals.
How to automate the "publish at intervals" part depends on your situation:
@ -39,6 +39,8 @@ Also see this Twitter thread:
{{< tweet 962380712027590657 >}}
[^date-hierarchy]: See [Configure Dates](https://gohugo.io/getting-started/configuration/#configure-dates) for the order in which the different date variables are complemented by each other when not explicitly set.
## Can I use the latest Hugo version on Netlify?
Yes you can! Read [this](/hosting-and-deployment/hosting-on-netlify/#configure-hugo-version-in-netlify).

Some files were not shown because too many files have changed in this diff Show More