mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Squashed 'docs/' changes from 85befbb4d..c43daf45f
c43daf45f Update build-options.md 3ebbfedd4 Build options: Improve readability 5091bf6a0 Improve safeHTMLAttr explanation b64cbce2e Fix description of collections.Apply 6ea264b9c netlify: Hugo 0.115.4 b42e7c542 Revert "config: Remove disableLiveReload" 35ce2290e Remove excess spaces in configuration docs 2edf761de Update listed titleCaseStyle default value 887f6fb97 config: Remove disableLiveReload c9f49fb26 Fix typo 37d8569ac Remove tools associated with Atom 871d11b72 Fix URL in postprocess docs bbb17d29f Update GitLab workflow bc53ea5ce Use sentence-style capitalization for headings 7ca578786 netlify: Hugo 0.115.3 c5e010bd0 Merge branch 'tempv0.115.3' c885604bf Remove starter kits page 4c0fe269e Update mention of Netlify CMS to Decap CMS 05067175c Consistently use file name instead of filename 763dd6404 Improve multilingual config example and descriptions e5aa61ec5 Use lowercase when referring to front matter (#2132) 7ba3d0c72 docs: Refresh docs.json de8bddedf Update description of timeout configuration value e1245d9f8 netify: Hugo 0.115.2 153a36bdf Merge branch 'tempv0.115.2' 707cec754 Fix typo in figure example in shortcodes.md 128cbe1e5 Improve taxonomy template examples 4e743ec36 Improve highlight function example f96fa6805 transpile sass: Fixes typo e4a8a21f7 Compile Sass to CSS, not SCSS c1538bd00 docs: Regenerate CLI docs bd4e33436 Add titleCaseStyle none and firstupper 6ff93d478 Update quick-start.md 5c6653cb1 Update build config examples and explanation 1458d9a43 Remove the `url` parameter 6a1e92044 netlify: Hugo 0.115.1 a9d5d6f2f Merge branch 'tempv0.115.1' 4c4882384 docs: Regen docs helper d1aa1c1f5 Add link to PowerShell vs Windows PowerShell documentation 6e3b70c21 Fix link to Git installation instructions 4f8a9ca38 Clarify resources.Copy arguments ee86dd121 Update theme dc7c305cf Update theme 60c23920b Clarify caching for resources.FromString (#2120) 5bf2fef6d netlify: Hugo 0.115.0 46bde87c5 Merge branch 'tempv0.115.0' 42cc48c16 Specify target path caching for resources.ExecuteAsTemplate (#2027) a54bf4cd0 Correct the sample code of mermaid (#2119) 8c49b06fc docs: Update permalinks documentation a4818d99b Page bundles: link to info about single vs. list page templates (#2116) 3fc7744d7 snap: Document removable media access dbd08f58a Update theme df5b88633 netlify: Hugo 0.114.1 6b859834a Fix typo 9ec92cf68 Improve Dart Sass example for Netlify 2d294ece9 Add Dart Sass installation and usage documentation 4c6b77d6c Fix placement of curly braces 897812a50 Update template-debugging.md to include a jsonify example 22bca519b Update GitHub Pages hosting instructions (#2109) a964d93ce Document math functions new in v0.114.0 (#2108) 9f4cb040e netlify: Hugo 0.114.0 55b4d9221 Merge branch 'tempv0.114.0' 93c4dcf93 docs: Regen docshelper 96f03c77f docs: Regen CLI docs 8e22a228a Clarify resource media type variables (#2106) 2652da8d4 Update transform.Unmarshal.md (#2105) 92657177a Update theme 4601c1d65 Update theme a216f3145 Merge commit '3c1deaf201a35de08d23cc58f8f03682cace3349' eed8794f5 cache: Set default cache path based on $USER git-subtree-dir: docs git-subtree-split: c43daf45fdc36c254f4274a0815ea62d4d8c37e0
This commit is contained in:
parent
3c1deaf201
commit
87de22d746
211 changed files with 1877 additions and 1730 deletions
2
.github/SUPPORT.md
vendored
2
.github/SUPPORT.md
vendored
|
@ -1,3 +1,3 @@
|
||||||
### Asking Support Questions
|
### Asking support questions
|
||||||
|
|
||||||
We have an active [discussion forum](https://discourse.gohugo.io) where users and developers can ask questions. Please don't use the GitHub issue tracker to ask questions.
|
We have an active [discussion forum](https://discourse.gohugo.io) where users and developers can ask questions. Please don't use the GitHub issue tracker to ask questions.
|
||||||
|
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 9.3 KiB |
6
_vendor/github.com/gohugoio/gohugoioTheme/assets/images/sponsors/cloudcannon-blue.svg
generated
Normal file
6
_vendor/github.com/gohugoio/gohugoioTheme/assets/images/sponsors/cloudcannon-blue.svg
generated
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 13 KiB |
6
_vendor/github.com/gohugoio/gohugoioTheme/assets/images/sponsors/cloudcannon-white.svg
generated
Normal file
6
_vendor/github.com/gohugoio/gohugoioTheme/assets/images/sponsors/cloudcannon-white.svg
generated
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 13 KiB |
|
@ -3,19 +3,20 @@
|
||||||
link = "https://www.linode.com/"
|
link = "https://www.linode.com/"
|
||||||
logo = "images/sponsors/linode-logo.svg"
|
logo = "images/sponsors/linode-logo.svg"
|
||||||
utm_campaign = "hugosponsor"
|
utm_campaign = "hugosponsor"
|
||||||
|
bgcolor = "#ffffff"
|
||||||
|
|
||||||
|
[[banners]]
|
||||||
|
name = "CloudCannon"
|
||||||
|
link = "https://cloudcannon.com/hugo-cms/"
|
||||||
|
logo = "/images/sponsors/cloudcannon-white.svg"
|
||||||
|
utm_campaign = "HugoSponsorship"
|
||||||
|
utm_source = "sponsor"
|
||||||
|
utm_content = "gohugo"
|
||||||
|
bgcolor = "#034AD8"
|
||||||
|
|
||||||
[[banners]]
|
[[banners]]
|
||||||
name = "Your Company?"
|
name = "Your Company?"
|
||||||
link = "https://bep.is/en/hugo-sponsor-2023-01/"
|
link = "https://bep.is/en/hugo-sponsor-2023-01/"
|
||||||
logo = "/images/sponsors/your-company.svg"
|
|
||||||
utm_campaign = "hugosponsor"
|
utm_campaign = "hugosponsor"
|
||||||
show_on_hover = true
|
show_on_hover = true
|
||||||
bgcolor = "#004887"
|
bgcolor = "#4e4f4f"
|
||||||
|
|
||||||
[[banners]]
|
|
||||||
name = "Your Company?"
|
|
||||||
link = "https://bep.is/en/hugo-sponsor-2023-01/"
|
|
||||||
logo = "/images/sponsors/your-company.svg"
|
|
||||||
utm_campaign = "hugosponsor"
|
|
||||||
show_on_hover = true
|
|
||||||
bgcolor = "#004887"
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
class="{{ $classes_box }} o-100"
|
class="{{ $classes_box }} o-100"
|
||||||
style="background-color: {{ .bgcolor }};">
|
style="background-color: {{ .bgcolor }};">
|
||||||
{{ $query_params := .query_params | default "" }}
|
{{ $query_params := .query_params | default "" }}
|
||||||
{{ $url := printf "%s?%s%s" .link $query_params (querify "utm_source" $utmSource "utm_medium" "banner" "utm_campaign" (.utm_campaign | default "hugosponsor")) | safeURL }}
|
{{ $url := printf "%s?%s%s" .link $query_params (querify "utm_source" (.utm_source | default $utmSource ) "utm_medium" "banner" "utm_campaign" (.utm_campaign | default "hugosponsor") "utm_content" (.utm_content | default "gohugoio")) | safeURL }}
|
||||||
{{ $logo := resources.Get .logo }}
|
{{ $logo := resources.Get .logo }}
|
||||||
{{ if hugo.IsProduction }}
|
{{ if hugo.IsProduction }}
|
||||||
{{ $gtagID := printf "Sponsor %s %s" .name $gtag | title }}
|
{{ $gtagID := printf "Sponsor %s %s" .name $gtag | title }}
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
show-on-hover
|
show-on-hover
|
||||||
{{ end }}"
|
{{ end }}"
|
||||||
style="">
|
style="">
|
||||||
{{ $logo.Content | safeHTML }}
|
{{ with $logo }}{{ .Content | safeHTML }}{{ end }}
|
||||||
</a>
|
</a>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<a
|
<a
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
class="w-100 grow pa3{{ if .show_on_hover }}
|
class="w-100 grow pa3{{ if .show_on_hover }}
|
||||||
show-on-hover
|
show-on-hover
|
||||||
{{ end }}">
|
{{ end }}">
|
||||||
{{ $logo.Content | safeHTML }}
|
{{ with $logo }}{{ .Content | safeHTML }}{{ end }}
|
||||||
</a>
|
</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
# github.com/gohugoio/gohugoioTheme v0.0.0-20230527124826-78bc315d7b8a
|
# github.com/gohugoio/gohugoioTheme v0.0.0-20230630055807-9874cd863bc5
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
url = "/installation/"
|
url = "/installation/"
|
||||||
|
|
||||||
[[docs]]
|
[[docs]]
|
||||||
name = "Getting Started"
|
name = "Getting started"
|
||||||
weight = 30
|
weight = 30
|
||||||
identifier = "getting-started"
|
identifier = "getting-started"
|
||||||
url = "/getting-started/"
|
url = "/getting-started/"
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
# Core menus
|
# Core menus
|
||||||
|
|
||||||
[[docs]]
|
[[docs]]
|
||||||
name = "Content Management"
|
name = "Content management"
|
||||||
weight = 50
|
weight = 50
|
||||||
identifier = "content-management"
|
identifier = "content-management"
|
||||||
post = "expanded"
|
post = "expanded"
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
[[docs]]
|
[[docs]]
|
||||||
name = "Hugo Pipes"
|
name = "Hugo Pipes"
|
||||||
weight = 90
|
weight = 90
|
||||||
identifier = "pipes"
|
identifier = "hugo-pipes"
|
||||||
url = "/hugo-pipes/"
|
url = "/hugo-pipes/"
|
||||||
|
|
||||||
[[docs]]
|
[[docs]]
|
||||||
|
@ -72,13 +72,13 @@
|
||||||
url = "/troubleshooting/"
|
url = "/troubleshooting/"
|
||||||
|
|
||||||
[[docs]]
|
[[docs]]
|
||||||
name = "Tools"
|
name = "Developer tools"
|
||||||
weight = 120
|
weight = 120
|
||||||
identifier = "tools"
|
identifier = "developer-tools"
|
||||||
url = "/tools/"
|
url = "/tools/"
|
||||||
|
|
||||||
[[docs]]
|
[[docs]]
|
||||||
name = "Hosting & Deployment"
|
name = "Hosting and deployment"
|
||||||
weight = 130
|
weight = 130
|
||||||
identifier = "hosting-and-deployment"
|
identifier = "hosting-and-deployment"
|
||||||
url = "/hosting-and-deployment/"
|
url = "/hosting-and-deployment/"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
title: "The world’s fastest framework for building websites"
|
title: The world’s fastest framework for building websites
|
||||||
date: 2017-03-02T12:00:00-05:00
|
date: 2017-03-02T12:00:00-05:00
|
||||||
features:
|
features:
|
||||||
- heading: Blistering Speed
|
- heading: Blistering Speed
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
---
|
---
|
||||||
title: About Hugo
|
title: About Hugo
|
||||||
linktitle: Overview
|
linkTitle: Overview
|
||||||
description: Hugo's features, roadmap, license, and motivation.
|
description: Hugo's features, roadmap, license, and motivation.
|
||||||
categories: []
|
categories: []
|
||||||
keywords: []
|
keywords: []
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
|
identifier: about-hugo-overview
|
||||||
parent: about
|
parent: about
|
||||||
weight: 1
|
weight: 10
|
||||||
weight: 1
|
weight: 10
|
||||||
aliases: [/about-hugo/,/docs/]
|
aliases: [/about-hugo/,/docs/]
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
---
|
---
|
||||||
title: The Benefits of Static Site Generators
|
title: Benefits of static site generators
|
||||||
linktitle: The Benefits of Static
|
linkTitle: Static site generators
|
||||||
description: Improved performance, security and ease of use are just a few of the reasons static site generators are so appealing.
|
description: Improved performance, security and ease of use are just a few of the reasons static site generators are so appealing.
|
||||||
keywords: [ssg,static,performance,security]
|
keywords: [ssg,static,performance,security]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
parent: about
|
parent: about
|
||||||
weight: 30
|
weight: 40
|
||||||
weight: 30
|
weight: 40
|
||||||
---
|
---
|
||||||
|
|
||||||
The purpose of website generators is to render content into HTML files. Most are "dynamic site generators." That means the HTTP server---i.e., the program that sends files to the browser to be viewed---runs the generator to create a new HTML file every time an end user requests a page.
|
The purpose of website generators is to render content into HTML files. Most are "dynamic site generators." That means the HTTP server---i.e., the program that sends files to the browser to be viewed---runs the generator to create a new HTML file every time an end user requests a page.
|
||||||
|
@ -18,7 +18,7 @@ Hugo takes caching a step further and all HTML files are rendered on your comput
|
||||||
|
|
||||||
This has many benefits. The most noticeable is performance. HTTP servers are *very* good at sending files---so good, in fact, that you can effectively serve the same number of pages with a fraction of the memory and CPU needed for a dynamic site.
|
This has many benefits. The most noticeable is performance. HTTP servers are *very* good at sending files---so good, in fact, that you can effectively serve the same number of pages with a fraction of the memory and CPU needed for a dynamic site.
|
||||||
|
|
||||||
## More on Static Site Generators
|
## More on static site generators
|
||||||
|
|
||||||
* ["An Introduction to Static Site Generators", David Walsh]
|
* ["An Introduction to Static Site Generators", David Walsh]
|
||||||
* ["Hugo vs. WordPress page load speed comparison: Hugo leaves WordPress in its dust", GettingThingsTech][hugovwordpress]
|
* ["Hugo vs. WordPress page load speed comparison: Hugo leaves WordPress in its dust", GettingThingsTech][hugovwordpress]
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
---
|
---
|
||||||
title: Hugo Features
|
title: Hugo features
|
||||||
description: Hugo boasts blistering speed, robust content management, and a powerful templating language making it a great fit for all kinds of static websites.
|
description: Hugo boasts blistering speed, robust content management, and a powerful templating language making it a great fit for all kinds of static websites.
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
parent: about
|
parent: about
|
||||||
weight: 20
|
weight: 30
|
||||||
weight: 20
|
weight: 30
|
||||||
toc: true
|
toc: true
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ toc: true
|
||||||
* ["Minutes to Read"][pagevars] functionality
|
* ["Minutes to Read"][pagevars] functionality
|
||||||
* ["WordCount"][pagevars] functionality
|
* ["WordCount"][pagevars] functionality
|
||||||
|
|
||||||
## Additional Features
|
## Additional features
|
||||||
|
|
||||||
* Integrated [Disqus] comment support
|
* Integrated [Disqus] comment support
|
||||||
* Integrated [Google Analytics] support
|
* Integrated [Google Analytics] support
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
---
|
---
|
||||||
title: Hugo and the General Data Protection Regulation (GDPR)
|
title: Hugo and the General Data Protection Regulation
|
||||||
linktitle: Hugo and GDPR
|
linkTitle: Hugo and the GDPR
|
||||||
description: About how to configure your Hugo site to meet the new regulations.
|
description: About how to configure your Hugo site to meet the new regulations.
|
||||||
layout: single
|
layout: single
|
||||||
keywords: ["GDPR", "Privacy", "Data Protection"]
|
keywords: ["GDPR", "Privacy", "Data Protection"]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
parent: about
|
parent: about
|
||||||
weight: 5
|
weight: 60
|
||||||
weight: 5
|
weight: 60
|
||||||
aliases: [/privacy/,/gdpr/]
|
aliases: [/privacy/,/gdpr/]
|
||||||
toc: true
|
toc: true
|
||||||
---
|
---
|
||||||
|
@ -17,7 +17,7 @@ toc: true
|
||||||
|
|
||||||
**Hugo is a static site generator. By using Hugo you are already standing on very solid ground. Static HTML files on disk are much easier to reason about compared to server and database driven web sites.**
|
**Hugo is a static site generator. By using Hugo you are already standing on very solid ground. Static HTML files on disk are much easier to reason about compared to server and database driven web sites.**
|
||||||
|
|
||||||
But even static websites can integrate with external services, so from version `0.41`, Hugo provides a **Privacy Config** that covers the relevant built-in templates.
|
But even static websites can integrate with external services, so from version `0.41`, Hugo provides a **privacy configuration** that covers the relevant built-in templates.
|
||||||
|
|
||||||
Note that:
|
Note that:
|
||||||
|
|
||||||
|
@ -25,9 +25,9 @@ toc: true
|
||||||
* These settings work with the [internal templates](/templates/internal/). Some theme may contain custom templates for embedding services like Google Analytics. In that case these options have no effect.
|
* These settings work with the [internal templates](/templates/internal/). Some theme may contain custom templates for embedding services like Google Analytics. In that case these options have no effect.
|
||||||
* We will continue this work and improve this further in future Hugo versions.
|
* We will continue this work and improve this further in future Hugo versions.
|
||||||
|
|
||||||
## All Privacy Settings
|
## All privacy settings
|
||||||
|
|
||||||
Below are all privacy settings and their default value. These settings need to be put in your site config (e.g. `hugo.toml`).
|
Below are all privacy settings and their default value. These settings need to be put in your site configuration (e.g. `hugo.toml`).
|
||||||
|
|
||||||
{{< code-toggle file="hugo" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[privacy]
|
[privacy]
|
||||||
|
@ -54,11 +54,11 @@ disable = false
|
||||||
privacyEnhanced = false
|
privacyEnhanced = false
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
## Disable All Services
|
## Disable all services
|
||||||
|
|
||||||
An example Privacy Config that disables all the relevant services in Hugo. With this configuration, the other settings will not matter.
|
An example privacy configuration that disables all the relevant services in Hugo. With this configuration, the other settings will not matter.
|
||||||
|
|
||||||
{{< code-toggle file="hugo" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[privacy]
|
[privacy]
|
||||||
[privacy.disqus]
|
[privacy.disqus]
|
||||||
disable = true
|
disable = true
|
||||||
|
@ -74,7 +74,7 @@ disable = true
|
||||||
disable = true
|
disable = true
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
## The Privacy Settings Explained
|
## The privacy settings explained
|
||||||
|
|
||||||
### GoogleAnalytics
|
### GoogleAnalytics
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
---
|
---
|
||||||
title: Apache License
|
title: License
|
||||||
linktitle: License
|
|
||||||
description: Hugo v0.15 and later are released under the Apache 2.0 license.
|
description: Hugo v0.15 and later are released under the Apache 2.0 license.
|
||||||
categories: ["about hugo"]
|
categories: ["about hugo"]
|
||||||
keywords: ["License","apache"]
|
keywords: ["License","apache"]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
parent: about
|
parent: about
|
||||||
weight: 60
|
weight: 70
|
||||||
weight: 60
|
weight: 70
|
||||||
aliases: [/meta/license]
|
aliases: [/meta/license]
|
||||||
toc: true
|
toc: true
|
||||||
---
|
---
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
---
|
---
|
||||||
title: Hugo's Security Model
|
title: Hugo's security model
|
||||||
description: A summary of Hugo's security model.
|
description: A summary of Hugo's security model.
|
||||||
layout: single
|
layout: single
|
||||||
keywords: ["Security", "Privacy"]
|
keywords: ["Security", "Privacy"]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
parent: about
|
parent: about
|
||||||
weight: 4
|
weight: 50
|
||||||
weight: 5
|
weight: 50
|
||||||
aliases: [/security/]
|
aliases: [/security/]
|
||||||
toc: true
|
toc: true
|
||||||
---
|
---
|
||||||
|
|
||||||
## Runtime Security
|
## Runtime security
|
||||||
|
|
||||||
Hugo produces static output, so once built, the runtime is the browser (assuming the output is HTML) and any server (API) that you integrate with.
|
Hugo produces static output, so once built, the runtime is the browser (assuming the output is HTML) and any server (API) that you integrate with.
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ But when developing and building your site, the runtime is the `hugo` executable
|
||||||
* User-defined components have read-only access to the filesystem.
|
* User-defined components have read-only access to the filesystem.
|
||||||
* We shell out to some external binaries to support [Asciidoctor](/content-management/formats/#list-of-content-formats) and similar, but those binaries and their flags are predefined and disabled by default (see [Security Policy](#security-policy)). General functions to run arbitrary external OS commands have been [discussed](https://github.com/gohugoio/hugo/issues/796), but not implemented because of security concerns.
|
* We shell out to some external binaries to support [Asciidoctor](/content-management/formats/#list-of-content-formats) and similar, but those binaries and their flags are predefined and disabled by default (see [Security Policy](#security-policy)). General functions to run arbitrary external OS commands have been [discussed](https://github.com/gohugoio/hugo/issues/796), but not implemented because of security concerns.
|
||||||
|
|
||||||
## Security Policy
|
## Security policy
|
||||||
|
|
||||||
Hugo has a built-in security policy that restricts access to [os/exec](https://pkg.go.dev/os/exec), remote communication and similar.
|
Hugo has a built-in security policy that restricts access to [os/exec](https://pkg.go.dev/os/exec), remote communication and similar.
|
||||||
|
|
||||||
|
@ -33,19 +33,19 @@ The default configuration is listed below. Any build using features not in the a
|
||||||
|
|
||||||
{{< code-toggle config="security" />}}
|
{{< code-toggle config="security" />}}
|
||||||
|
|
||||||
Note that these and other config settings in Hugo can be overridden by the OS environment. If you want to block all remote HTTP fetching of data:
|
Note that these and other configuration settings in Hugo can be overridden by the OS environment. If you want to block all remote HTTP fetching of data:
|
||||||
|
|
||||||
```txt
|
```txt
|
||||||
HUGO_SECURITY_HTTP_URLS=none hugo
|
HUGO_SECURITY_HTTP_URLS=none hugo
|
||||||
```
|
```
|
||||||
|
|
||||||
## Dependency Security
|
## Dependency security
|
||||||
|
|
||||||
Hugo is built as a static binary using [Go Modules](https://github.com/golang/go/wiki/Modules) to manage its dependencies. Go Modules have several safeguards, one of them being the `go.sum` file. This is a database of the expected cryptographic checksums of all of your dependencies, including transitive dependencies.
|
Hugo is built as a static binary using [Go Modules](https://github.com/golang/go/wiki/Modules) to manage its dependencies. Go Modules have several safeguards, one of them being the `go.sum` file. This is a database of the expected cryptographic checksums of all of your dependencies, including transitive dependencies.
|
||||||
|
|
||||||
[Hugo Modules](/hugo-modules/) is a feature built on top of the functionality of Go Modules. Like Go Modules, a Hugo project using Hugo Modules will have a `go.sum` file. We recommend that you commit this file to your version control system. The Hugo build will fail if there is a checksum mismatch, which would be an indication of [dependency tampering](https://julienrenaux.fr/2019/12/20/github-actions-security-risk/).
|
[Hugo Modules](/hugo-modules/) is a feature built on top of the functionality of Go Modules. Like Go Modules, a Hugo project using Hugo Modules will have a `go.sum` file. We recommend that you commit this file to your version control system. The Hugo build will fail if there is a checksum mismatch, which would be an indication of [dependency tampering](https://julienrenaux.fr/2019/12/20/github-actions-security-risk/).
|
||||||
|
|
||||||
## Web Application Security
|
## Web application security
|
||||||
|
|
||||||
These are the security threats as defined by [OWASP](https://en.wikipedia.org/wiki/OWASP).
|
These are the security threats as defined by [OWASP](https://en.wikipedia.org/wiki/OWASP).
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@ layout: single
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
parent: about
|
parent: about
|
||||||
weight: 10
|
weight: 20
|
||||||
weight: 10
|
weight: 20
|
||||||
aliases: [/overview/introduction/,/about/why-i-built-hugo/]
|
aliases: [/overview/introduction/,/about/why-i-built-hugo/]
|
||||||
toc: true
|
toc: true
|
||||||
---
|
---
|
||||||
|
@ -17,15 +17,15 @@ Websites built with Hugo are extremely fast and secure. Hugo sites can be hosted
|
||||||
|
|
||||||
We think of Hugo as the ideal website creation tool with nearly instant build times, able to rebuild whenever a change is made.
|
We think of Hugo as the ideal website creation tool with nearly instant build times, able to rebuild whenever a change is made.
|
||||||
|
|
||||||
## How Fast is Hugo?
|
## How fast is Hugo?
|
||||||
|
|
||||||
{{< youtube "CdiDYZ51a2o" >}}
|
{{< youtube "CdiDYZ51a2o" >}}
|
||||||
|
|
||||||
## What Does Hugo Do?
|
## What does Hugo do?
|
||||||
|
|
||||||
In technical terms, Hugo takes a source directory of files and templates and uses these as input to create a complete website.
|
In technical terms, Hugo takes a source directory of files and templates and uses these as input to create a complete website.
|
||||||
|
|
||||||
## Who Should Use Hugo?
|
## Who should use Hugo?
|
||||||
|
|
||||||
Hugo is for people that prefer writing in a text editor over a browser.
|
Hugo is for people that prefer writing in a text editor over a browser.
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ hugo [flags]
|
||||||
-D, --buildDrafts include content marked as draft
|
-D, --buildDrafts include content marked as draft
|
||||||
-E, --buildExpired include expired content
|
-E, --buildExpired include expired content
|
||||||
-F, --buildFuture include content with publishdate in the future
|
-F, --buildFuture include content with publishdate in the future
|
||||||
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
|
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache_$USER/
|
||||||
--cleanDestinationDir remove files from destination not found in static directories
|
--cleanDestinationDir remove files from destination not found in static directories
|
||||||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||||
--config string config file (default is hugo.yaml|json|toml)
|
--config string config file (default is hugo.yaml|json|toml)
|
||||||
|
@ -44,8 +44,7 @@ hugo [flags]
|
||||||
--ignoreCache ignores the cache directory
|
--ignoreCache ignores the cache directory
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
-l, --layoutDir string filesystem path to layout directory
|
-l, --layoutDir string filesystem path to layout directory
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--minify minify any supported output format (HTML, XML etc.)
|
--minify minify any supported output format (HTML, XML etc.)
|
||||||
--noBuildLock don't create .hugo_build.lock file
|
--noBuildLock don't create .hugo_build.lock file
|
||||||
--noChmod don't sync permission mode of files
|
--noChmod don't sync permission mode of files
|
||||||
|
@ -65,7 +64,6 @@ hugo [flags]
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
--trace file write trace to file (not useful in general)
|
--trace file write trace to file (not useful in general)
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
-w, --watch watch filesystem for changes and recreate as needed
|
-w, --watch watch filesystem for changes and recreate as needed
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -29,13 +29,11 @@ See each sub-command's help for details on how to use the generated script.
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -52,16 +52,13 @@ hugo completion bash
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [hugo completion](/commands/hugo_completion/) - Generate the autocompletion script for the specified shell
|
* [hugo completion](/commands/hugo_completion/) - Generate the autocompletion script for the specified shell
|
||||||
|
|
||||||
|
|
|
@ -43,13 +43,11 @@ hugo completion fish [flags]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -40,13 +40,11 @@ hugo completion powershell [flags]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -54,13 +54,11 @@ hugo completion zsh [flags]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -19,7 +19,7 @@ hugo config [command] [flags]
|
||||||
|
|
||||||
```
|
```
|
||||||
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
|
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
|
||||||
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
|
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache_$USER/
|
||||||
-c, --contentDir string filesystem path to content directory
|
-c, --contentDir string filesystem path to content directory
|
||||||
--format string preferred file format (toml, yaml or json) (default "toml")
|
--format string preferred file format (toml, yaml or json) (default "toml")
|
||||||
-h, --help help for config
|
-h, --help help for config
|
||||||
|
@ -37,13 +37,11 @@ hugo config [command] [flags]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -15,7 +15,7 @@ hugo config mounts [flags] [args]
|
||||||
|
|
||||||
```
|
```
|
||||||
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
|
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
|
||||||
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
|
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache_$USER/
|
||||||
-c, --contentDir string filesystem path to content directory
|
-c, --contentDir string filesystem path to content directory
|
||||||
-h, --help help for mounts
|
-h, --help help for mounts
|
||||||
-t, --theme strings themes to use (located in /themes/THEMENAME/)
|
-t, --theme strings themes to use (located in /themes/THEMENAME/)
|
||||||
|
@ -31,13 +31,11 @@ hugo config mounts [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -13,10 +13,6 @@ Convert your content (e.g. front matter) to different formats.
|
||||||
|
|
||||||
See convert's subcommands toJSON, toTOML and toYAML for more information.
|
See convert's subcommands toJSON, toTOML and toYAML for more information.
|
||||||
|
|
||||||
```
|
|
||||||
hugo convert [command] [flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -35,13 +31,11 @@ hugo convert [command] [flags]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -32,15 +32,13 @@ hugo convert toJSON [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
-o, --output string filesystem path to write files to
|
-o, --output string filesystem path to write files to
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
--unsafe enable less safe operations, please backup first
|
--unsafe enable less safe operations, please backup first
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -32,15 +32,13 @@ hugo convert toTOML [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
-o, --output string filesystem path to write files to
|
-o, --output string filesystem path to write files to
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
--unsafe enable less safe operations, please backup first
|
--unsafe enable less safe operations, please backup first
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -32,15 +32,13 @@ hugo convert toYAML [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
-o, --output string filesystem path to write files to
|
-o, --output string filesystem path to write files to
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
--unsafe enable less safe operations, please backup first
|
--unsafe enable less safe operations, please backup first
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -42,13 +42,11 @@ hugo deploy [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -31,13 +31,11 @@ hugo env [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -7,10 +7,6 @@ url: /commands/hugo_gen/
|
||||||
|
|
||||||
A collection of several useful generators.
|
A collection of several useful generators.
|
||||||
|
|
||||||
```
|
|
||||||
hugo gen [command] [flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -27,13 +23,11 @@ hugo gen [command] [flags]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -36,13 +36,11 @@ hugo gen chromastyles [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -37,13 +37,11 @@ hugo gen doc [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -34,13 +34,11 @@ hugo gen man [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -13,10 +13,6 @@ Import your site from other web site generators like Jekyll.
|
||||||
|
|
||||||
Import requires a subcommand, e.g. `hugo import jekyll jekyll_root_path target_path`.
|
Import requires a subcommand, e.g. `hugo import jekyll jekyll_root_path target_path`.
|
||||||
|
|
||||||
```
|
|
||||||
hugo import [command] [flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -33,13 +29,11 @@ hugo import [command] [flags]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -34,13 +34,11 @@ hugo import jekyll [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -13,10 +13,6 @@ Listing out various types of content.
|
||||||
|
|
||||||
List requires a subcommand, e.g. hugo list drafts
|
List requires a subcommand, e.g. hugo list drafts
|
||||||
|
|
||||||
```
|
|
||||||
hugo list [command] [flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -33,13 +29,11 @@ hugo list [command] [flags]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -31,13 +31,11 @@ hugo list all [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -31,13 +31,11 @@ hugo list drafts [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -31,13 +31,11 @@ hugo list expired [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -31,13 +31,11 @@ hugo list future [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -38,13 +38,11 @@ See https://gohugo.io/hugo-modules/ for more information.
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -20,7 +20,7 @@ hugo mod clean [flags] [args]
|
||||||
```
|
```
|
||||||
--all clean entire module cache
|
--all clean entire module cache
|
||||||
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
|
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
|
||||||
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
|
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache_$USER/
|
||||||
-c, --contentDir string filesystem path to content directory
|
-c, --contentDir string filesystem path to content directory
|
||||||
-h, --help help for clean
|
-h, --help help for clean
|
||||||
--pattern string pattern matching module paths to clean (all if not set), e.g. "**hugo*"
|
--pattern string pattern matching module paths to clean (all if not set), e.g. "**hugo*"
|
||||||
|
@ -37,13 +37,11 @@ hugo mod clean [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -57,13 +57,11 @@ hugo mod get [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -21,7 +21,7 @@ hugo mod graph [flags] [args]
|
||||||
|
|
||||||
```
|
```
|
||||||
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
|
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
|
||||||
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
|
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache_$USER/
|
||||||
--clean delete module cache for dependencies that fail verification
|
--clean delete module cache for dependencies that fail verification
|
||||||
-c, --contentDir string filesystem path to content directory
|
-c, --contentDir string filesystem path to content directory
|
||||||
-h, --help help for graph
|
-h, --help help for graph
|
||||||
|
@ -38,13 +38,11 @@ hugo mod graph [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -26,7 +26,7 @@ hugo mod init [flags] [args]
|
||||||
|
|
||||||
```
|
```
|
||||||
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
|
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
|
||||||
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
|
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache_$USER/
|
||||||
-c, --contentDir string filesystem path to content directory
|
-c, --contentDir string filesystem path to content directory
|
||||||
-h, --help help for init
|
-h, --help help for init
|
||||||
-t, --theme strings themes to use (located in /themes/THEMENAME/)
|
-t, --theme strings themes to use (located in /themes/THEMENAME/)
|
||||||
|
@ -42,13 +42,11 @@ hugo mod init [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -31,13 +31,11 @@ hugo mod npm [command] [flags]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -29,7 +29,7 @@ hugo mod npm pack [flags] [args]
|
||||||
|
|
||||||
```
|
```
|
||||||
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
|
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
|
||||||
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
|
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache_$USER/
|
||||||
-c, --contentDir string filesystem path to content directory
|
-c, --contentDir string filesystem path to content directory
|
||||||
-h, --help help for pack
|
-h, --help help for pack
|
||||||
-t, --theme strings themes to use (located in /themes/THEMENAME/)
|
-t, --theme strings themes to use (located in /themes/THEMENAME/)
|
||||||
|
@ -45,13 +45,11 @@ hugo mod npm pack [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -15,7 +15,7 @@ hugo mod tidy [flags] [args]
|
||||||
|
|
||||||
```
|
```
|
||||||
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
|
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
|
||||||
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
|
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache_$USER/
|
||||||
-c, --contentDir string filesystem path to content directory
|
-c, --contentDir string filesystem path to content directory
|
||||||
-h, --help help for tidy
|
-h, --help help for tidy
|
||||||
-t, --theme strings themes to use (located in /themes/THEMENAME/)
|
-t, --theme strings themes to use (located in /themes/THEMENAME/)
|
||||||
|
@ -31,13 +31,11 @@ hugo mod tidy [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -21,7 +21,7 @@ hugo mod vendor [flags] [args]
|
||||||
|
|
||||||
```
|
```
|
||||||
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
|
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
|
||||||
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
|
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache_$USER/
|
||||||
-c, --contentDir string filesystem path to content directory
|
-c, --contentDir string filesystem path to content directory
|
||||||
-h, --help help for vendor
|
-h, --help help for vendor
|
||||||
-t, --theme strings themes to use (located in /themes/THEMENAME/)
|
-t, --theme strings themes to use (located in /themes/THEMENAME/)
|
||||||
|
@ -37,13 +37,11 @@ hugo mod vendor [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -19,7 +19,7 @@ hugo mod verify [flags] [args]
|
||||||
|
|
||||||
```
|
```
|
||||||
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
|
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
|
||||||
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
|
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache_$USER/
|
||||||
--clean delete module cache for dependencies that fail verification
|
--clean delete module cache for dependencies that fail verification
|
||||||
-c, --contentDir string filesystem path to content directory
|
-c, --contentDir string filesystem path to content directory
|
||||||
-h, --help help for verify
|
-h, --help help for verify
|
||||||
|
@ -36,13 +36,11 @@ hugo mod verify [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -18,10 +18,6 @@ If archetypes are provided in your theme or site, they will be used.
|
||||||
|
|
||||||
Ensure you run this within the root directory of your site.
|
Ensure you run this within the root directory of your site.
|
||||||
|
|
||||||
```
|
|
||||||
hugo new [command] [flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -38,13 +34,11 @@ hugo new [command] [flags]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
@ -52,5 +46,5 @@ hugo new [command] [flags]
|
||||||
* [hugo](/commands/hugo/) - hugo builds your site
|
* [hugo](/commands/hugo/) - hugo builds your site
|
||||||
* [hugo new content](/commands/hugo_new_content/) - Create new content for your site
|
* [hugo new content](/commands/hugo_new_content/) - Create new content for your site
|
||||||
* [hugo new site](/commands/hugo_new_site/) - Create a new site (skeleton)
|
* [hugo new site](/commands/hugo_new_site/) - Create a new site (skeleton)
|
||||||
* [hugo new theme](/commands/hugo_new_theme/) - Create a new site (skeleton)
|
* [hugo new theme](/commands/hugo_new_theme/) - Create a new theme (skeleton)
|
||||||
|
|
||||||
|
|
|
@ -10,13 +10,13 @@ Create new content for your site
|
||||||
### Synopsis
|
### Synopsis
|
||||||
|
|
||||||
Create a new content file and automatically set the date and title.
|
Create a new content file and automatically set the date and title.
|
||||||
It will guess which kind of file to create based on the path provided.
|
It will guess which kind of file to create based on the path provided.
|
||||||
|
|
||||||
You can also specify the kind with `-k KIND`.
|
You can also specify the kind with `-k KIND`.
|
||||||
|
|
||||||
If archetypes are provided in your theme or site, they will be used.
|
If archetypes are provided in your theme or site, they will be used.
|
||||||
|
|
||||||
Ensure you run this within the root directory of your site.
|
Ensure you run this within the root directory of your site.
|
||||||
|
|
||||||
```
|
```
|
||||||
hugo new content [path] [flags]
|
hugo new content [path] [flags]
|
||||||
|
@ -26,7 +26,7 @@ hugo new content [path] [flags]
|
||||||
|
|
||||||
```
|
```
|
||||||
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
|
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
|
||||||
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
|
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache_$USER/
|
||||||
-c, --contentDir string filesystem path to content directory
|
-c, --contentDir string filesystem path to content directory
|
||||||
--editor string edit new content with this editor, if provided
|
--editor string edit new content with this editor, if provided
|
||||||
-f, --force overwrite file if it already exists
|
-f, --force overwrite file if it already exists
|
||||||
|
@ -46,13 +46,11 @@ hugo new content [path] [flags]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -20,8 +20,9 @@ hugo new site [path] [flags]
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
```
|
```
|
||||||
-f, --force init inside non-empty directory
|
-f, --force init inside non-empty directory
|
||||||
-h, --help help for site
|
--format string preferred file format (toml, yaml or json) (default "toml")
|
||||||
|
-h, --help help for site
|
||||||
```
|
```
|
||||||
|
|
||||||
### Options inherited from parent commands
|
### Options inherited from parent commands
|
||||||
|
@ -34,13 +35,11 @@ hugo new site [path] [flags]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -5,16 +5,17 @@ url: /commands/hugo_new_theme/
|
||||||
---
|
---
|
||||||
## hugo new theme
|
## hugo new theme
|
||||||
|
|
||||||
Create a new site (skeleton)
|
Create a new theme (skeleton)
|
||||||
|
|
||||||
### Synopsis
|
### Synopsis
|
||||||
|
|
||||||
Create a new site in the provided directory.
|
Create a new theme (skeleton) called [name] in ./themes.
|
||||||
The new site will have the correct structure, but no content or theme yet.
|
New theme is a skeleton. Please add content to the touched files. Add your
|
||||||
Use `hugo new [contentPath]` to create new content.
|
name to the copyright line in the license and adjust the theme.toml file
|
||||||
|
according to your needs.
|
||||||
|
|
||||||
```
|
```
|
||||||
hugo new theme [path] [flags]
|
hugo new theme [name] [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
@ -33,13 +34,11 @@ hugo new theme [path] [flags]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -33,7 +33,7 @@ hugo server [command] [flags]
|
||||||
-D, --buildDrafts include content marked as draft
|
-D, --buildDrafts include content marked as draft
|
||||||
-E, --buildExpired include expired content
|
-E, --buildExpired include expired content
|
||||||
-F, --buildFuture include content with publishdate in the future
|
-F, --buildFuture include content with publishdate in the future
|
||||||
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
|
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache_$USER/
|
||||||
--cleanDestinationDir remove files from destination not found in static directories
|
--cleanDestinationDir remove files from destination not found in static directories
|
||||||
-c, --contentDir string filesystem path to content directory
|
-c, --contentDir string filesystem path to content directory
|
||||||
--disableBrowserError do not show build errors in the browser
|
--disableBrowserError do not show build errors in the browser
|
||||||
|
@ -84,13 +84,11 @@ hugo server [command] [flags]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -28,13 +28,11 @@ hugo server trust [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -31,13 +31,11 @@ hugo version [flags] [args]
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--logLevel string log level (debug|info|warn|error)
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
|
||||||
--quiet build in quiet mode
|
--quiet build in quiet mode
|
||||||
-s, --source string filesystem path to read files relative from
|
-s, --source string filesystem path to read files relative from
|
||||||
--themesDir string filesystem path to themes directory
|
--themesDir string filesystem path to themes directory
|
||||||
-v, --verbose verbose output
|
-v, --verbose verbose output
|
||||||
--verboseLog verbose logging
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
---
|
---
|
||||||
title: Content Management
|
title: Content management
|
||||||
linkTitle: Content Management Overview
|
linkTitle: Overview
|
||||||
description: Hugo makes managing large static sites easy with support for archetypes, content types, menus, cross references, summaries, and more.
|
description: Hugo makes managing large static sites easy with support for archetypes, content types, menus, cross references, summaries, and more.
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
|
identifier: content-management-overview
|
||||||
parent: content-management
|
parent: content-management
|
||||||
weight: 10
|
weight: 10
|
||||||
keywords: [source, organization]
|
keywords: [source, organization]
|
||||||
|
|
|
@ -13,7 +13,7 @@ weight: 140
|
||||||
aliases: [/content/archetypes/]
|
aliases: [/content/archetypes/]
|
||||||
---
|
---
|
||||||
|
|
||||||
## What are Archetypes?
|
## What are archetypes?
|
||||||
|
|
||||||
**Archetypes** are content template files in the [archetypes directory] of your project that contain preconfigured [front matter] and possibly also a content disposition for your website's [content types]. These will be used when you run `hugo new`.
|
**Archetypes** are content template files in the [archetypes directory] of your project that contain preconfigured [front matter] and possibly also a content disposition for your website's [content types]. These will be used when you run `hugo new`.
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ The above will create a new content file in `content/posts/my-first-post.md` usi
|
||||||
|
|
||||||
The last two list items are only applicable if you use a theme and it uses the `my-theme` theme name as an example.
|
The last two list items are only applicable if you use a theme and it uses the `my-theme` theme name as an example.
|
||||||
|
|
||||||
## Create a New Archetype Template
|
## Create a new archetype template
|
||||||
|
|
||||||
A fictional example for the section `newsletter` and the archetype file `archetypes/newsletter.md`. Create a new file in `archetypes/newsletter.md` and open it in a text editor.
|
A fictional example for the section `newsletter` and the archetype file `archetypes/newsletter.md`. Create a new file in `archetypes/newsletter.md` and open it in a text editor.
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ draft: true
|
||||||
|
|
||||||
**Insert Lead paragraph here.**
|
**Insert Lead paragraph here.**
|
||||||
|
|
||||||
## New Cool Posts
|
## New cool posts
|
||||||
|
|
||||||
{{ range first 10 ( where .Site.RegularPages "Type" "cool" ) }}
|
{{ range first 10 ( where .Site.RegularPages "Type" "cool" ) }}
|
||||||
* {{ .Title }}
|
* {{ .Title }}
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
---
|
---
|
||||||
title: Build Options
|
title: Build options
|
||||||
linkTitle: Build Options
|
|
||||||
description: Build options help define how Hugo must treat a given page when building the site.
|
description: Build options help define how Hugo must treat a given page when building the site.
|
||||||
keywords: [build,content,front matter, page resources]
|
keywords: [build,content,front matter, page resources]
|
||||||
categories: [content management]
|
categories: [fundamentals,content management]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
parent: content-management
|
parent: content-management
|
||||||
|
@ -13,7 +12,7 @@ weight: 70
|
||||||
aliases: [/content/build-options/]
|
aliases: [/content/build-options/]
|
||||||
---
|
---
|
||||||
|
|
||||||
They are stored in a reserved Front Matter object named `_build` with the following defaults:
|
They are stored in a reserved front matter object named `_build` with the following defaults:
|
||||||
|
|
||||||
{{< code-toggle >}}
|
{{< code-toggle >}}
|
||||||
_build:
|
_build:
|
||||||
|
@ -26,38 +25,30 @@ _build:
|
||||||
|
|
||||||
If `always`, the page will be treated as a published page, holding its dedicated output files (`index.html`, etc...) and permalink.
|
If `always`, the page will be treated as a published page, holding its dedicated output files (`index.html`, etc...) and permalink.
|
||||||
|
|
||||||
We extended this property from a boolean to an enum in Hugo 0.76.0. Valid values are:
|
Valid values are:
|
||||||
|
|
||||||
never
|
- `never`
|
||||||
: The page will not be included in any page collection.
|
: The page will not be included in any page collection.
|
||||||
|
- `always (default)`
|
||||||
always (default)
|
: The page will be rendered to disk and get a `RelPermalink` etc.
|
||||||
: The page will be rendered to disk and get a `RelPermalink` etc.
|
- `link`
|
||||||
|
: The page will be not be rendered to disk, but will get a `RelPermalink`.
|
||||||
link
|
|
||||||
: The page will be not be rendered to disk, but will get a `RelPermalink`.
|
|
||||||
|
|
||||||
#### list
|
#### list
|
||||||
|
|
||||||
Note that we extended this property from a boolean to an enum in Hugo 0.68.0.
|
|
||||||
|
|
||||||
Valid values are:
|
Valid values are:
|
||||||
|
|
||||||
never
|
- `never`
|
||||||
: The page will not be included in any page collection.
|
: The page will not be included in any page collection.
|
||||||
|
- `always (default)`
|
||||||
always (default)
|
: The page will be included in all page collections, e.g. `site.RegularPages`, `.Pages`.
|
||||||
: The page will be included in all page collections, e.g. `site.RegularPages`, `$page.Pages`.
|
- `local`
|
||||||
|
: The page will be included in any _local_ page collection, e.g. `.RegularPages`, `.Pages`. One use case for this would be to create fully navigable, but headless content sections.
|
||||||
local
|
|
||||||
: The page will be included in any _local_ page collection, e.g. `$page.RegularPages`, `$page.Pages`. One use case for this would be to create fully navigable, but headless content sections.
|
|
||||||
|
|
||||||
If true, the page will be treated as part of the project's collections and, when appropriate, returned by Hugo's listing methods (`.Pages`, `.RegularPages` etc...).
|
|
||||||
|
|
||||||
#### publishResources
|
#### publishResources
|
||||||
|
|
||||||
If set to true the [Bundle's Resources](/content-management/page-bundles) will be published.
|
If set to `true` (default) the [Bundle's Resources](/content-management/page-bundles) will be published.
|
||||||
Setting this to false will still publish Resources on demand (when a resource's `.Permalink` or `.RelPermalink` is invoked from the templates) but will skip the others.
|
Setting this to `false` will still publish Resources on demand (when a resource's `.Permalink` or `.RelPermalink` is invoked from the templates) but will skip the others.
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
Any page, regardless of their build options, will always be available using the [`.GetPage`](/functions/getpage) methods.
|
Any page, regardless of their build options, will always be available using the [`.GetPage`](/functions/getpage) methods.
|
||||||
|
@ -67,7 +58,7 @@ Any page, regardless of their build options, will always be available using the
|
||||||
|
|
||||||
#### Not publishing a page
|
#### Not publishing a page
|
||||||
|
|
||||||
Project needs a "Who We Are" content file for Front Matter and body to be used by the homepage but nowhere else.
|
Project needs a "Who We Are" content file for front matter and body to be used by the homepage but nowhere else.
|
||||||
|
|
||||||
{{< code-toggle file="content/who-we-are.md" fm=true copy=false >}}
|
{{< code-toggle file="content/who-we-are.md" fm=true copy=false >}}
|
||||||
title: Who we are
|
title: Who we are
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
title: Comments
|
title: Comments
|
||||||
description: Hugo ships with an internal Disqus template, but this isn't the only commenting system that will work with your new Hugo website.
|
description: Hugo ships with an internal Disqus template, but this isn't the only commenting system that will work with your new Hugo website.
|
||||||
keywords: [sections,content,organization]
|
keywords: [sections,content,organization]
|
||||||
categories: [project organization, fundamentals]
|
categories: [project organization]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
parent: content-management
|
parent: content-management
|
||||||
|
@ -34,9 +34,9 @@ For many websites, this is enough configuration. However, you also have the opti
|
||||||
* `disqus_title`
|
* `disqus_title`
|
||||||
* `disqus_url`
|
* `disqus_url`
|
||||||
|
|
||||||
### Render Hugo's Built-in Disqus Partial Template
|
### Render Hugo's built-in Disqus partial template
|
||||||
|
|
||||||
Disqus has its own [internal template](https://gohugo.io/templates/internal/#disqus) available, to render it add the following code where you want comments to appear:
|
Disqus has its own [internal template](/templates/internal/#disqus) available, to render it add the following code where you want comments to appear:
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ template "_internal/disqus.html" . }}
|
{{ template "_internal/disqus.html" . }}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
---
|
---
|
||||||
title: Links and Cross References
|
title: Links and cross references
|
||||||
linkTitle: Links and Cross References
|
|
||||||
description: Shortcodes for creating links to documents.
|
description: Shortcodes for creating links to documents.
|
||||||
categories: [content management]
|
categories: [content management]
|
||||||
keywords: ["cross references","references", "anchors", "urls"]
|
keywords: ["cross references","references", "anchors", "urls"]
|
||||||
|
@ -19,7 +18,7 @@ The `ref` and `relref` shortcodes display the absolute and relative permalinks t
|
||||||
|
|
||||||
The `ref` and `relref` shortcodes require a single parameter: the path to a content document, with or without a file extension, with or without an anchor. Paths without a leading `/` are first resolved relative to the current page, then to the remainder of the site.
|
The `ref` and `relref` shortcodes require a single parameter: the path to a content document, with or without a file extension, with or without an anchor. Paths without a leading `/` are first resolved relative to the current page, then to the remainder of the site.
|
||||||
|
|
||||||
```
|
```text
|
||||||
.
|
.
|
||||||
└── content
|
└── content
|
||||||
├── about
|
├── about
|
||||||
|
@ -78,7 +77,7 @@ To link to another language version of a document, use this syntax:
|
||||||
{{</* relref path="document.md" lang="ja" */>}}
|
{{</* relref path="document.md" lang="ja" */>}}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Get another Output Format
|
### Get another output format
|
||||||
|
|
||||||
To link to another Output Format of a document, use this syntax:
|
To link to another Output Format of a document, use this syntax:
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ weight: 50
|
||||||
---
|
---
|
||||||
{{< new-in "0.93.0" >}}
|
{{< new-in "0.93.0" >}}
|
||||||
|
|
||||||
## GoAT Diagrams (Ascii)
|
## GoAT diagrams (Ascii)
|
||||||
|
|
||||||
Hugo supports [GoAT](https://github.com/bep/goat) natively. This means that this code block:
|
Hugo supports [GoAT](https://github.com/bep/goat) natively. This means that this code block:
|
||||||
|
|
||||||
|
@ -42,14 +42,14 @@ Will be rendered as:
|
||||||
1 2 3 4 1 2 3 4 1 2 3 4 '--- 4 '-- 4 \ 4
|
1 2 3 4 1 2 3 4 1 2 3 4 '--- 4 '-- 4 \ 4
|
||||||
```
|
```
|
||||||
|
|
||||||
## Mermaid Diagrams
|
## Mermaid diagrams
|
||||||
|
|
||||||
Hugo currently does not provide default templates for Mermaid diagrams. But you can easily add your own. One way to do it would be to create `layouts/_default/_markup/render-codeblock-mermaid.html`:
|
Hugo currently does not provide default templates for Mermaid diagrams. But you can easily add your own. One way to do it would be to create `layouts/_default/_markup/render-codeblock-mermaid.html`:
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
<div class="mermaid">
|
<pre class="mermaid">
|
||||||
{{- .Inner | safeHTML }}
|
{{- .Inner | safeHTML }}
|
||||||
</div>
|
</pre>
|
||||||
{{ .Page.Store.Set "hasMermaid" true }}
|
{{ .Page.Store.Set "hasMermaid" true }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ And then include this snippet at the bottom of the content template (**Note**: b
|
||||||
|
|
||||||
With that you can use the `mermaid` language in Markdown code blocks:
|
With that you can use the `mermaid` language in Markdown code blocks:
|
||||||
|
|
||||||
````
|
````text
|
||||||
```mermaid
|
```mermaid
|
||||||
sequenceDiagram
|
sequenceDiagram
|
||||||
participant Alice
|
participant Alice
|
||||||
|
@ -82,7 +82,7 @@ sequenceDiagram
|
||||||
```
|
```
|
||||||
````
|
````
|
||||||
|
|
||||||
## Goat Ascii Diagram Examples
|
## Goat ASCII diagram examples
|
||||||
|
|
||||||
### Graphics
|
### Graphics
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ Created from <https://arthursonzogni.com/Diagon/#Tree>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Sequence Diagram
|
### Sequence diagram
|
||||||
|
|
||||||
<https://arthursonzogni.com/Diagon/#Sequence>
|
<https://arthursonzogni.com/Diagon/#Sequence>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
---
|
---
|
||||||
title: Content Formats
|
title: Content formats
|
||||||
linkTitle: Content Formats
|
|
||||||
description: Both HTML and Markdown are supported content formats.
|
description: Both HTML and Markdown are supported content formats.
|
||||||
categories: [content management]
|
categories: [content management]
|
||||||
keywords: [markdown,asciidoc,pandoc,content format]
|
keywords: [markdown,asciidoc,pandoc,content format]
|
||||||
|
@ -34,7 +33,7 @@ The current list of content formats in Hugo:
|
||||||
|
|
||||||
The `markup identifier` is fetched from either the `markup` variable in front matter or from the file extension. For markup-related configuration, see [Configure Markup](/getting-started/configuration-markup/).
|
The `markup identifier` is fetched from either the `markup` variable in front matter or from the file extension. For markup-related configuration, see [Configure Markup](/getting-started/configuration-markup/).
|
||||||
|
|
||||||
## External Helpers
|
## External helpers
|
||||||
|
|
||||||
Some of the formats in the table above need external helpers installed on your PC. For example, for AsciiDoc files,
|
Some of the formats in the table above need external helpers installed on your PC. For example, for AsciiDoc files,
|
||||||
Hugo will try to call the `asciidoctor` command. This means that you will have to install the associated
|
Hugo will try to call the `asciidoctor` command. This means that you will have to install the associated
|
||||||
|
@ -50,13 +49,7 @@ Hugo passes reasonable default arguments to these external helpers by default:
|
||||||
Because additional formats are external commands, generation performance will rely heavily on the performance of the external tool you are using. As this feature is still in its infancy, feedback is welcome.
|
Because additional formats are external commands, generation performance will rely heavily on the performance of the external tool you are using. As this feature is still in its infancy, feedback is welcome.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
### External Helper AsciiDoc
|
### External helper Asciidoctor
|
||||||
|
|
||||||
[AsciiDoc](https://github.com/asciidoc/asciidoc) implementation EOLs in Jan 2020 and is no longer supported.
|
|
||||||
AsciiDoc development is being continued under [Asciidoctor](https://github.com/asciidoctor). The format AsciiDoc
|
|
||||||
remains of course. Please continue with the implementation Asciidoctor.
|
|
||||||
|
|
||||||
### External Helper Asciidoctor
|
|
||||||
|
|
||||||
The Asciidoctor community offers a wide set of tools for the AsciiDoc format that can be installed additionally to Hugo.
|
The Asciidoctor community offers a wide set of tools for the AsciiDoc format that can be installed additionally to Hugo.
|
||||||
[See the Asciidoctor docs for installation instructions](https://asciidoctor.org/docs/install-toolchain/). Make sure that also all
|
[See the Asciidoctor docs for installation instructions](https://asciidoctor.org/docs/install-toolchain/). Make sure that also all
|
||||||
|
@ -113,7 +106,7 @@ parameters. Run Hugo with `-v`. You will get an output like
|
||||||
INFO 2019/12/22 09:08:48 Rendering book-as-pdf.adoc with C:\Ruby26-x64\bin\asciidoctor.bat using asciidoc args [--no-header-footer -r asciidoctor-html5s -b html5s -r asciidoctor-diagram --base-dir D:\prototypes\hugo_asciidoc_ddd\docs -a outdir=D:\prototypes\hugo_asciidoc_ddd\build -] ...
|
INFO 2019/12/22 09:08:48 Rendering book-as-pdf.adoc with C:\Ruby26-x64\bin\asciidoctor.bat using asciidoc args [--no-header-footer -r asciidoctor-html5s -b html5s -r asciidoctor-diagram --base-dir D:\prototypes\hugo_asciidoc_ddd\docs -a outdir=D:\prototypes\hugo_asciidoc_ddd\build -] ...
|
||||||
```
|
```
|
||||||
|
|
||||||
## Learn Markdown
|
## Learn markdown
|
||||||
|
|
||||||
Markdown syntax is simple enough to learn in a single sitting. The following are excellent resources to get you up and running:
|
Markdown syntax is simple enough to learn in a single sitting. The following are excellent resources to get you up and running:
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
title: Front Matter
|
title: Front matter
|
||||||
description: Hugo allows you to add front matter in yaml, toml, or json to your content files.
|
description: Hugo allows you to add front matter in yaml, toml, or json to your content files.
|
||||||
categories: [content management]
|
categories: [content management]
|
||||||
keywords: ["front matter", "yaml", "toml", "json", "metadata", "archetypes"]
|
keywords: ["front matter", "yaml", "toml", "json", "metadata", "archetypes"]
|
||||||
|
@ -16,7 +16,7 @@ aliases: [/content/front-matter/]
|
||||||
|
|
||||||
{{< youtube Yh2xKRJGff4 >}}
|
{{< youtube Yh2xKRJGff4 >}}
|
||||||
|
|
||||||
## Front Matter Formats
|
## Front matter formats
|
||||||
|
|
||||||
Hugo supports four formats for front matter, each with their own identifying tokens.
|
Hugo supports four formats for front matter, each with their own identifying tokens.
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ categories = [
|
||||||
slug = "spf13-vim-3-0-release-and-new-website"
|
slug = "spf13-vim-3-0-release-and-new-website"
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
## Front Matter Variables
|
## Front matter variables
|
||||||
|
|
||||||
### Predefined
|
### Predefined
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ lastmod
|
||||||
: The datetime at which the content was last modified.
|
: The datetime at which the content was last modified.
|
||||||
|
|
||||||
linkTitle
|
linkTitle
|
||||||
: Used for creating links to content; if set, Hugo defaults to using the `linktitle` before the `title`. Hugo can also [order lists of content by `linktitle`][bylinktitle].
|
: Used for creating links to content; if set, Hugo defaults to using the `linkTitle` before the `title`. Hugo can also [order lists of content by `linkTitle`][bylinktitle].
|
||||||
|
|
||||||
markup
|
markup
|
||||||
: **experimental**; specify `"rst"` for reStructuredText (requires`rst2html`) or `"md"` (default) for Markdown.
|
: **experimental**; specify `"rst"` for reStructuredText (requires`rst2html`) or `"md"` (default) for Markdown.
|
||||||
|
@ -135,10 +135,10 @@ weight
|
||||||
: Field name of the *plural* form of the index. See `tags` and `categories` in the above front matter examples. *Note that the plural form of user-defined taxonomies cannot be the same as any of the predefined front matter variables.*
|
: Field name of the *plural* form of the index. See `tags` and `categories` in the above front matter examples. *Note that the plural form of user-defined taxonomies cannot be the same as any of the predefined front matter variables.*
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
If neither `slug` nor `url` is present and [permalinks are not configured otherwise in your site configuration file](/content-management/urls/#permalinks), Hugo will use the filename of your content to create the output URL. See [Content Organization](/content-management/organization) for an explanation of paths in Hugo and [URL Management](/content-management/urls/) for ways to customize Hugo's default behaviors.
|
If neither `slug` nor `url` is present and [permalinks are not configured otherwise in your site configuration file](/content-management/urls/#permalinks), Hugo will use the file name of your content to create the output URL. See [Content Organization](/content-management/organization) for an explanation of paths in Hugo and [URL Management](/content-management/urls/) for ways to customize Hugo's default behaviors.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
### User-Defined
|
### User-defined
|
||||||
|
|
||||||
You can add fields to your front matter arbitrarily to meet your needs. These user-defined key-values are placed into a single `.Params` variable for use in your templates.
|
You can add fields to your front matter arbitrarily to meet your needs. These user-defined key-values are placed into a single `.Params` variable for use in your templates.
|
||||||
|
|
||||||
|
@ -149,11 +149,11 @@ include_toc: true
|
||||||
show_comments: false
|
show_comments: false
|
||||||
{{</ code-toggle >}}
|
{{</ code-toggle >}}
|
||||||
|
|
||||||
## Front Matter Cascade
|
## Front matter cascade
|
||||||
|
|
||||||
Any node or section can pass down to descendants a set of Front Matter values as long as defined underneath the reserved `cascade` Front Matter key.
|
Any node or section can pass down to descendants a set of front matter values as long as defined underneath the reserved `cascade` front matter key.
|
||||||
|
|
||||||
### Target Specific Pages
|
### Target specific pages
|
||||||
|
|
||||||
The `cascade` block can be a slice with a optional `_target` keyword, allowing for multiple `cascade` values targeting different page sets.
|
The `cascade` block can be a slice with a optional `_target` keyword, allowing for multiple `cascade` values targeting different page sets.
|
||||||
|
|
||||||
|
@ -202,15 +202,15 @@ With the above example the Blog section page and its descendants will return `im
|
||||||
- Said descendant has its own `banner` value set
|
- Said descendant has its own `banner` value set
|
||||||
- Or a closer ancestor node has its own `cascade.banner` value set.
|
- Or a closer ancestor node has its own `cascade.banner` value set.
|
||||||
|
|
||||||
## Order Content Through Front Matter
|
## Order content through front matter
|
||||||
|
|
||||||
You can assign content-specific `weight` in the front matter of your content. These values are especially useful for [ordering][ordering] in list views. You can use `weight` for ordering of content and the convention of [`<TAXONOMY>_weight`][taxweight] for ordering content within a taxonomy. See [Ordering and Grouping Hugo Lists][lists] to see how `weight` can be used to organize your content in list views.
|
You can assign content-specific `weight` in the front matter of your content. These values are especially useful for [ordering][ordering] in list views. You can use `weight` for ordering of content and the convention of [`<TAXONOMY>_weight`][taxweight] for ordering content within a taxonomy. See [Ordering and Grouping Hugo Lists][lists] to see how `weight` can be used to organize your content in list views.
|
||||||
|
|
||||||
## Override Global Markdown Configuration
|
## Override global markdown configuration
|
||||||
|
|
||||||
It's possible to set some options for Markdown rendering in a content's front matter as an override to the [Rendering options set in your project configuration][config].
|
It's possible to set some options for Markdown rendering in a content's front matter as an override to the [rendering options set in your project configuration][config].
|
||||||
|
|
||||||
## Front Matter Format Specs
|
## Front matter format specs
|
||||||
|
|
||||||
- [TOML Spec][toml]
|
- [TOML Spec][toml]
|
||||||
- [YAML Spec][yaml]
|
- [YAML Spec][yaml]
|
||||||
|
@ -220,15 +220,15 @@ It's possible to set some options for Markdown rendering in a content's front ma
|
||||||
[aliases]: /content-management/urls/#aliases
|
[aliases]: /content-management/urls/#aliases
|
||||||
[archetype]: /content-management/archetypes/
|
[archetype]: /content-management/archetypes/
|
||||||
[bylinktitle]: /templates/lists/#by-link-title
|
[bylinktitle]: /templates/lists/#by-link-title
|
||||||
[config]: /getting-started/configuration/ "Hugo documentation for site configuration"
|
[config]: /getting-started/configuration/
|
||||||
[content type]: /content-management/types/
|
[content type]: /content-management/types/
|
||||||
[contentorg]: /content-management/organization/
|
[contentorg]: /content-management/organization/
|
||||||
[headless-bundle]: /content-management/page-bundles/#headless-bundle
|
[headless-bundle]: /content-management/page-bundles/#headless-bundle
|
||||||
[json]: https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf "Specification for JSON, JavaScript Object Notation"
|
[json]: https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf
|
||||||
[lists]: /templates/lists/#order-content "See how to order content in list pages; for example, templates that look to specific _index.md for content and front matter."
|
[lists]: /templates/lists/#order-content
|
||||||
[lookup]: /templates/lookup-order/ "Hugo traverses your templates in a specific order when rendering content to allow for DRYer templating."
|
[lookup]: /templates/lookup-order/
|
||||||
[ordering]: /templates/lists/ "Hugo provides multiple ways to sort and order your content in list templates"
|
[ordering]: /templates/lists/
|
||||||
[outputs]: /templates/output-formats/ "With the release of v22, you can output your content to any text format using Hugo's familiar templating"
|
[outputs]: /templates/output-formats/
|
||||||
[page-resources]: /content-management/page-resources/
|
[page-resources]: /content-management/page-resources/
|
||||||
[pagevars]: /variables/page/
|
[pagevars]: /variables/page/
|
||||||
[section]: /content-management/sections/
|
[section]: /content-management/sections/
|
||||||
|
@ -236,4 +236,4 @@ It's possible to set some options for Markdown rendering in a content's front ma
|
||||||
[toml]: https://toml.io/
|
[toml]: https://toml.io/
|
||||||
[urls]: /content-management/urls/
|
[urls]: /content-management/urls/
|
||||||
[variables]: /variables/
|
[variables]: /variables/
|
||||||
[yaml]: https://yaml.org/spec/ "Specification for YAML, YAML Ain't Markup Language"
|
[yaml]: https://yaml.org/spec/
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
title: Image Processing
|
title: Image processing
|
||||||
description: Resize, crop, rotate, filter, and convert images.
|
description: Resize, crop, rotate, filter, and convert images.
|
||||||
categories: [content management]
|
categories: [fundamentals,content management]
|
||||||
keywords: [resources, images]
|
keywords: [resources, images]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
|
@ -10,11 +10,11 @@ menu:
|
||||||
toc: true
|
toc: true
|
||||||
weight: 90
|
weight: 90
|
||||||
---
|
---
|
||||||
## Image Resources
|
## Image resources
|
||||||
|
|
||||||
To process an image, you must access the image as either a page resource or a global resource.
|
To process an image, you must access the image as either a page resource or a global resource.
|
||||||
|
|
||||||
### Page Resources
|
### Page resources
|
||||||
|
|
||||||
A page resource is a file within a [page bundle]. A page bundle is a directory with an `index.md` or `_index.md` file at its root.
|
A page resource is a file within a [page bundle]. A page bundle is a directory with an `index.md` or `_index.md` file at its root.
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ content/
|
||||||
└── sunset.jpg <-- page resource
|
└── sunset.jpg <-- page resource
|
||||||
```
|
```
|
||||||
|
|
||||||
### Global Resources
|
### Global resources
|
||||||
|
|
||||||
A global resource is a file:
|
A global resource is a file:
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ To access a remote image as a global resource:
|
||||||
{{ $image := resources.GetRemote "https://gohugo.io/img/hugo-logo.png" }}
|
{{ $image := resources.GetRemote "https://gohugo.io/img/hugo-logo.png" }}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Image Rendering
|
## Image rendering
|
||||||
|
|
||||||
Once you have accessed an image as either a page resource or a global resource, render it in your templates using the `Permalink`, `RelPermalink`, `Width`, and `Height` properties.
|
Once you have accessed an image as either a page resource or a global resource, render it in your templates using the `Permalink`, `RelPermalink`, `Width`, and `Height` properties.
|
||||||
|
|
||||||
|
@ -80,12 +80,12 @@ Example 3: A more concise way to skip image rendering if the resource is not fou
|
||||||
{{ end }}
|
{{ end }}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Image Processing Methods
|
## Image processing methods
|
||||||
|
|
||||||
The `image` resource implements the [`Resize`], [`Fit`], [`Fill`], [`Crop`], [`Filter`], [`Colors`] and [`Exif`] methods.
|
The `image` resource implements the [`Resize`], [`Fit`], [`Fill`], [`Crop`], [`Filter`], [`Colors`] and [`Exif`] methods.
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
Metadata (Exif, IPTC, XMP, etc.) is not preserved during image transformation. Use the [`Exif`] method with the _original_ image to extract Exif metadata from JPEG or TIFF images.
|
Metadata (EXIF, IPTC, XMP, etc.) is not preserved during image transformation. Use the [`Exif`] method with the _original_ image to extract EXIF metadata from JPEG or TIFF images.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
### Resize
|
### Resize
|
||||||
|
@ -164,11 +164,11 @@ Sometimes it can be useful to create the filter chain once and then reuse it.
|
||||||
This method is fast, but if you also scale down your images, it would be good for performance to extract the colors from the scaled down image.
|
This method is fast, but if you also scale down your images, it would be good for performance to extract the colors from the scaled down image.
|
||||||
|
|
||||||
|
|
||||||
### Exif
|
### EXIF
|
||||||
|
|
||||||
Provides an [Exif] object containing image metadata.
|
Provides an [EXIF] object containing image metadata.
|
||||||
|
|
||||||
You may access Exif data in JPEG and TIFF images. To prevent errors when processing images without Exif data, wrap the access in a [`with`] statement.
|
You may access EXIF data in JPEG and TIFF images. To prevent errors when processing images without EXIF data, wrap the access in a [`with`] statement.
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ with $image.Exif }}
|
{{ with $image.Exif }}
|
||||||
|
@ -181,7 +181,7 @@ You may access Exif data in JPEG and TIFF images. To prevent errors when process
|
||||||
{{ end }}
|
{{ end }}
|
||||||
```
|
```
|
||||||
|
|
||||||
You may also access Exif fields individually, using the [`lang.FormatNumber`] function to format the fields as needed.
|
You may also access EXIF fields individually, using the [`lang.FormatNumber`] function to format the fields as needed.
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ with $image.Exif }}
|
{{ with $image.Exif }}
|
||||||
|
@ -198,7 +198,7 @@ You may also access Exif fields individually, using the [`lang.FormatNumber`] fu
|
||||||
{{ end }}
|
{{ end }}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Exif Variables
|
#### EXIF variables
|
||||||
|
|
||||||
.Date
|
.Date
|
||||||
: Image creation date/time. Format with the [time.Format] function.
|
: Image creation date/time. Format with the [time.Format] function.
|
||||||
|
@ -210,9 +210,9 @@ You may also access Exif fields individually, using the [`lang.FormatNumber`] fu
|
||||||
: GPS longitude in degrees.
|
: GPS longitude in degrees.
|
||||||
|
|
||||||
.Tags
|
.Tags
|
||||||
: A collection of the available Exif tags for this image. You may include or exclude specific tags from this collection in the [site configuration](#exif-data).
|
: A collection of the available EXIF tags for this image. You may include or exclude specific tags from this collection in the [site configuration](#exif-data).
|
||||||
|
|
||||||
## Image Processing Options
|
## Image processing options
|
||||||
|
|
||||||
The [`Resize`], [`Fit`], [`Fill`], and [`Crop`] methods accept a space-separated, case-insensitive list of options. The order of the options within the list is irrelevant.
|
The [`Resize`], [`Fit`], [`Fill`], and [`Crop`] methods accept a space-separated, case-insensitive list of options. The order of the options within the list is irrelevant.
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ For example, if you have a 400x200 image with a bird in the upper left quadrant,
|
||||||
|
|
||||||
If you apply [rotation](#rotation) when using the [`Crop`] or [`Fill`] method, specify the anchor relative to the rotated image.
|
If you apply [rotation](#rotation) when using the [`Crop`] or [`Fill`] method, specify the anchor relative to the rotated image.
|
||||||
|
|
||||||
### Target Format
|
### Target format
|
||||||
|
|
||||||
By default, Hugo encodes the image in the source format. You may convert the image to another format by specifying `bmp`, `gif`, `jpeg`, `jpg`, `png`, `tif`, `tiff`, or `webp`.
|
By default, Hugo encodes the image in the source format. You may convert the image to another format by specifying `bmp`, `gif`, `jpeg`, `jpg`, `png`, `tif`, `tiff`, or `webp`.
|
||||||
|
|
||||||
|
@ -313,7 +313,7 @@ The default value is `photo`. You may override the default value in the [site co
|
||||||
{{ $image.Resize "600x webp picture" }}
|
{{ $image.Resize "600x webp picture" }}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Background Color
|
### Background color
|
||||||
|
|
||||||
When converting an image from a format that supports transparency (e.g., PNG) to a format that does _not_ support transparency (e.g., JPEG), you may specify the background color of the resulting image.
|
When converting an image from a format that supports transparency (e.g., PNG) to a format that does _not_ support transparency (e.g., JPEG), you may specify the background color of the resulting image.
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ The default value is `#ffffff` (white). You may override the default value in th
|
||||||
{{ $image.Resize "600x jpg #b31280" }}
|
{{ $image.Resize "600x jpg #b31280" }}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Resampling Filter
|
### Resampling filter
|
||||||
|
|
||||||
You may specify the resampling filter used when resizing an image. Commonly used resampling filters include:
|
You may specify the resampling filter used when resizing an image. Commonly used resampling filters include:
|
||||||
|
|
||||||
|
@ -346,7 +346,7 @@ The default value is `Box`. You may override the default value in the [site conf
|
||||||
|
|
||||||
See [github.com/disintegration/imaging] for the complete list of resampling filters. If you wish to improve image quality at the expense of performance, you may wish to experiment with the alternative filters.
|
See [github.com/disintegration/imaging] for the complete list of resampling filters. If you wish to improve image quality at the expense of performance, you may wish to experiment with the alternative filters.
|
||||||
|
|
||||||
## Image Processing Examples
|
## Image processing examples
|
||||||
|
|
||||||
_The photo of the sunset used in the examples below is Copyright [Bjørn Erik Pedersen](https://commons.wikimedia.org/wiki/User:Bep) (Creative Commons Attribution-Share Alike 4.0 International license)_
|
_The photo of the sunset used in the examples below is Copyright [Bjørn Erik Pedersen](https://commons.wikimedia.org/wiki/User:Bep) (Creative Commons Attribution-Share Alike 4.0 International license)_
|
||||||
|
|
||||||
|
@ -378,9 +378,9 @@ Call the shortcode from your Markdown like this:
|
||||||
Note the self-closing shortcode syntax above. You may call the `imgproc` shortcode with or without **inner content**.
|
Note the self-closing shortcode syntax above. You may call the `imgproc` shortcode with or without **inner content**.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
## Imaging Configuration
|
## Imaging configuration
|
||||||
|
|
||||||
### Processing Options
|
### Processing options
|
||||||
|
|
||||||
Define an `imaging` section in your site configuration to set the default [image processing options](#image-processing-options).
|
Define an `imaging` section in your site configuration to set the default [image processing options](#image-processing-options).
|
||||||
|
|
||||||
|
@ -408,9 +408,9 @@ quality
|
||||||
resampleFilter
|
resampleFilter
|
||||||
: See image processing options: [resampling filter](#resampling-filter).
|
: See image processing options: [resampling filter](#resampling-filter).
|
||||||
|
|
||||||
### Exif Data
|
### EXIF data
|
||||||
|
|
||||||
Define an `imaging.exif` section in your site configuration to control the availability of Exif data.
|
Define an `imaging.exif` section in your site configuration to control the availability of EXIF data.
|
||||||
|
|
||||||
{{< code-toggle file="hugo" copy=true >}}
|
{{< code-toggle file="hugo" copy=true >}}
|
||||||
[imaging.exif]
|
[imaging.exif]
|
||||||
|
@ -427,16 +427,16 @@ disableLatLong
|
||||||
: Hugo extracts the GPS latitude and longitude into `.Lat` and `.Long`. Set this to `true` to disable. Default is `false`.
|
: Hugo extracts the GPS latitude and longitude into `.Lat` and `.Long`. Set this to `true` to disable. Default is `false`.
|
||||||
|
|
||||||
excludeFields
|
excludeFields
|
||||||
: Regular expression matching the Exif tags to exclude from the `.Tags` collection. Default is `""`.
|
: Regular expression matching the EXIF tags to exclude from the `.Tags` collection. Default is `""`.
|
||||||
|
|
||||||
includeFields
|
includeFields
|
||||||
: Regular expression matching the Exif tags to include in the `.Tags` collection. Default is `""`. To include all available tags, set this value to `".*"`.
|
: Regular expression matching the EXIF tags to include in the `.Tags` collection. Default is `""`. To include all available tags, set this value to `".*"`.
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
To improve performance and decrease cache size, if you set neither `excludeFields` nor `includeFields`, Hugo excludes the following tags: `ColorSpace`, `Contrast`, `Exif`, `Exposure[M|P|B]`, `Flash`, `GPS`, `JPEG`, `Metering`, `Resolution`, `Saturation`, `Sensing`, `Sharp`, and `WhiteBalance`.
|
To improve performance and decrease cache size, if you set neither `excludeFields` nor `includeFields`, Hugo excludes the following tags: `ColorSpace`, `Contrast`, `Exif`, `Exposure[M|P|B]`, `Flash`, `GPS`, `JPEG`, `Metering`, `Resolution`, `Saturation`, `Sensing`, `Sharp`, and `WhiteBalance`.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
## Smart Cropping of Images
|
## Smart cropping of images
|
||||||
|
|
||||||
By default, Hugo uses the [Smartcrop] library when cropping images with the `Crop` or`Fill` methods. You can set the anchor point manually, but in most cases the `Smart` option will make a good choice.
|
By default, Hugo uses the [Smartcrop] library when cropping images with the `Crop` or`Fill` methods. You can set the anchor point manually, but in most cases the `Smart` option will make a good choice.
|
||||||
|
|
||||||
|
@ -446,7 +446,7 @@ Examples using the sunset image from above:
|
||||||
|
|
||||||
{{< imgproc sunset Crop "200x200 smart" />}}
|
{{< imgproc sunset Crop "200x200 smart" />}}
|
||||||
|
|
||||||
## Image Processing Performance Consideration
|
## Image processing performance consideration
|
||||||
|
|
||||||
Hugo caches processed images in the `resources` directory. If you include this directory in source control, Hugo will not have to regenerate the images in a CI/CD workflow (e.g., GitHub Pages, GitLab Pages, Netlify, etc.). This results in faster builds.
|
Hugo caches processed images in the `resources` directory. If you include this directory in source control, Hugo will not have to regenerate the images in a CI/CD workflow (e.g., GitHub Pages, GitLab Pages, Netlify, etc.). This results in faster builds.
|
||||||
|
|
||||||
|
@ -458,7 +458,7 @@ hugo --gc
|
||||||
|
|
||||||
[time.Format]: /functions/dateformat
|
[time.Format]: /functions/dateformat
|
||||||
[`anchor`]: /content-management/image-processing#anchor
|
[`anchor`]: /content-management/image-processing#anchor
|
||||||
[mounted]: /hugo-modules/configuration#module-config-mounts
|
[mounted]: /hugo-modules/configuration#module-configuration-mounts
|
||||||
[page bundle]: /content-management/page-bundles
|
[page bundle]: /content-management/page-bundles
|
||||||
[`lang.FormatNumber`]: /functions/lang
|
[`lang.FormatNumber`]: /functions/lang
|
||||||
[filters]: /functions/images
|
[filters]: /functions/images
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
title: Multilingual Mode
|
title: Multilingual mode
|
||||||
linkTitle: Multilingual
|
linkTitle: Multilingual
|
||||||
description: Hugo supports the creation of websites with multiple languages side by side.
|
description: Hugo supports the creation of websites with multiple languages side by side.
|
||||||
categories: [content management]
|
categories: [content management]
|
||||||
|
@ -17,57 +17,79 @@ You should define the available languages in a `languages` section in your site
|
||||||
|
|
||||||
Also See [Hugo Multilingual Part 1: Content translation].
|
Also See [Hugo Multilingual Part 1: Content translation].
|
||||||
|
|
||||||
## Configure Languages
|
## Configure languages
|
||||||
|
|
||||||
The following is an example of a site configuration for a multilingual Hugo project:
|
This is an example of a site configuration for a multilingual project. Any key not defined in a `languages` object will fall back to the global value in the root of your site configuration.
|
||||||
|
|
||||||
{{< code-toggle file="hugo" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
defaultContentLanguage = "en"
|
defaultContentLanguage = 'de'
|
||||||
copyright = "Everything is mine"
|
defaultContentLanguageInSubdir = true
|
||||||
|
|
||||||
[params]
|
[languages.de]
|
||||||
[params.navigation]
|
contentDir = 'content/de'
|
||||||
help = "Help"
|
disabled = false
|
||||||
|
languageCode = 'de-DE'
|
||||||
[languages]
|
languageDirection = 'ltr'
|
||||||
[languages.en]
|
languageName = 'Deutsch'
|
||||||
title = "My blog"
|
title = 'Projekt Dokumentation'
|
||||||
weight = 1
|
weight = 1
|
||||||
|
|
||||||
|
[languages.de.params]
|
||||||
|
subtitle = 'Referenz, Tutorials und Erklärungen'
|
||||||
|
|
||||||
|
[languages.en]
|
||||||
|
contentDir = 'content/en'
|
||||||
|
disabled = false
|
||||||
|
languageCode = 'en-US'
|
||||||
|
languageDirection = 'ltr'
|
||||||
|
languageName = 'English'
|
||||||
|
title = 'Project Documentation'
|
||||||
|
weight = 2
|
||||||
|
|
||||||
[languages.en.params]
|
[languages.en.params]
|
||||||
linkedin = "https://linkedin.com/whoever"
|
subtitle = 'Reference, Tutorials, and Explanations'
|
||||||
|
|
||||||
[languages.fr]
|
|
||||||
title = "Mon blogue"
|
|
||||||
weight = 2
|
|
||||||
[languages.fr.params]
|
|
||||||
linkedin = "https://linkedin.com/fr/whoever"
|
|
||||||
[languages.fr.params.navigation]
|
|
||||||
help = "Aide"
|
|
||||||
|
|
||||||
[languages.ar]
|
|
||||||
title = "مدونتي"
|
|
||||||
weight = 2
|
|
||||||
languagedirection = "rtl"
|
|
||||||
|
|
||||||
[languages.pt-pt]
|
|
||||||
title = "O meu blog"
|
|
||||||
weight = 3
|
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
Anything not defined in a `languages` block will fall back to the global value for that key (e.g., `copyright` for the English `en` language). This also works for `params`, as demonstrated with `help` above: You will get the value `Aide` in French and `Help` in all the languages without this parameter set.
|
`defaultContentLanguage`
|
||||||
|
: (`string`) The project's default language tag as defined by [RFC 5646]. Must be lower case, and must match one of the defined language keys. Default is `en`. Examples:
|
||||||
|
|
||||||
With the configuration above, all content, sitemap, RSS feeds, pagination,
|
- `en`
|
||||||
and taxonomy pages will be rendered below `/` in English (your default content language) and then below `/fr` in French.
|
- `en-gb`
|
||||||
|
- `pt-br`
|
||||||
|
|
||||||
When working with front matter `Params` in [single page templates], omit the `params` in the key for the translation.
|
`defaultContentLanguageInSubdir`
|
||||||
|
: (`bool`) If `true`, Hugo renders the default language site in a subdirectory matching the `defaultContentLanguage`. Default is `false`.
|
||||||
|
|
||||||
`defaultContentLanguage` sets the project's default language. If not set, the default language will be `en`.
|
`contentDir`
|
||||||
|
: (`string`) The content directory for this language. Omit if [translating by file name].
|
||||||
|
|
||||||
If the default language needs to be rendered below its own language code (`/en`) like the others, set `defaultContentLanguageInSubdir: true`.
|
`disabled`
|
||||||
|
: (`bool`) If `true`, Hugo will not render content for this language. Default is `false`.
|
||||||
|
|
||||||
Only the obvious non-global options can be overridden per language. Examples of global options are `baseURL`, `buildDrafts`, etc.
|
`languageCode`
|
||||||
|
: (`string`) The language tag as defined by [RFC 5646]. This value may include upper and lower case characters, hyphens or underscores, and does not affect localization or URLs. Hugo uses this value to populate the `language` element in the [built-in RSS template], and the `lang` attribute of the `html` element in the [built-in alias template]. Examples:
|
||||||
|
|
||||||
**Please note:** use lowercase language codes, even when using regional languages (ie. use pt-pt instead of pt-PT). Currently Hugo language internals lowercase language codes, which can cause conflicts with settings like `defaultContentLanguage` which are not lowercased. Please track the evolution of this issue in [Hugo repository issue tracker](https://github.com/gohugoio/hugo/issues/7344)
|
- `en`
|
||||||
|
- `en-GB`
|
||||||
|
- `pt-BR`
|
||||||
|
|
||||||
|
`languageDirection`
|
||||||
|
: (`string`) The language direction, either left-to-right (`ltr`) or right-to-left (`rtl`). Use this value in your templates with the global [`dir`] HTML attribute.
|
||||||
|
|
||||||
|
`languageName`
|
||||||
|
: (`string`) The language name, typically used when rendering a language switcher.
|
||||||
|
|
||||||
|
`title`
|
||||||
|
: (`string`) The language title. When set, this overrides the site title for this language.
|
||||||
|
|
||||||
|
`weight`
|
||||||
|
: (`int`) The language weight. When set to a non-zero value, this is the primary sort criteria for this language.
|
||||||
|
|
||||||
|
[`dir`]: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir
|
||||||
|
[built-in RSS template]: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_default/rss.xml
|
||||||
|
[built-in alias template]: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/alias.html
|
||||||
|
[RFC 5646]: https://datatracker.ietf.org/doc/html/rfc5646
|
||||||
|
[translating by file name]: #translation-by-file-name
|
||||||
|
|
||||||
### Changes in Hugo 0.112.0
|
### Changes in Hugo 0.112.0
|
||||||
|
|
||||||
|
@ -76,7 +98,7 @@ Only the obvious non-global options can be overridden per language. Examples of
|
||||||
In Hugo `v0.112.0` we consolidated all configuration options, and improved how the languages and their parameters are merged with the main configuration. But while testing this on Hugo sites out there, we received some error reports and reverted some of the changes in favor of deprecation warnings:
|
In Hugo `v0.112.0` we consolidated all configuration options, and improved how the languages and their parameters are merged with the main configuration. But while testing this on Hugo sites out there, we received some error reports and reverted some of the changes in favor of deprecation warnings:
|
||||||
|
|
||||||
1. `site.Language.Params` is deprecated. Use `site.Params` directly.
|
1. `site.Language.Params` is deprecated. Use `site.Params` directly.
|
||||||
1. Adding custom params to the top level language config is deprecated, add all of these below `[params]`, see `color` in the example below.
|
1. Adding custom parameters to the top level language configuration is deprecated, add all of these below `[params]`, see `color` in the example below.
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
title = "My blog"
|
title = "My blog"
|
||||||
|
@ -92,35 +114,36 @@ color = "blue"
|
||||||
|
|
||||||
In the example above, all settings except `color` below `params` map to predefined configuration options in Hugo for the site and its language, and should be accessed via the documented accessors:
|
In the example above, all settings except `color` below `params` map to predefined configuration options in Hugo for the site and its language, and should be accessed via the documented accessors:
|
||||||
|
|
||||||
```
|
```go-html-template
|
||||||
{{ site.Title }}
|
{{ site.Title }}
|
||||||
{{ site.LanguageCode }}
|
{{ site.LanguageCode }}
|
||||||
{{ site.Params.color }}
|
{{ site.Params.color }}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Disable a Language
|
### Disable a language
|
||||||
|
|
||||||
You can disable one or more languages. This can be useful when working on a new translation.
|
To disable a language within a `languages` object in your site configuration:
|
||||||
|
|
||||||
{{< code-toggle file="hugo" >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
disableLanguages = ["fr", "ja"]
|
[languages.es]
|
||||||
|
disabled = true
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
|
To disable one or more languages in the root of your site configuration:
|
||||||
|
|
||||||
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
|
disableLanguages = ["es", "fr"]
|
||||||
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
|
To disable one or more languages using an environment variable:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
HUGO_DISABLELANGUAGES="es fr" hugo
|
||||||
|
```
|
||||||
|
|
||||||
Note that you cannot disable the default content language.
|
Note that you cannot disable the default content language.
|
||||||
|
|
||||||
We kept this as a standalone setting to make it easier to set via [OS environment]:
|
### Configure multilingual multihost
|
||||||
|
|
||||||
```bash
|
|
||||||
HUGO_DISABLELANGUAGES="fr ja" hugo
|
|
||||||
```
|
|
||||||
|
|
||||||
If you have already a list of disabled languages in `hugo.toml`, you can enable them in development like this:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
HUGO_DISABLELANGUAGES=" " hugo server
|
|
||||||
```
|
|
||||||
|
|
||||||
### Configure Multilingual Multihost
|
|
||||||
|
|
||||||
From **Hugo 0.31** we support multiple languages in a multihost configuration. See [this issue](https://github.com/gohugoio/hugo/issues/4027) for details.
|
From **Hugo 0.31** we support multiple languages in a multihost configuration. See [this issue](https://github.com/gohugoio/hugo/issues/4027) for details.
|
||||||
|
|
||||||
|
@ -167,12 +190,11 @@ Press Ctrl+C to stop
|
||||||
|
|
||||||
Live reload and `--navigateToChanged` between the servers work as expected.
|
Live reload and `--navigateToChanged` between the servers work as expected.
|
||||||
|
|
||||||
|
## Translate your content
|
||||||
## Translate Your Content
|
|
||||||
|
|
||||||
There are two ways to manage your content translations. Both ensure each page is assigned a language and is linked to its counterpart translations.
|
There are two ways to manage your content translations. Both ensure each page is assigned a language and is linked to its counterpart translations.
|
||||||
|
|
||||||
### Translation by filename
|
### Translation by file name
|
||||||
|
|
||||||
Considering the following example:
|
Considering the following example:
|
||||||
|
|
||||||
|
@ -182,9 +204,9 @@ Considering the following example:
|
||||||
The first file is assigned the English language and is linked to the second.
|
The first file is assigned the English language and is linked to the second.
|
||||||
The second file is assigned the French language and is linked to the first.
|
The second file is assigned the French language and is linked to the first.
|
||||||
|
|
||||||
Their language is __assigned__ according to the language code added as a __suffix to the filename__.
|
Their language is __assigned__ according to the language code added as a __suffix to the file name__.
|
||||||
|
|
||||||
By having the same **path and base filename**, the content pieces are __linked__ together as translated pages.
|
By having the same **path and base file name**, the content pieces are __linked__ together as translated pages.
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
If a file has no language code, it will be assigned the default language.
|
If a file has no language code, it will be assigned the default language.
|
||||||
|
@ -192,7 +214,7 @@ If a file has no language code, it will be assigned the default language.
|
||||||
|
|
||||||
### Translation by content directory
|
### Translation by content directory
|
||||||
|
|
||||||
This system uses different content directories for each of the languages. Each language's content directory is set using the `contentDir` param.
|
This system uses different content directories for each of the languages. Each language's content directory is set using the `contentDir` parameter.
|
||||||
|
|
||||||
{{< code-toggle file="hugo" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
languages:
|
languages:
|
||||||
|
@ -234,11 +256,11 @@ Considering the following example:
|
||||||
translationKey: "about"
|
translationKey: "about"
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
By setting the `translationKey` front matter param to `about` in all three pages, they will be __linked__ as translated pages.
|
By setting the `translationKey` front matter parameter to `about` in all three pages, they will be __linked__ as translated pages.
|
||||||
|
|
||||||
### Localizing permalinks
|
### Localizing permalinks
|
||||||
|
|
||||||
Because paths and filenames are used to handle linking, all translated pages will share the same URL (apart from the language subdirectory).
|
Because paths and file names are used to handle linking, all translated pages will share the same URL (apart from the language subdirectory).
|
||||||
|
|
||||||
To localize URLs:
|
To localize URLs:
|
||||||
|
|
||||||
|
@ -257,7 +279,7 @@ slug: "a-propos"
|
||||||
|
|
||||||
At render, Hugo will build both `/about/` and `/fr/a-propos/` without affecting the translation link.
|
At render, Hugo will build both `/about/` and `/fr/a-propos/` without affecting the translation link.
|
||||||
|
|
||||||
### Page Bundles
|
### Page bundles
|
||||||
|
|
||||||
To avoid the burden of having to duplicate files, each Page Bundle inherits the resources of its linked translated pages' bundles except for the content files (Markdown files, HTML files etc...).
|
To avoid the burden of having to duplicate files, each Page Bundle inherits the resources of its linked translated pages' bundles except for the content files (Markdown files, HTML files etc...).
|
||||||
|
|
||||||
|
@ -269,10 +291,10 @@ If, across the linked bundles, two or more files share the same basename, only o
|
||||||
* First file found across bundles by order of language `Weight`.
|
* First file found across bundles by order of language `Weight`.
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
Page Bundle resources follow the same language assignment logic as content files, both by filename (`image.jpg`, `image.fr.jpg`) and by directory (`english/about/header.jpg`, `french/about/header.jpg`).
|
Page Bundle resources follow the same language assignment logic as content files, both by file name (`image.jpg`, `image.fr.jpg`) and by directory (`english/about/header.jpg`, `french/about/header.jpg`).
|
||||||
{{%/ note %}}
|
{{%/ note %}}
|
||||||
|
|
||||||
## Reference the Translated Content
|
## Reference translated content
|
||||||
|
|
||||||
To create a list of links to translated content, use a template similar to the following:
|
To create a list of links to translated content, use a template similar to the following:
|
||||||
|
|
||||||
|
@ -293,7 +315,7 @@ The above can be put in a `partial` (i.e., inside `layouts/partials/`) and inclu
|
||||||
|
|
||||||
The above also uses the [`i18n` function][i18func] described in the next section.
|
The above also uses the [`i18n` function][i18func] described in the next section.
|
||||||
|
|
||||||
### List All Available Languages
|
### List all available languages
|
||||||
|
|
||||||
`.AllTranslations` on a `Page` can be used to list all translations, including the page itself. On the home page it can be used to build a language navigator:
|
`.AllTranslations` on a `Page` can be used to list all translations, including the page itself. On the home page it can be used to build a language navigator:
|
||||||
|
|
||||||
|
@ -305,7 +327,7 @@ The above also uses the [`i18n` function][i18func] described in the next section
|
||||||
</ul>
|
</ul>
|
||||||
{{< /code >}}
|
{{< /code >}}
|
||||||
|
|
||||||
## Translation of Strings
|
## Translation of strings
|
||||||
|
|
||||||
Hugo uses [go-i18n] to support string translations. [See the project's source repository][go-i18n-source] to find tools that will help you manage your translation workflows.
|
Hugo uses [go-i18n] to support string translations. [See the project's source repository][go-i18n-source] to find tools that will help you manage your translation workflows.
|
||||||
|
|
||||||
|
@ -585,7 +607,7 @@ weight = 20
|
||||||
|
|
||||||
For a simple menu with two languages, these menu entries are easy to create and maintain. For a larger menu, or with more than two languages, using translation tables as described above is preferable.
|
For a simple menu with two languages, these menu entries are easy to create and maintain. For a larger menu, or with more than two languages, using translation tables as described above is preferable.
|
||||||
|
|
||||||
## Missing Translations
|
## Missing translations
|
||||||
|
|
||||||
If a string does not have a translation for the current language, Hugo will use the value from the default language. If no default value is set, an empty string will be shown.
|
If a string does not have a translation for the current language, Hugo will use the value from the default language. If no default value is set, an empty string will be shown.
|
||||||
|
|
||||||
|
@ -604,7 +626,7 @@ hugo --printI18nWarnings | grep i18n
|
||||||
i18n|MISSING_TRANSLATION|en|wordCount
|
i18n|MISSING_TRANSLATION|en|wordCount
|
||||||
```
|
```
|
||||||
|
|
||||||
## Multilingual Themes support
|
## Multilingual themes support
|
||||||
|
|
||||||
To support Multilingual mode in your themes, some considerations must be taken for the URLs in the templates. If there is more than one language, URLs must meet the following criteria:
|
To support Multilingual mode in your themes, some considerations must be taken for the URLs in the templates. If there is more than one language, URLs must meet the following criteria:
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
---
|
---
|
||||||
title: Content Organization
|
title: Content organization
|
||||||
linkTitle: Organization
|
linkTitle: Organization
|
||||||
description: Hugo assumes that the same structure that works to organize your source content is used to organize the rendered site.
|
description: Hugo assumes that the same structure that works to organize your source content is used to organize the rendered site.
|
||||||
categories: [content management,fundamentals]
|
categories: [fundamentals,content management]
|
||||||
keywords: [sections,content,organization,bundle,resources]
|
keywords: [sections,content,organization,bundle,resources]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
|
@ -13,7 +13,7 @@ weight: 20
|
||||||
aliases: [/content/sections/]
|
aliases: [/content/sections/]
|
||||||
---
|
---
|
||||||
|
|
||||||
## Page Bundles
|
## Page bundles
|
||||||
|
|
||||||
Hugo `0.32` announced page-relative images and other resources packaged into `Page Bundles`.
|
Hugo `0.32` announced page-relative images and other resources packaged into `Page Bundles`.
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ The bundle documentation is a **work in progress**. We will publish more compreh
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
|
|
||||||
## Organization of Content Source
|
## Organization of content source
|
||||||
|
|
||||||
In Hugo, your content should be organized in a manner that reflects the rendered website.
|
In Hugo, your content should be organized in a manner that reflects the rendered website.
|
||||||
|
|
||||||
|
@ -52,12 +52,12 @@ Without any additional configuration, the following will automatically work:
|
||||||
└── second.md // <- https://example.com/quote/second/
|
└── second.md // <- https://example.com/quote/second/
|
||||||
```
|
```
|
||||||
|
|
||||||
## Path Breakdown in Hugo
|
## Path breakdown in Hugo
|
||||||
|
|
||||||
|
|
||||||
The following demonstrates the relationships between your content organization and the output URL structure for your Hugo website when it renders. These examples assume you are [using pretty URLs][pretty], which is the default behavior for Hugo. The examples also assume a key-value of `baseURL = "https://example.com"` in your [site's configuration file][config].
|
The following demonstrates the relationships between your content organization and the output URL structure for your Hugo website when it renders. These examples assume you are [using pretty URLs][pretty], which is the default behavior for Hugo. The examples also assume a key-value of `baseURL = "https://example.com"` in your [site's configuration file][config].
|
||||||
|
|
||||||
### Index Pages: `_index.md`
|
### Index pages: `_index.md`
|
||||||
|
|
||||||
`_index.md` has a special role in Hugo. It allows you to add front matter and content to your [list templates][lists]. These templates include those for [section templates], [taxonomy templates], [taxonomy terms templates], and your [homepage template].
|
`_index.md` has a special role in Hugo. It allows you to add front matter and content to your [list templates][lists]. These templates include those for [section templates], [taxonomy templates], [taxonomy terms templates], and your [homepage template].
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ https://example.com/posts/index.html
|
||||||
The [sections] can be nested as deeply as you want. The important thing to understand is that to make the section tree fully navigational, at least the lower-most section must include a content file. (i.e. `_index.md`).
|
The [sections] can be nested as deeply as you want. The important thing to understand is that to make the section tree fully navigational, at least the lower-most section must include a content file. (i.e. `_index.md`).
|
||||||
|
|
||||||
|
|
||||||
### Single Pages in Sections
|
### Single pages in sections
|
||||||
|
|
||||||
Single content files in each of your sections will be rendered as [single page templates][singles]. Here is an example of a single `post` within `posts`:
|
Single content files in each of your sections will be rendered as [single page templates][singles]. Here is an example of a single `post` within `posts`:
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ https://example.com/posts/my-first-hugo-post/index.html
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Paths Explained
|
## Paths explained
|
||||||
|
|
||||||
The following concepts provide more insight into the relationship between your project's organization and the default Hugo behavior when building output for the website.
|
The following concepts provide more insight into the relationship between your project's organization and the default Hugo behavior when building output for the website.
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
title: Page Bundles
|
title: Page bundles
|
||||||
description: Content organization using Page Bundles
|
description: Content organization using Page Bundles
|
||||||
keywords: [page, bundle, leaf, branch]
|
keywords: [page, bundle, leaf, branch]
|
||||||
categories: [content management]
|
categories: [content management]
|
||||||
|
@ -19,23 +19,22 @@ A Page Bundle can be one of:
|
||||||
- Branch Bundle (home page, section, taxonomy terms, taxonomy list)
|
- Branch Bundle (home page, section, taxonomy terms, taxonomy list)
|
||||||
|
|
||||||
| | Leaf Bundle | Branch Bundle |
|
| | Leaf Bundle | Branch Bundle |
|
||||||
|-------------------------------------|----------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|-------------------------------------|----------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| Usage | Collection of content and attachments for single pages | Collection of attachments for section pages (home page, section, taxonomy terms, taxonomy list) |
|
| Usage | Collection of content and attachments for single pages | Collection of attachments for section pages (home page, section, taxonomy terms, taxonomy list) |
|
||||||
| Index filename | `index.md` [^fn:1] | `_index.md` [^fn:1] |
|
| Index file name | `index.md` [^fn:1] | `_index.md` [^fn:1] |
|
||||||
| Allowed Resources | Page and non-page (like images, PDF, etc.) types | Only non-page (like images, PDF, etc.) types |
|
| Allowed Resources | Page and non-page (like images, PDF, etc.) types | Only non-page (like images, PDF, etc.) types |
|
||||||
| Where can the Resources live? | At any directory level within the leaf bundle directory. | Only in the directory level **of** the branch bundle directory i.e. the directory containing the `_index.md` ([ref](https://discourse.gohugo.io/t/question-about-content-folder-structure/11822/4?u=kaushalmodi)). |
|
| Where can the Resources live? | At any directory level within the leaf bundle directory. | Only in the directory level **of** the branch bundle directory i.e. the directory containing the `_index.md` ([ref](https://discourse.gohugo.io/t/question-about-content-folder-structure/11822/4?u=kaushalmodi)). |
|
||||||
| Layout type | `single` | `list` |
|
| Layout type | [`single`](/templates/single-page-templates/) | [`list`](/templates/lists) |
|
||||||
| Nesting | Does not allow nesting of more bundles under it | Allows nesting of leaf or branch bundles under it |
|
| Nesting | Does not allow nesting of more bundles under it | Allows nesting of leaf or branch bundles under it |
|
||||||
| Example | `content/posts/my-post/index.md` | `content/posts/_index.md` |
|
| Example | `content/posts/my-post/index.md` | `content/posts/_index.md` |
|
||||||
| Content from non-index page files... | Accessed only as page resources | Accessed only as regular pages |
|
| Content from non-index page files...| Accessed only as page resources | Accessed only as regular pages |
|
||||||
|
|
||||||
|
## Leaf bundles
|
||||||
## Leaf Bundles {#leaf-bundles}
|
|
||||||
|
|
||||||
A _Leaf Bundle_ is a directory at any hierarchy within the `content/`
|
A _Leaf Bundle_ is a directory at any hierarchy within the `content/`
|
||||||
directory, that contains an **`index.md`** file.
|
directory, that contains an **`index.md`** file.
|
||||||
|
|
||||||
### Examples of Leaf Bundle organization {#examples-of-leaf-bundle-organization}
|
### Examples of leaf bundle organization {#examples-of-leaf-bundle-organization}
|
||||||
|
|
||||||
```text
|
```text
|
||||||
content/
|
content/
|
||||||
|
@ -92,7 +91,7 @@ as long as it is not inside another **leaf** bundle.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
|
|
||||||
### Headless Bundle {#headless-bundle}
|
### Headless bundle
|
||||||
|
|
||||||
A headless bundle is a bundle that is configured to not get published
|
A headless bundle is a bundle that is configured to not get published
|
||||||
anywhere:
|
anywhere:
|
||||||
|
@ -126,7 +125,7 @@ Explanation of the above example:
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
A leaf bundle can be made headless by adding below in the Front Matter
|
A leaf bundle can be made headless by adding below in the front matter
|
||||||
(in the `index.md`):
|
(in the `index.md`):
|
||||||
|
|
||||||
{{< code-toggle file="content/headless/index.md" fm=true copy=false >}}
|
{{< code-toggle file="content/headless/index.md" fm=true copy=false >}}
|
||||||
|
@ -138,7 +137,7 @@ There are many use cases of such headless page bundles:
|
||||||
- Shared media galleries
|
- Shared media galleries
|
||||||
- Reusable page content "snippets"
|
- Reusable page content "snippets"
|
||||||
|
|
||||||
## Branch Bundles {#branch-bundles}
|
## Branch bundles
|
||||||
|
|
||||||
A _Branch Bundle_ is any directory at any hierarchy within the
|
A _Branch Bundle_ is any directory at any hierarchy within the
|
||||||
`content/` directory, that contains at least an **`_index.md`** file.
|
`content/` directory, that contains at least an **`_index.md`** file.
|
||||||
|
@ -151,7 +150,7 @@ type as a content resource as long as it is a content type recognized by Hugo.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
|
|
||||||
### Examples of Branch Bundle organization {#examples-of-branch-bundle-organization}
|
### Examples of branch bundle organization
|
||||||
|
|
||||||
```text
|
```text
|
||||||
content/
|
content/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
title: Page Resources
|
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.
|
||||||
categories: [content management]
|
categories: [content management]
|
||||||
keywords: [bundle,content,resources]
|
keywords: [bundle,content,resources]
|
||||||
|
@ -42,7 +42,7 @@ ResourceType
|
||||||
: The main type of the resource's [Media Type](/templates/output-formats/#media-types). For example, a file of MIME type `image/jpeg` has the ResourceType `image`. A `Page` will have `ResourceType` with value `page`.
|
: The main type of the resource's [Media Type](/templates/output-formats/#media-types). For example, a file of MIME type `image/jpeg` has the ResourceType `image`. A `Page` will have `ResourceType` with value `page`.
|
||||||
|
|
||||||
Name
|
Name
|
||||||
: Default value is the filename (relative to the owning page). Can be set in front matter.
|
: Default value is the file name (relative to the owning page). Can be set in front matter.
|
||||||
|
|
||||||
Title
|
Title
|
||||||
: Default value is the same as `.Name`. Can be set in front matter.
|
: Default value is the same as `.Name`. Can be set in front matter.
|
||||||
|
@ -67,21 +67,21 @@ with the contents of the file. Use this to create inline resources.
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ with .Resources.GetMatch "img.png" }}
|
{{ with .Resources.GetMatch "img.png" }}
|
||||||
<img src="data:{{ .MediaType }};base64,{{ .Content | base64Encode }}">
|
<img src="data:{{ .MediaType.Type }};base64,{{ .Content | base64Encode }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
```
|
```
|
||||||
|
|
||||||
MediaType
|
MediaType.Type
|
||||||
: The MIME type of the resource, such as `image/jpeg`.
|
: The media type (formerly known as a MIME type) of the resource (e.g., `image/jpeg`).
|
||||||
|
|
||||||
MediaType.MainType
|
MediaType.MainType
|
||||||
: The main type of the resource's MIME type. For example, a file of MIME type `application/pdf` has for MainType `application`.
|
: The main type of the resource's media type (e.g., `image`).
|
||||||
|
|
||||||
MediaType.SubType
|
MediaType.SubType
|
||||||
: The subtype of the resource's MIME type. For example, a file of MIME type `application/pdf` has for SubType `pdf`. Note that this is not the same as the file extension. For example, Microsoft PowerPoint files (`.ppt`) have a subtype of `vnd.ms-powerpoint`.
|
: The subtype of the resource's type (e.g., `jpeg`). This may or may not correspond to the file suffix.
|
||||||
|
|
||||||
MediaType.Suffixes
|
MediaType.Suffixes
|
||||||
: A slice of possible suffixes for the resource's MIME type.
|
: A slice of possible file suffixes for the resource's media type (e.g., `[jpg jpeg jpe jif jfif]`).
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ Match
|
||||||
GetMatch
|
GetMatch
|
||||||
: Same as `Match` but will return the first match.
|
: Same as `Match` but will return the first match.
|
||||||
|
|
||||||
### Pattern Matching
|
### Pattern matching
|
||||||
|
|
||||||
```go
|
```go
|
||||||
// Using Match/GetMatch to find this images/sunset.jpg ?
|
// Using Match/GetMatch to find this images/sunset.jpg ?
|
||||||
|
@ -115,7 +115,7 @@ GetMatch
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Page Resources Metadata
|
## Page resources metadata
|
||||||
|
|
||||||
The page resources' metadata is managed from the corresponding page's front matter with an array/table parameter named `resources`. You can batch assign values using [wildcards](https://tldp.org/LDP/GNU-Linux-Tools-Summary/html/x11655.htm).
|
The page resources' metadata is managed from the corresponding page's front matter with an array/table parameter named `resources`. You can batch assign values using [wildcards](https://tldp.org/LDP/GNU-Linux-Tools-Summary/html/x11655.htm).
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
title: Related Content
|
title: Related content
|
||||||
description: List related content in "See Also" sections.
|
description: List related content in "See Also" sections.
|
||||||
categories: [content management]
|
categories: [content management]
|
||||||
keywords: [content]
|
keywords: [content]
|
||||||
|
@ -12,9 +12,9 @@ weight: 110
|
||||||
aliases: [/content/related/,/related/]
|
aliases: [/content/related/,/related/]
|
||||||
---
|
---
|
||||||
|
|
||||||
Hugo uses a set of factors to identify a page's related content based on Front Matter parameters. This can be tuned to the desired set of indices and parameters or left to Hugo's default [Related Content configuration](#configure-related-content).
|
Hugo uses a set of factors to identify a page's related content based on front matter parameters. This can be tuned to the desired set of indices and parameters or left to Hugo's default [Related Content configuration](#configure-related-content).
|
||||||
|
|
||||||
## List Related Content
|
## List related content
|
||||||
|
|
||||||
To list up to 5 related pages (which share the same _date_ or _keyword_ parameters) is as simple as including something similar to this partial in your single page template:
|
To list up to 5 related pages (which share the same _date_ or _keyword_ parameters) is as simple as including something similar to this partial in your single page template:
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ A fictional example using all of the above options:
|
||||||
We improved and simplified this feature in Hugo 0.111.0. Before this we had 3 different methods: `Related`, `RelatedTo` and `RelatedIndicies`. Now we have only one method: `Related`. The old methods are still available but deprecated. Also see [this blog article](https://regisphilibert.com/blog/2018/04/hugo-optmized-relashionships-with-related-content/) for a great explanation of more advanced usage of this feature.
|
We improved and simplified this feature in Hugo 0.111.0. Before this we had 3 different methods: `Related`, `RelatedTo` and `RelatedIndicies`. Now we have only one method: `Related`. The old methods are still available but deprecated. Also see [this blog article](https://regisphilibert.com/blog/2018/04/hugo-optmized-relashionships-with-related-content/) for a great explanation of more advanced usage of this feature.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
## Index Content Headings in Related Content
|
## Index content headings in related content
|
||||||
|
|
||||||
{{< new-in "0.111.0" >}}
|
{{< new-in "0.111.0" >}}
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ weight = 80
|
||||||
{{ end }}
|
{{ end }}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configure Related Content
|
## Configure related content
|
||||||
|
|
||||||
Hugo provides a sensible default configuration of Related Content, but you can fine-tune this in your configuration, on the global or language level if needed.
|
Hugo provides a sensible default configuration of Related Content, but you can fine-tune this in your configuration, on the global or language level if needed.
|
||||||
|
|
||||||
|
@ -130,10 +130,10 @@ Note that if you have configured `tags` as a taxonomy, `tags` will also be added
|
||||||
Custom configuration should be set using the same syntax.
|
Custom configuration should be set using the same syntax.
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
If you add a `related` config section, you need to add a complete configuration. It is not possible to just set, say, `includeNewer` and use the rest from the Hugo defaults.
|
If you add a `related` configuration section, you need to add a complete configuration. It is not possible to just set, say, `includeNewer` and use the rest from the Hugo defaults.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
### Top Level Config Options
|
### Top level configuration options
|
||||||
|
|
||||||
threshold
|
threshold
|
||||||
: A value between 0-100. Lower value will give more, but maybe not so relevant, matches.
|
: A value between 0-100. Lower value will give more, but maybe not so relevant, matches.
|
||||||
|
@ -144,10 +144,10 @@ includeNewer
|
||||||
toLower
|
toLower
|
||||||
: Set to true to lower case keywords in both the indexes and the queries. This may give more accurate results at a slight performance penalty. Note that this can also be set per index.
|
: Set to true to lower case keywords in both the indexes and the queries. This may give more accurate results at a slight performance penalty. Note that this can also be set per index.
|
||||||
|
|
||||||
### Config Options per Index
|
### Configuration options per index
|
||||||
|
|
||||||
name
|
name
|
||||||
: The index name. This value maps directly to a page param. Hugo supports string values (`author` in the example) and lists (`tags`, `keywords` etc.) and time and date objects.
|
: The index name. This value maps directly to a page parameter. Hugo supports string values (`author` in the example) and lists (`tags`, `keywords` etc.) and time and date objects.
|
||||||
|
|
||||||
type
|
type
|
||||||
: {{< new-in "0.111.0" >}}. One of `basic`(default) or `fragments`.
|
: {{< new-in "0.111.0" >}}. One of `basic`(default) or `fragments`.
|
||||||
|
@ -168,7 +168,7 @@ pattern
|
||||||
toLower
|
toLower
|
||||||
: See above.
|
: See above.
|
||||||
|
|
||||||
## Performance Considerations
|
## Performance considerations
|
||||||
|
|
||||||
**Fast is Hugo's middle name** and we would not have released this feature had it not been blistering fast.
|
**Fast is Hugo's middle name** and we would not have released this feature had it not been blistering fast.
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
---
|
---
|
||||||
title: Content Sections
|
title: Sections
|
||||||
linkTitle: Sections
|
|
||||||
description: Hugo generates a **section tree** that matches your content.
|
description: Hugo generates a **section tree** that matches your content.
|
||||||
categories: [content management]
|
categories: [content management]
|
||||||
keywords: [lists,sections,content types,organization]
|
keywords: [lists,sections,content types,organization]
|
||||||
|
@ -31,7 +30,7 @@ A **section** cannot be defined or overridden by a front matter parameter -- it
|
||||||
is strictly derived from the content organization structure.
|
is strictly derived from the content organization structure.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
## Nested Sections
|
## Nested sections
|
||||||
|
|
||||||
The sections can be nested as deeply as you need.
|
The sections can be nested as deeply as you need.
|
||||||
|
|
||||||
|
@ -55,7 +54,7 @@ currently always the *root section* only (`/blog/funny-cats/mypost/ => blog`).
|
||||||
If you need a specific template for a sub-section, you need to adjust either the `type` or `layout` in front matter.
|
If you need a specific template for a sub-section, you need to adjust either the `type` or `layout` in front matter.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
## Example: Breadcrumb Navigation
|
## Example: breadcrumb navigation
|
||||||
|
|
||||||
With the available [section variables and methods](#section-page-variables-and-methods) you can build powerful navigation. One common example would be a partial to show Breadcrumb navigation:
|
With the available [section variables and methods](#section-page-variables-and-methods) you can build powerful navigation. One common example would be a partial to show Breadcrumb navigation:
|
||||||
|
|
||||||
|
@ -74,17 +73,17 @@ With the available [section variables and methods](#section-page-variables-and-m
|
||||||
</nav>
|
</nav>
|
||||||
{{< /code >}}
|
{{< /code >}}
|
||||||
|
|
||||||
## Section Page Variables and Methods
|
## Section page variables and methods
|
||||||
|
|
||||||
Also see [Page Variables](/variables/page/).
|
Also see [Page Variables](/variables/page/).
|
||||||
|
|
||||||
{{< readfile file="/content/en/readfiles/sectionvars.md" markdown="true" >}}
|
{{< readfile file="/content/en/readfiles/sectionvars.md" markdown="true" >}}
|
||||||
|
|
||||||
## Content Section Lists
|
## Content section lists
|
||||||
|
|
||||||
Hugo will automatically create a page for each *root section* that lists all the content in that section. See the documentation on [section templates] for details on customizing the way these pages are rendered.
|
Hugo will automatically create a page for each *root section* that lists all the content in that section. See the documentation on [section templates] for details on customizing the way these pages are rendered.
|
||||||
|
|
||||||
## Content *Section* vs Content *Type*
|
## Content *section* vs. content *type*
|
||||||
|
|
||||||
By default, everything created within a section will use the [content `type`][content type] that matches the *root section* name. For example, Hugo will assume that `posts/post-1.md` has a `posts` content `type`. If you are using an [archetype] for your `posts` section, Hugo will generate front matter according to what it finds in `archetypes/posts.md`.
|
By default, everything created within a section will use the [content `type`][content type] that matches the *root section* name. For example, Hugo will assume that `posts/post-1.md` has a `posts` content `type`. If you are using an [archetype] for your `posts` section, Hugo will generate front matter according to what it finds in `archetypes/posts.md`.
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ aliases: [/extras/shortcodes/]
|
||||||
testparam: "Hugo Rocks!"
|
testparam: "Hugo Rocks!"
|
||||||
---
|
---
|
||||||
|
|
||||||
## What a Shortcode is
|
## What a shortcode is
|
||||||
|
|
||||||
Hugo loves Markdown because of its simple content format, but there are times when Markdown falls short. Often, content authors are forced to add raw HTML (e.g., video `<iframe>`'s) to Markdown content. We think this contradicts the beautiful simplicity of Markdown's syntax.
|
Hugo loves Markdown because of its simple content format, but there are times when Markdown falls short. Often, content authors are forced to add raw HTML (e.g., video `<iframe>`'s) to Markdown content. We think this contradicts the beautiful simplicity of Markdown's syntax.
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ A shortcode is a simple snippet inside a content file that Hugo will render usin
|
||||||
|
|
||||||
In addition to cleaner Markdown, shortcodes can be updated any time to reflect new classes, techniques, or standards. At the point of site generation, Hugo shortcodes will easily merge in your changes. You avoid a possibly complicated search and replace operation.
|
In addition to cleaner Markdown, shortcodes can be updated any time to reflect new classes, techniques, or standards. At the point of site generation, Hugo shortcodes will easily merge in your changes. You avoid a possibly complicated search and replace operation.
|
||||||
|
|
||||||
## Use Shortcodes
|
## Use shortcodes
|
||||||
|
|
||||||
{{< youtube 2xkNJL4gJ9E >}}
|
{{< youtube 2xkNJL4gJ9E >}}
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ You can pass multiple lines as parameters to a shortcode by using raw string lit
|
||||||
and a new line with a "quoted string".` */>}}
|
and a new line with a "quoted string".` */>}}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Shortcodes with Markdown
|
### 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. 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.
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ If you want the old behavior, you can put the following line in the start of you
|
||||||
{{ $_hugo_config := `{ "version": 1 }` }}
|
{{ $_hugo_config := `{ "version": 1 }` }}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Shortcodes Without Markdown
|
### Shortcodes without markdown
|
||||||
|
|
||||||
The `<` character indicates that the shortcode's inner content does *not* need further rendering. Often shortcodes without Markdown include internal HTML:
|
The `<` character indicates that the shortcode's inner content does *not* need further rendering. Often shortcodes without Markdown include internal HTML:
|
||||||
|
|
||||||
|
@ -72,11 +72,11 @@ The `<` character indicates that the shortcode's inner content does *not* need f
|
||||||
{{</* myshortcode */>}}<p>Hello <strong>World!</strong></p>{{</* /myshortcode */>}}
|
{{</* myshortcode */>}}<p>Hello <strong>World!</strong></p>{{</* /myshortcode */>}}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Nested Shortcodes
|
### Nested shortcodes
|
||||||
|
|
||||||
You can call shortcodes within other shortcodes by creating your own templates that leverage the `.Parent` variable. `.Parent` allows you to check the context in which the shortcode is being called. See [Shortcode templates][sctemps].
|
You can call shortcodes within other shortcodes by creating your own templates that leverage the `.Parent` variable. `.Parent` allows you to check the context in which the shortcode is being called. See [Shortcode templates][sctemps].
|
||||||
|
|
||||||
## Use Hugo's Built-in Shortcodes
|
## Use Hugo's built-in shortcodes
|
||||||
|
|
||||||
Hugo ships with a set of predefined shortcodes that represent very common usage. These shortcodes are provided for author convenience and to keep your Markdown content clean.
|
Hugo ships with a set of predefined shortcodes that represent very common usage. These shortcodes are provided for author convenience and to keep your Markdown content clean.
|
||||||
|
|
||||||
|
@ -125,13 +125,13 @@ attr
|
||||||
attrlink
|
attrlink
|
||||||
: If the attribution text needs to be hyperlinked, URL of the destination.
|
: If the attribution text needs to be hyperlinked, URL of the destination.
|
||||||
|
|
||||||
#### Example `figure` Input
|
#### Example `figure` input
|
||||||
|
|
||||||
{{< code file="figure-input-example.md" >}}
|
{{< code file="figure-input-example.md" >}}
|
||||||
{{</* figure src="elephant.jpg" title=">An elephant at sunset" */>}}
|
{{</* figure src="elephant.jpg" title="An elephant at sunset" */>}}
|
||||||
{{< /code >}}
|
{{< /code >}}
|
||||||
|
|
||||||
#### Example `figure` Output
|
#### Example `figure` output
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<figure>
|
<figure>
|
||||||
|
@ -254,17 +254,17 @@ Include this in your markdown:
|
||||||
|
|
||||||
### `param`
|
### `param`
|
||||||
|
|
||||||
Gets a value from the current `Page's` params set in front matter, with a fallback to the site param value. It will log an `ERROR` if the param with the given key could not be found in either.
|
Gets a value from the current `Page's` parameters set in front matter, with a fallback to the site parameter value. It will log an `ERROR` if the parameter with the given key could not be found in either.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
{{</* param testparam */>}}
|
{{</* param testparam */>}}
|
||||||
```
|
```
|
||||||
|
|
||||||
Since `testparam` is a param defined in front matter of this page with the value `Hugo Rocks!`, the above will print:
|
Since `testparam` is a parameter defined in front matter of this page with the value `Hugo Rocks!`, the above will print:
|
||||||
|
|
||||||
{{< param testparam >}}
|
{{< param testparam >}}
|
||||||
|
|
||||||
To access deeply nested params, use "dot syntax", e.g:
|
To access deeply nested parameters, use "dot syntax", e.g:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
{{</* param "my.nested.param" */>}}
|
{{</* param "my.nested.param" */>}}
|
||||||
|
@ -282,14 +282,14 @@ Read a more extensive description of `ref` and `relref` in the [cross references
|
||||||
|
|
||||||
`ref` and `relref` take exactly one required parameter of _reference_, quoted and in position `0`.
|
`ref` and `relref` take exactly one required parameter of _reference_, quoted and in position `0`.
|
||||||
|
|
||||||
#### Example `ref` and `relref` Input
|
#### Example `ref` and `relref` input
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
[Neat]({{</* ref "blog/neat.md" */>}})
|
[Neat]({{</* ref "blog/neat.md" */>}})
|
||||||
[Who]({{</* relref "about.md#who" */>}})
|
[Who]({{</* relref "about.md#who" */>}})
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Example `ref` and `relref` Output
|
#### Example `ref` and `relref` output
|
||||||
|
|
||||||
Assuming that standard Hugo pretty URLs are turned on.
|
Assuming that standard Hugo pretty URLs are turned on.
|
||||||
|
|
||||||
|
@ -350,7 +350,7 @@ The `youtube` shortcode embeds a responsive video player for [YouTube videos]. O
|
||||||
https://www.youtube.com/watch?v=w7Ft2ymGmfc
|
https://www.youtube.com/watch?v=w7Ft2ymGmfc
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Example `youtube` Input
|
#### Example `youtube` input
|
||||||
|
|
||||||
Copy the YouTube video ID that follows `v=` in the video's URL and pass it to the `youtube` shortcode:
|
Copy the YouTube video ID that follows `v=` in the video's URL and pass it to the `youtube` shortcode:
|
||||||
|
|
||||||
|
@ -371,7 +371,7 @@ For [accessibility reasons](https://dequeuniversity.com/tips/provide-iframe-titl
|
||||||
{{</* youtube id="w7Ft2ymGmfc" title="A New Hugo Site in Under Two Minutes" */>}}
|
{{</* youtube id="w7Ft2ymGmfc" title="A New Hugo Site in Under Two Minutes" */>}}
|
||||||
{{< /code >}}
|
{{< /code >}}
|
||||||
|
|
||||||
#### Example `youtube` Output
|
#### Example `youtube` output
|
||||||
|
|
||||||
Using the preceding `youtube` example, the following HTML will be added to your rendered website's markup:
|
Using the preceding `youtube` example, the following HTML will be added to your rendered website's markup:
|
||||||
|
|
||||||
|
@ -379,17 +379,17 @@ Using the preceding `youtube` example, the following HTML will be added to your
|
||||||
{{< youtube id="w7Ft2ymGmfc" autoplay="true" >}}
|
{{< youtube id="w7Ft2ymGmfc" autoplay="true" >}}
|
||||||
{{< /code >}}
|
{{< /code >}}
|
||||||
|
|
||||||
#### Example `youtube` Display
|
#### Example `youtube` display
|
||||||
|
|
||||||
Using the preceding `youtube` example (without `autoplay="true"`), the following simulates the displayed experience for visitors to your website. Naturally, the final display will be contingent on your style sheets and surrounding markup. The video is also include in the [Quick Start of the Hugo documentation][quickstart].
|
Using the preceding `youtube` example (without `autoplay="true"`), the following simulates the displayed experience for visitors to your website. Naturally, the final display will be contingent on your style sheets and surrounding markup. The video is also include in the [Quick Start of the Hugo documentation][quickstart].
|
||||||
|
|
||||||
{{< youtube w7Ft2ymGmfc >}}
|
{{< youtube w7Ft2ymGmfc >}}
|
||||||
|
|
||||||
## Privacy Config
|
## Privacy configuration
|
||||||
|
|
||||||
To learn how to configure your Hugo site to meet the new EU privacy regulation, see [Hugo and the GDPR].
|
To learn how to configure your Hugo site to meet the new EU privacy regulation, see [Hugo and the GDPR].
|
||||||
|
|
||||||
## Create Custom Shortcodes
|
## Create custom shortcodes
|
||||||
|
|
||||||
To learn more about creating custom shortcodes, see the [shortcode template documentation].
|
To learn more about creating custom shortcodes, see the [shortcode template documentation].
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
---
|
---
|
||||||
title: Static Files
|
title: Static files
|
||||||
linkTitle: Static Files
|
|
||||||
description: Files that get served **statically** (as-is, no modification) on the site root.
|
description: Files that get served **statically** (as-is, no modification) on the site root.
|
||||||
categories: [content management]
|
categories: [content management]
|
||||||
keywords: [source, directories]
|
keywords: [source, directories]
|
||||||
|
@ -18,7 +17,7 @@ all **static files** (e.g. stylesheets, JavaScript, images). The static files ar
|
||||||
|
|
||||||
Hugo can be configured to look into a different directory, or even
|
Hugo can be configured to look into a different directory, or even
|
||||||
**multiple directories** for such static files by configuring the
|
**multiple directories** for such static files by configuring the
|
||||||
`staticDir` parameter in the [site config]. All the files in all the
|
`staticDir` parameter in the [site configuration]. All the files in all the
|
||||||
static directories will form a union filesystem.
|
static directories will form a union filesystem.
|
||||||
|
|
||||||
This union filesystem will be served from your site root. So a file
|
This union filesystem will be served from your site root. So a file
|
||||||
|
@ -65,5 +64,5 @@ Note 2
|
||||||
: The example above is a [multihost setup]. In a regular setup, all
|
: The example above is a [multihost setup]. In a regular setup, all
|
||||||
the static directories will be available to all sites.
|
the static directories will be available to all sites.
|
||||||
|
|
||||||
[site config]: /getting-started/configuration/#all-configuration-settings
|
[site configuration]: /getting-started/configuration/#all-configuration-settings
|
||||||
[multihost setup]: /content-management/multilingual/#configure-multilingual-multihost
|
[multihost setup]: /content-management/multilingual/#configure-multilingual-multihost
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
title: Content Summaries
|
title: Content summaries
|
||||||
linkTitle: Summaries
|
linkTitle: Summaries
|
||||||
description: Hugo generates summaries of your content.
|
description: Hugo generates summaries of your content.
|
||||||
categories: [content management]
|
categories: [content management]
|
||||||
|
@ -15,7 +15,7 @@ aliases: [/content/summaries/,/content-management/content-summaries/]
|
||||||
|
|
||||||
With the use of the `.Summary` [page variable][pagevariables], Hugo generates summaries of content to use as a short version in summary views.
|
With the use of the `.Summary` [page variable][pagevariables], Hugo generates summaries of content to use as a short version in summary views.
|
||||||
|
|
||||||
## Summary Splitting Options
|
## Summary splitting options
|
||||||
|
|
||||||
* Automatic Summary Split
|
* Automatic Summary Split
|
||||||
* Manual Summary Split
|
* Manual Summary Split
|
||||||
|
@ -23,7 +23,7 @@ With the use of the `.Summary` [page variable][pagevariables], Hugo generates su
|
||||||
|
|
||||||
It is natural to accompany the summary with links to the original content, and a common design pattern is to see this link in the form of a "Read More ..." button. See the `.RelPermalink`, `.Permalink`, and `.Truncated` [page variables][pagevariables].
|
It is natural to accompany the summary with links to the original content, and a common design pattern is to see this link in the form of a "Read More ..." button. See the `.RelPermalink`, `.Permalink`, and `.Truncated` [page variables][pagevariables].
|
||||||
|
|
||||||
### Automatic Summary Splitting
|
### Automatic summary splitting
|
||||||
|
|
||||||
By default, Hugo automatically takes the first 70 words of your content as its summary and stores it into the `.Summary` page variable for use in your templates. You may customize the summary length by setting `summaryLength` in your [site configuration](/getting-started/configuration/).
|
By default, Hugo automatically takes the first 70 words of your content as its summary and stores it into the `.Summary` page variable for use in your templates. You may customize the summary length by setting `summaryLength` in your [site configuration](/getting-started/configuration/).
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ You can customize how HTML tags in the summary are loaded using functions such a
|
||||||
The Hugo-defined summaries are set to use word count calculated by splitting the text by one or more consecutive whitespace characters. If you are creating content in a `CJK` language and want to use Hugo's automatic summary splitting, set `hasCJKLanguage` to `true` in your [site configuration](/getting-started/configuration/).
|
The Hugo-defined summaries are set to use word count calculated by splitting the text by one or more consecutive whitespace characters. If you are creating content in a `CJK` language and want to use Hugo's automatic summary splitting, set `hasCJKLanguage` to `true` in your [site configuration](/getting-started/configuration/).
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
### Manual Summary Splitting
|
### Manual summary splitting
|
||||||
|
|
||||||
Alternatively, you may add the <code><!--more--></code> summary divider where you want to split the article.
|
Alternatively, you may add the <code><!--more--></code> summary divider where you want to split the article.
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ Cons
|
||||||
Be careful to enter <code><!--more--></code> exactly; i.e., all lowercase and with no whitespace.
|
Be careful to enter <code><!--more--></code> exactly; i.e., all lowercase and with no whitespace.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
### Front Matter Summary
|
### Front matter summary
|
||||||
|
|
||||||
You might want your summary to be something other than the text that starts the article. In this case you can provide a separate summary in the `summary` variable of the article front matter.
|
You might want your summary to be something other than the text that starts the article. In this case you can provide a separate summary in the `summary` variable of the article front matter.
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ Pros
|
||||||
Cons
|
Cons
|
||||||
: Extra work for content authors as they need to write an entirely separate piece of text as the summary of the article.
|
: Extra work for content authors as they need to write an entirely separate piece of text as the summary of the article.
|
||||||
|
|
||||||
## Summary Selection Order
|
## Summary selection order
|
||||||
|
|
||||||
Because there are multiple ways in which a summary can be specified it is useful to understand the order of selection Hugo follows when deciding on the text to be returned by `.Summary`. It is as follows:
|
Because there are multiple ways in which a summary can be specified it is useful to understand the order of selection Hugo follows when deciding on the text to be returned by `.Summary`. It is as follows:
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ Because there are multiple ways in which a summary can be specified it is useful
|
||||||
Hugo uses the _first_ of the above steps that returns text. So if, for example, your article has both `summary` variable in its front matter and a <code><!--more--></code> summary divider Hugo will use the manual summary split method.
|
Hugo uses the _first_ of the above steps that returns text. So if, for example, your article has both `summary` variable in its front matter and a <code><!--more--></code> summary divider Hugo will use the manual summary split method.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
## Example: First 10 Articles with Summaries
|
## Example: first 10 articles with summaries
|
||||||
|
|
||||||
You can show content summaries with the following code. You could use the following snippet, for example, in a [section template].
|
You can show content summaries with the following code. You could use the following snippet, for example, in a [section template].
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
title: Syntax Highlighting
|
title: Syntax highlighting
|
||||||
description: Hugo comes with really fast syntax highlighting from Chroma.
|
description: Hugo comes with really fast syntax highlighting from Chroma.
|
||||||
keywords: [highlighting,chroma,code blocks,syntax]
|
keywords: [highlighting,chroma,code blocks,syntax]
|
||||||
categories: [content management]
|
categories: [content management]
|
||||||
|
@ -14,13 +14,13 @@ aliases: [/extras/highlighting/,/extras/highlight/,/tools/syntax-highlighting/]
|
||||||
|
|
||||||
Hugo uses [Chroma](https://github.com/alecthomas/chroma) as its code highlighter; it is built in Go and is really, really fast.
|
Hugo uses [Chroma](https://github.com/alecthomas/chroma) as its code highlighter; it is built in Go and is really, really fast.
|
||||||
|
|
||||||
## Configure Syntax Highlighter
|
## Configure syntax highlighter
|
||||||
|
|
||||||
See [Configure Highlight](/getting-started/configuration-markup#highlight).
|
See [Configure Highlight](/getting-started/configuration-markup#highlight).
|
||||||
|
|
||||||
## Generate Syntax Highlighter CSS
|
## Generate syntax highlighter CSS
|
||||||
|
|
||||||
If you run with `markup.highlight.noClasses=false` in your site config, you need a style sheet.
|
If you run with `markup.highlight.noClasses=false` in your site configuration, you need a style sheet.
|
||||||
|
|
||||||
You can generate one with Hugo:
|
You can generate one with Hugo:
|
||||||
|
|
||||||
|
@ -30,20 +30,20 @@ hugo gen chromastyles --style=monokai > syntax.css
|
||||||
|
|
||||||
Run `hugo gen chromastyles -h` for more options. See https://xyproto.github.io/splash/docs/ for a gallery of available styles.
|
Run `hugo gen chromastyles -h` for more options. See https://xyproto.github.io/splash/docs/ for a gallery of available styles.
|
||||||
|
|
||||||
## Highlight Shortcode
|
## Highlight shortcode
|
||||||
|
|
||||||
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.
|
Highlighting is carried out via the built-in [`highlight` shortcode](/content-management/shortcodes/#highlight). It takes exactly one required parameter for the programming language to be highlighted and requires a closing shortcode.
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
|
|
||||||
* `linenos`: configure line numbers. Valid values are `true`, `false`, `table`, or `inline`. `false` will turn off line numbers if it's configured to be on in site config. `table` will give copy-and-paste friendly code blocks.
|
* `linenos`: configure line numbers. Valid values are `true`, `false`, `table`, or `inline`. `false` will turn off line numbers if it's configured to be on in site configuration. `table` will give copy-and-paste friendly code blocks.
|
||||||
* `hl_lines`: lists a set of line numbers or line number ranges to be highlighted.
|
* `hl_lines`: lists a set of line numbers or line number ranges to be highlighted.
|
||||||
* `linenostart=199`: starts the line number count from 199.
|
* `linenostart=199`: starts the line number count from 199.
|
||||||
* `anchorlinenos`: Configure anchors on line numbers. Valid values are `true` or `false`;
|
* `anchorlinenos`: Configure anchors on line numbers. Valid values are `true` or `false`;
|
||||||
* `lineanchors`: Configure a prefix for the anchors on line numbers. Will be suffixed with `-`, so linking to the line number 1 with the option `lineanchors=prefix` adds the anchor `prefix-1` to the page.
|
* `lineanchors`: Configure a prefix for the anchors on line numbers. Will be suffixed with `-`, so linking to the line number 1 with the option `lineanchors=prefix` adds the anchor `prefix-1` to the page.
|
||||||
* `hl_inline` Highlight inside a `<code>` (inline HTML element) tag. Valid values are `true` or `false`. The `code` tag will get a class with name `code-inline`. {{< new-in "0.101.0" >}}
|
* `hl_inline` Highlight inside a `<code>` (inline HTML element) tag. Valid values are `true` or `false`. The `code` tag will get a class with name `code-inline`. {{< new-in "0.101.0" >}}
|
||||||
|
|
||||||
### Example: Highlight Shortcode
|
### Example: highlight shortcode
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{</* highlight go "linenos=table,hl_lines=8 15-17,linenostart=199" */>}}
|
{{</* highlight go "linenos=table,hl_lines=8 15-17,linenostart=199" */>}}
|
||||||
|
@ -76,9 +76,9 @@ func GetTitleFunc(style string) func(s string) string {
|
||||||
}
|
}
|
||||||
{{< / highlight >}}
|
{{< / highlight >}}
|
||||||
|
|
||||||
## Highlight Hugo/GO Template Code
|
## Highlight Hugo/Go template code
|
||||||
|
|
||||||
For highlighting Hugo/GO template code on your page, add `/*` after the opening double curly braces and `*/` before closing curly braces.
|
For highlighting Hugo/Go template code on your page, add `/*` after the opening double curly braces and `*/` before closing curly braces.
|
||||||
|
|
||||||
``` go
|
``` go
|
||||||
{{</*/* myshortcode */*/>}}
|
{{</*/* myshortcode */*/>}}
|
||||||
|
@ -90,11 +90,11 @@ Gives this:
|
||||||
{{</* myshortcode */>}}
|
{{</* myshortcode */>}}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Highlight Template Func
|
## Highlight template function
|
||||||
|
|
||||||
See [Highlight](/functions/highlight/).
|
See [Highlight](/functions/highlight/).
|
||||||
|
|
||||||
## Highlighting in Code Fences
|
## Highlighting in code fences
|
||||||
|
|
||||||
Highlighting in code fences is enabled by default.
|
Highlighting in code fences is enabled by default.
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ func GetTitleFunc(style string) func(s string) string {
|
||||||
|
|
||||||
The options are the same as in the [highlighting shortcode](/content-management/syntax-highlighting/#highlight-shortcode), including `linenos=false`, but note the slightly different Markdown attribute syntax.
|
The options are the same as in the [highlighting shortcode](/content-management/syntax-highlighting/#highlight-shortcode), including `linenos=false`, but note the slightly different Markdown attribute syntax.
|
||||||
|
|
||||||
## List of Chroma Highlighting Languages
|
## List of Chroma highlighting languages
|
||||||
|
|
||||||
The full list of Chroma lexers and their aliases (which is the identifier used in the `highlight` template func or when doing highlighting in code fences):
|
The full list of Chroma lexers and their aliases (which is the identifier used in the `highlight` template func or when doing highlighting in code fences):
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ weight: 150
|
||||||
aliases: [/taxonomies/overview/,/taxonomies/usage/,/indexes/overview/,/doc/indexes/,/extras/indexes]
|
aliases: [/taxonomies/overview/,/taxonomies/usage/,/indexes/overview/,/doc/indexes/,/extras/indexes]
|
||||||
---
|
---
|
||||||
|
|
||||||
## What is a Taxonomy?
|
## What is a taxonomy?
|
||||||
|
|
||||||
Hugo includes support for user-defined groupings of content called **taxonomies**. Taxonomies are classifications of logical relationships between content.
|
Hugo includes support for user-defined groupings of content called **taxonomies**. Taxonomies are classifications of logical relationships between content.
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ Value
|
||||||
: a piece of content assigned to a term
|
: a piece of content assigned to a term
|
||||||
|
|
||||||
|
|
||||||
## Example Taxonomy: Movie Website
|
## Example taxonomy: movie website
|
||||||
|
|
||||||
Let's assume you are making a website about movies. You may want to include the following taxonomies:
|
Let's assume you are making a website about movies. You may want to include the following taxonomies:
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ Let's assume you are making a website about movies. You may want to include the
|
||||||
|
|
||||||
Then, in each of the movies, you would specify terms for each of these taxonomies (i.e., in the [front matter] of each of your movie content files). From these terms, Hugo would automatically create pages for each Actor, Director, Studio, Genre, Year, and Award, with each listing all of the Movies that matched that specific Actor, Director, Studio, Genre, Year, and Award.
|
Then, in each of the movies, you would specify terms for each of these taxonomies (i.e., in the [front matter] of each of your movie content files). From these terms, Hugo would automatically create pages for each Actor, Director, Studio, Genre, Year, and Award, with each listing all of the Movies that matched that specific Actor, Director, Studio, Genre, Year, and Award.
|
||||||
|
|
||||||
### Movie Taxonomy Organization
|
### Movie taxonomy organization
|
||||||
|
|
||||||
To continue with the example of a movie site, the following demonstrates content relationships from the perspective of the taxonomy:
|
To continue with the example of a movie site, the following demonstrates content relationships from the perspective of the taxonomy:
|
||||||
|
|
||||||
|
@ -76,11 +76,11 @@ Moonrise Kingdom <- Value
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
## Hugo Taxonomy Defaults {#default-taxonomies}
|
## Default taxonomies
|
||||||
|
|
||||||
Hugo natively supports taxonomies.
|
Hugo natively supports taxonomies.
|
||||||
|
|
||||||
Without adding a single line to your [site config][config] file, Hugo will automatically create taxonomies for `tags` and `categories`. That would be the same as manually [configuring your taxonomies](#configure-taxonomies) as below:
|
Without adding a single line to your [site configuration] file, Hugo will automatically create taxonomies for `tags` and `categories`. That would be the same as manually [configuring your taxonomies](#configure-taxonomies) as below:
|
||||||
|
|
||||||
{{< code-toggle file="hugo" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
|
@ -88,7 +88,7 @@ Without adding a single line to your [site config][config] file, Hugo will autom
|
||||||
category = "categories"
|
category = "categories"
|
||||||
{{</ code-toggle >}}
|
{{</ code-toggle >}}
|
||||||
|
|
||||||
If you do not want Hugo to create any taxonomies, set `disableKinds` in your [site config][config] to the following:
|
If you do not want Hugo to create any taxonomies, set `disableKinds` in your [site configuration] to the following:
|
||||||
|
|
||||||
{{< code-toggle file="hugo" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
disableKinds = ["taxonomy","term"]
|
disableKinds = ["taxonomy","term"]
|
||||||
|
@ -96,18 +96,18 @@ disableKinds = ["taxonomy","term"]
|
||||||
|
|
||||||
{{% page-kinds %}}
|
{{% page-kinds %}}
|
||||||
|
|
||||||
### Default Destinations
|
### Default destinations
|
||||||
|
|
||||||
When taxonomies are used---and [taxonomy templates] are provided---Hugo will automatically create both a page listing all the taxonomy's terms and individual pages with lists of content associated with each term. For example, a `categories` taxonomy declared in your configuration and used in your content front matter will create the following pages:
|
When taxonomies are used---and [taxonomy templates] are provided---Hugo will automatically create both a page listing all the taxonomy's terms and individual pages with lists of content associated with each term. For example, a `categories` taxonomy declared in your configuration and used in your content front matter will create the following pages:
|
||||||
|
|
||||||
* A single page at `example.com/categories/` that lists all the [terms within the taxonomy]
|
* A single page at `example.com/categories/` that lists all the [terms within the taxonomy]
|
||||||
* [Individual taxonomy list pages][taxonomy templates] (e.g., `/categories/development/`) for each of the terms that shows a listing of all pages marked as part of that taxonomy within any content file's [front matter]
|
* [Individual taxonomy list pages][taxonomy templates] (e.g., `/categories/development/`) for each of the terms that shows a listing of all pages marked as part of that taxonomy within any content file's [front matter]
|
||||||
|
|
||||||
## Configure Taxonomies
|
## Configure taxonomies
|
||||||
|
|
||||||
Custom taxonomies other than the [defaults](#default-taxonomies) must be defined in your [site config][config] before they can be used throughout the site. You need to provide both the plural and singular labels for each taxonomy. For example, `singular key = "plural value"` for TOML and `singular key: "plural value"` for YAML.
|
Custom taxonomies other than the [defaults](#default-taxonomies) must be defined in your [site configuration] before they can be used throughout the site. You need to provide both the plural and singular labels for each taxonomy. For example, `singular key = "plural value"` for TOML and `singular key: "plural value"` for YAML.
|
||||||
|
|
||||||
### Example: Adding a custom taxonomy named "series"
|
### Example: adding a custom taxonomy named "series"
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
While adding custom taxonomies, you need to put in the default taxonomies too, _if you want to keep them_.
|
While adding custom taxonomies, you need to put in the default taxonomies too, _if you want to keep them_.
|
||||||
|
@ -120,9 +120,9 @@ While adding custom taxonomies, you need to put in the default taxonomies too, _
|
||||||
series = "series"
|
series = "series"
|
||||||
{{</ code-toggle >}}
|
{{</ code-toggle >}}
|
||||||
|
|
||||||
### Example: Removing default taxonomies
|
### Example: removing default taxonomies
|
||||||
|
|
||||||
If you want to have just the default `tags` taxonomy, and remove the `categories` taxonomy for your site, you can do so by modifying the `taxonomies` value in your [site config][config].
|
If you want to have just the default `tags` taxonomy, and remove the `categories` taxonomy for your site, you can do so by modifying the `taxonomies` value in your [site configuration].
|
||||||
|
|
||||||
{{< code-toggle file="hugo" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
|
@ -143,7 +143,7 @@ The configuration option `preserveTaxonomyNames` was removed in Hugo 0.55.
|
||||||
You can now use `.Page.Title` on the relevant taxonomy node to get the original value.
|
You can now use `.Page.Title` on the relevant taxonomy node to get the original value.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
## Add Taxonomies to Content
|
## Add taxonomies to content
|
||||||
|
|
||||||
Once a taxonomy is defined at the site level, any piece of content can be assigned to it, regardless of [content type] or [content section].
|
Once a taxonomy is defined at the site level, any piece of content can be assigned to it, regardless of [content type] or [content section].
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ Assigning content to a taxonomy is done in the [front matter]. Simply create a v
|
||||||
If you would like the ability to quickly generate content files with preconfigured taxonomies or terms, read the docs on [Hugo archetypes](/content-management/archetypes/).
|
If you would like the ability to quickly generate content files with preconfigured taxonomies or terms, read the docs on [Hugo archetypes](/content-management/archetypes/).
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
### Example: Front Matter with Taxonomies
|
### Example: front matter with taxonomies
|
||||||
|
|
||||||
{{< code-toggle file="content/example.md" fm=true copy=false >}}
|
{{< code-toggle file="content/example.md" fm=true copy=false >}}
|
||||||
title = "Hugo: A fast and flexible static site generator"
|
title = "Hugo: A fast and flexible static site generator"
|
||||||
|
@ -164,13 +164,13 @@ slug = "hugo"
|
||||||
project_url = "https://github.com/gohugoio/hugo"
|
project_url = "https://github.com/gohugoio/hugo"
|
||||||
{{</ code-toggle >}}
|
{{</ code-toggle >}}
|
||||||
|
|
||||||
## Order Taxonomies
|
## Order taxonomies
|
||||||
|
|
||||||
A content file can assign weight for each of its associate taxonomies. Taxonomic weight can be used for sorting or ordering content in [taxonomy list templates] and is declared in a content file's [front matter]. The convention for declaring taxonomic weight is `taxonomyname_weight`.
|
A content file can assign weight for each of its associate taxonomies. Taxonomic weight can be used for sorting or ordering content in [taxonomy list templates] and is declared in a content file's [front matter]. The convention for declaring taxonomic weight is `taxonomyname_weight`.
|
||||||
|
|
||||||
The following show a piece of content that has a weight of 22, which can be used for ordering purposes when rendering the pages assigned to the "a", "b" and "c" values of the `tags` taxonomy. It has also been assigned the weight of 44 when rendering the "d" category page.
|
The following show a piece of content that has a weight of 22, which can be used for ordering purposes when rendering the pages assigned to the "a", "b" and "c" values of the `tags` taxonomy. It has also been assigned the weight of 44 when rendering the "d" category page.
|
||||||
|
|
||||||
### Example: Taxonomic `weight`
|
### Example: taxonomic `weight`
|
||||||
|
|
||||||
{{< code-toggle copy=false >}}
|
{{< code-toggle copy=false >}}
|
||||||
title = "foo"
|
title = "foo"
|
||||||
|
@ -186,7 +186,7 @@ By using taxonomic weight, the same piece of content can appear in different pos
|
||||||
Currently taxonomies only support the [default `weight => date` ordering of list content](/templates/lists/#default-weight--date--linktitle--filepath). For more information, see the documentation on [taxonomy templates](/templates/taxonomy-templates/).
|
Currently taxonomies only support the [default `weight => date` ordering of list content](/templates/lists/#default-weight--date--linktitle--filepath). For more information, see the documentation on [taxonomy templates](/templates/taxonomy-templates/).
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
## Add custom metadata to a Taxonomy or Term
|
## Add custom metadata to a taxonomy or term
|
||||||
|
|
||||||
If you need to add custom metadata to your taxonomy terms, you will need to create a page for that term at `/content/<TAXONOMY>/<TERM>/_index.md` and add your metadata in its front matter. Continuing with our 'Actors' example, let's say you want to add a Wikipedia page link to each actor. Your terms pages would be something like this:
|
If you need to add custom metadata to your taxonomy terms, you will need to create a page for that term at `/content/<TAXONOMY>/<TERM>/_index.md` and add your metadata in its front matter. Continuing with our 'Actors' example, let's say you want to add a Wikipedia page link to each actor. Your terms pages would be something like this:
|
||||||
|
|
||||||
|
@ -203,4 +203,4 @@ wikipedia: "https://en.wikipedia.org/wiki/Bruce_Willis"
|
||||||
[taxonomy list templates]: /templates/taxonomy-templates/#taxonomy-list-templates
|
[taxonomy list templates]: /templates/taxonomy-templates/#taxonomy-list-templates
|
||||||
[taxonomy templates]: /templates/taxonomy-templates/
|
[taxonomy templates]: /templates/taxonomy-templates/
|
||||||
[terms within the taxonomy]: /templates/taxonomy-templates/#taxonomy-terms-templates "See how to order terms associated with a taxonomy"
|
[terms within the taxonomy]: /templates/taxonomy-templates/#taxonomy-terms-templates "See how to order terms associated with a taxonomy"
|
||||||
[config]: /getting-started/configuration/
|
[configuration]: /getting-started/configuration/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
title: Table of Contents
|
title: Table of contents
|
||||||
description: Hugo can automatically parse Markdown content and create a Table of Contents you can use in your templates.
|
description: Hugo can automatically parse Markdown content and create a Table of Contents you can use in your templates.
|
||||||
categories: [content management]
|
categories: [content management]
|
||||||
keywords: [table of contents, toc]
|
keywords: [table of contents, toc]
|
||||||
|
@ -44,7 +44,7 @@ Hugo will take this Markdown and create a table of contents from `## Introductio
|
||||||
|
|
||||||
The built-in `.TableOfContents` variables outputs a `<nav id="TableOfContents">` element with a child `<ul>`, whose child `<li>` elements begin with appropriate HTML headings. See [the available settings](/getting-started/configuration-markup/#table-of-contents) to configure what heading levels you want to include in TOC.
|
The built-in `.TableOfContents` variables outputs a `<nav id="TableOfContents">` element with a child `<ul>`, whose child `<li>` elements begin with appropriate HTML headings. See [the available settings](/getting-started/configuration-markup/#table-of-contents) to configure what heading levels you want to include in TOC.
|
||||||
|
|
||||||
## Template Example: Basic TOC
|
## Template example: basic TOC
|
||||||
|
|
||||||
The following is an example of a very basic [single page template]:
|
The following is an example of a very basic [single page template]:
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ The following is an example of a very basic [single page template]:
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{< /code >}}
|
{{< /code >}}
|
||||||
|
|
||||||
## Template Example: TOC Partial
|
## Template example: TOC partial
|
||||||
|
|
||||||
The following is a [partial template][partials] that adds slightly more logic for page-level control over your table of contents. It assumes you are using a `toc` field in your content's [front matter] that, unless specifically set to `false`, will add a TOC to any page with a `.WordCount` (see [Page Variables][pagevars]) greater than 400. This example also demonstrates how to use [conditionals] in your templating:
|
The following is a [partial template][partials] that adds slightly more logic for page-level control over your table of contents. It assumes you are using a `toc` field in your content's [front matter] that, unless specifically set to `false`, will add a TOC to any page with a `.WordCount` (see [Page Variables][pagevars]) greater than 400. This example also demonstrates how to use [conditionals] in your templating:
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ In the header of your content file, specify the AsciiDoc TOC directives necessar
|
||||||
```asciidoc
|
```asciidoc
|
||||||
// <!-- Your front matter up here -->
|
// <!-- Your front matter up here -->
|
||||||
:toc:
|
:toc:
|
||||||
// Set toclevels to be at least your hugo [markup.tableOfContents.endLevel] config key
|
// Set toclevels to be at least your hugo [markup.tableOfContents.endLevel] configuration key
|
||||||
:toclevels: 4
|
:toclevels: 4
|
||||||
|
|
||||||
== Introduction
|
== Introduction
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
title: Content Types
|
title: Content types
|
||||||
description: Hugo is built around content organized in sections.
|
description: Hugo is built around content organized in sections.
|
||||||
categories: [content management]
|
categories: [content management]
|
||||||
keywords: [lists, sections, content types, types, organization]
|
keywords: [lists, sections, content types, types, organization]
|
||||||
|
@ -16,5 +16,5 @@ A **content type** is a way to organize your content. Hugo resolves the content
|
||||||
|
|
||||||
A content type is used to
|
A content type is used to
|
||||||
|
|
||||||
- Determine how the content is rendered. See [Template Lookup Order](/templates/lookup-order/) and [Content Views](https://gohugo.io/templates/views) for more.
|
- Determine how the content is rendered. See [Template Lookup Order](/templates/lookup-order/) and [Content Views](/templates/views) for more.
|
||||||
- Determine which [archetype](/content-management/archetypes/) template to use for new content.
|
- Determine which [archetype](/content-management/archetypes/) template to use for new content.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
title: URL Management
|
title: URL management
|
||||||
description: Control the structure and appearance of URLs through front matter entries and settings in your site configuration.
|
description: Control the structure and appearance of URLs through front matter entries and settings in your site configuration.
|
||||||
categories: [content management]
|
categories: [content management]
|
||||||
keywords: [aliases,redirects,permalinks,urls]
|
keywords: [aliases,redirects,permalinks,urls]
|
||||||
|
@ -89,67 +89,149 @@ If you set both `slug` and `url` in front matter, the `url` value takes preceden
|
||||||
|
|
||||||
### Permalinks
|
### Permalinks
|
||||||
|
|
||||||
In your site configuration, set a URL pattern for regular pages within a top-level section. This is recursive, affecting descendant regular pages.
|
In your site configuration, define a URL pattern for each top-level section. Each URL pattern can target a given language and/or [page kind].
|
||||||
|
|
||||||
{{% note %}}
|
Front matter `url` values override the URL patterns defined in the `permalinks` section of your site configuration.
|
||||||
The `permalinks` defined in your site configuration do not apply to section pages. To adjust the URL for section pages, set `url` in front matter.
|
|
||||||
{{% /note %}}
|
|
||||||
|
|
||||||
#### Examples {#permalinks-examples}
|
[page kind]: /templates/section-templates/#page-kinds
|
||||||
|
|
||||||
|
#### Monolingual examples {#permalinks-monolingual-examples}
|
||||||
|
|
||||||
With this content structure:
|
With this content structure:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
content/
|
content/
|
||||||
├── posts/
|
├── posts/
|
||||||
│ ├── _index.md
|
│ ├── bash-in-slow-motion.md
|
||||||
│ ├── post-1.md
|
│ └── tls-in-a-nutshell.md
|
||||||
│ └── post-2.md
|
├── tutorials/
|
||||||
|
│ ├── git-for-beginners.md
|
||||||
|
│ └── javascript-bundling-with-hugo.md
|
||||||
└── _index.md
|
└── _index.md
|
||||||
```
|
```
|
||||||
|
|
||||||
Create a date-based hierarchy, recursively, for regular pages within the `posts` section:
|
Render tutorials under "training", and render the posts under "articles" with a date-base hierarchy:
|
||||||
|
|
||||||
{{< code-toggle file="hugo" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[permalinks]
|
[permalinks.page]
|
||||||
posts = '/posts/:year/:month/:title/'
|
posts = '/articles/:year/:month/:slug/'
|
||||||
|
tutorials = '/training/:slug/'
|
||||||
|
[permalinks.section]
|
||||||
|
posts = '/articles/'
|
||||||
|
tutorials = '/training/'
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
The structure of the published site will be:
|
The structure of the published site will be:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
public/
|
public/
|
||||||
├── posts/
|
├── articles/
|
||||||
│ ├── 2023/
|
│ ├── 2023/
|
||||||
│ │ └── 03/
|
│ │ ├── 04/
|
||||||
│ │ ├── post-1/
|
│ │ │ └── bash-in-slow-motion/
|
||||||
│ │ │ └── index.html
|
│ │ │ └── index.html
|
||||||
│ │ └── post-2/
|
│ │ └── 06/
|
||||||
│ │ └── index.html
|
│ │ └── tls-in-a-nutshell/
|
||||||
│ └── index.html
|
│ │ └── index.html
|
||||||
├── favicon.ico
|
│ └── index.html
|
||||||
|
├── training/
|
||||||
|
│ ├── git-for-beginners/
|
||||||
|
│ │ └── index.html
|
||||||
|
│ ├── javascript-bundling-with-hugo/
|
||||||
|
│ │ └── index.html
|
||||||
|
│ └── index.html
|
||||||
└── index.html
|
└── index.html
|
||||||
```
|
```
|
||||||
|
|
||||||
To create a date-based hierarchy for regular pages in the content root:
|
To create a date-based hierarchy for regular pages in the content root:
|
||||||
|
|
||||||
{{< code-toggle file="hugo" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[permalinks]
|
[permalinks.page]
|
||||||
'/' = '/:year/:month/:title/'
|
"/" = "/:year/:month/:slug/"
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
{{% note %}}
|
Use the same approach with taxonomy terms. For example, to omit the taxonomy segment of the URL:
|
||||||
A URL pattern defined for the content root is not recursive.
|
|
||||||
{{% /note %}}
|
|
||||||
|
|
||||||
Use the same approach with taxonomies. For example, to omit the taxonomy segment of the URL:
|
|
||||||
|
|
||||||
{{< code-toggle file="hugo" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[permalinks]
|
[permalinks.term]
|
||||||
'tags' = '/:title/'
|
'tags' = '/:slug/'
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
Front matter `url` values take precedence over URL patterns defined in `permalinks`.
|
#### Multilingual example {#permalinks-multilingual-example}
|
||||||
|
|
||||||
|
Use the `permalinks` configuration as a component of your localization strategy.
|
||||||
|
|
||||||
|
With this content structure:
|
||||||
|
|
||||||
|
```text
|
||||||
|
content/
|
||||||
|
├── de/
|
||||||
|
│ ├── books/
|
||||||
|
│ │ ├── les-miserables.md
|
||||||
|
│ │ └── the-hunchback-of-notre-dame.md
|
||||||
|
│ └── _index.md
|
||||||
|
└── en/
|
||||||
|
├── books/
|
||||||
|
│ ├── les-miserables.md
|
||||||
|
│ └── the-hunchback-of-notre-dame.md
|
||||||
|
└── _index.md
|
||||||
|
```
|
||||||
|
|
||||||
|
And this site configuration:
|
||||||
|
|
||||||
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
|
defaultContentLanguage = 'en'
|
||||||
|
defaultContentLanguageInSubdir = true
|
||||||
|
|
||||||
|
[languages.en]
|
||||||
|
contentDir = 'content/en'
|
||||||
|
languageCode = 'en-US'
|
||||||
|
languageDirection = 'ltr'
|
||||||
|
languageName = 'English'
|
||||||
|
weight = 1
|
||||||
|
|
||||||
|
[languages.en.permalinks.page]
|
||||||
|
books = "/books/:slug/"
|
||||||
|
|
||||||
|
[languages.en.permalinks.section]
|
||||||
|
books = "/books/"
|
||||||
|
|
||||||
|
[languages.es]
|
||||||
|
contentDir = 'content/de'
|
||||||
|
languageCode = 'es-ES'
|
||||||
|
languageDirection = 'ltr'
|
||||||
|
languageName = 'Español'
|
||||||
|
weight = 2
|
||||||
|
|
||||||
|
[languages.es.permalinks.page]
|
||||||
|
books = "/libros/:slug/"
|
||||||
|
|
||||||
|
[languages.es.permalinks.section]
|
||||||
|
books = "/libros/"
|
||||||
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
|
The structure of the published site will be:
|
||||||
|
|
||||||
|
```text
|
||||||
|
public/
|
||||||
|
├── en/
|
||||||
|
│ ├── books/
|
||||||
|
│ │ ├── les-miserables/
|
||||||
|
│ │ │ └── index.html
|
||||||
|
│ │ ├── the-hunchback-of-notre-dame/
|
||||||
|
│ │ │ └── index.html
|
||||||
|
│ │ └── index.html
|
||||||
|
│ └── index.html
|
||||||
|
├── es/
|
||||||
|
│ ├── libros/
|
||||||
|
│ │ ├── les-miserables/
|
||||||
|
│ │ │ └── index.html
|
||||||
|
│ │ ├── the-hunchback-of-notre-dame/
|
||||||
|
│ │ │ └── index.html
|
||||||
|
│ │ └── index.html
|
||||||
|
│ └── index.html
|
||||||
|
└── index.html
|
||||||
|
````
|
||||||
|
|
||||||
#### Tokens
|
#### Tokens
|
||||||
|
|
||||||
|
@ -189,10 +271,10 @@ Use these tokens when defining the URL pattern. The `date` field in front matter
|
||||||
: the content's slug (or title if no slug is provided in the front matter)
|
: the content's slug (or title if no slug is provided in the front matter)
|
||||||
|
|
||||||
`:slugorfilename`
|
`:slugorfilename`
|
||||||
: the content's slug (or filename if no slug is provided in the front matter)
|
: the content's slug (or file name if no slug is provided in the front matter)
|
||||||
|
|
||||||
`:filename`
|
`:filename`
|
||||||
: the content's filename (without extension)
|
: the content's file name (without extension)
|
||||||
|
|
||||||
For time-related values, you can also use the layout string components defined in Go's [time package]. For example:
|
For time-related values, you can also use the layout string components defined in Go's [time package]. For example:
|
||||||
|
|
||||||
|
@ -301,7 +383,7 @@ In a multilingual site, use a directory-relative alias, or include the language
|
||||||
aliases = ['/de/posts/previous-file-name']
|
aliases = ['/de/posts/previous-file-name']
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
### How Aliases Work
|
### How aliases work
|
||||||
|
|
||||||
Using the first example above, Hugo generates the following site structure:
|
Using the first example above, Hugo generates the following site structure:
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
---
|
---
|
||||||
title: Contribute to the Hugo Project
|
title: Contribute to the Hugo project
|
||||||
linktitle: Contribute to Hugo
|
linkTitle: Overview
|
||||||
description: Contribute to Hugo development and documentation.
|
description: Contribute to Hugo development and documentation.
|
||||||
categories: [contribute]
|
categories: [contribute]
|
||||||
keywords: []
|
keywords: []
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
|
identifier: contribute-overview
|
||||||
parent: contribute
|
parent: contribute
|
||||||
weight: 01
|
weight: 10
|
||||||
weight: 01
|
weight: 10
|
||||||
aliases: [/tutorials/how-to-contribute-to-hugo/,/community/contributing/]
|
aliases: [/tutorials/how-to-contribute-to-hugo/,/community/contributing/]
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
---
|
---
|
||||||
title: Contribute to Hugo Development
|
title: Contribute to development
|
||||||
linktitle: Development
|
linkTitle: Development
|
||||||
description: Hugo relies heavily on contributions from the open source community.
|
description: Hugo relies heavily on contributions from the open source community.
|
||||||
categories: [contribute]
|
categories: [contribute]
|
||||||
keywords: [dev,open source]
|
keywords: [dev,open source]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
parent: contribute
|
parent: contribute
|
||||||
weight: 10
|
weight: 20
|
||||||
weight: 10
|
weight: 20
|
||||||
toc: true
|
toc: true
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ The installation of Go should take only a few minutes. You have more than one op
|
||||||
|
|
||||||
If you are having trouble following the installation guides for Go, check out [Go Bootcamp, which contains setups for every platform][gobootcamp] or reach out to the Hugo community in the [Hugo Discussion Forums][forums].
|
If you are having trouble following the installation guides for Go, check out [Go Bootcamp, which contains setups for every platform][gobootcamp] or reach out to the Hugo community in the [Hugo Discussion Forums][forums].
|
||||||
|
|
||||||
### Install Go From Source
|
### Install Go from source
|
||||||
|
|
||||||
[Download the latest stable version of Go][godl] and follow the official [Go installation guide][goinstall].
|
[Download the latest stable version of Go][godl] and follow the official [Go installation guide][goinstall].
|
||||||
|
|
||||||
|
@ -71,11 +71,11 @@ More experienced users can use the [Go Version Manager][gvm] (GVM). GVM allows y
|
||||||
|
|
||||||
GVM comes in especially handy if you follow the development of Hugo over a longer period of time. Future versions of Hugo will usually be compiled with the latest version of Go. Sooner or later, you will have to upgrade if you want to keep up.
|
GVM comes in especially handy if you follow the development of Hugo over a longer period of time. Future versions of Hugo will usually be compiled with the latest version of Go. Sooner or later, you will have to upgrade if you want to keep up.
|
||||||
|
|
||||||
## Create a GitHub Account
|
## Create a GitHub account
|
||||||
|
|
||||||
If you're going to contribute code, you'll need to have an account on GitHub. Go to [www.github.com/join](https://github.com/join) and set up a personal account.
|
If you're going to contribute code, you'll need to have an account on GitHub. Go to [www.github.com/join](https://github.com/join) and set up a personal account.
|
||||||
|
|
||||||
## Install Git on Your System
|
## Install Git on your system
|
||||||
|
|
||||||
You will need to have Git installed on your computer to contribute to Hugo development. Teaching Git is outside the scope of the Hugo docs, but if you're looking for an excellent reference to learn the basics of Git, we recommend the [Git book][gitbook] if you are not sure where to begin. We will include short explanations of the Git commands in this document.
|
You will need to have Git installed on your computer to contribute to Hugo development. Teaching Git is outside the scope of the Hugo docs, but if you're looking for an excellent reference to learn the basics of Git, we recommend the [Git book][gitbook] if you are not sure where to begin. We will include short explanations of the Git commands in this document.
|
||||||
|
|
||||||
|
@ -87,11 +87,11 @@ Move back to the terminal and check if Git is already installed. Type in `git ve
|
||||||
|
|
||||||
Finally, check again with `git version` if Git was installed successfully.
|
Finally, check again with `git version` if Git was installed successfully.
|
||||||
|
|
||||||
### Git Graphical Front Ends
|
### Git graphical front ends
|
||||||
|
|
||||||
There are several [GUI clients](https://git-scm.com/downloads/guis) that help you to operate Git. Not all are available for all operating systems and maybe differ in their usage. Because of this we will document how to use the command-line, since the commands are the same everywhere.
|
There are several [GUI clients](https://git-scm.com/downloads/guis) that help you to operate Git. Not all are available for all operating systems and maybe differ in their usage. Because of this we will document how to use the command-line, since the commands are the same everywhere.
|
||||||
|
|
||||||
### Install Hub on Your System (Optional)
|
### Install Hub on your system (optional)
|
||||||
|
|
||||||
Hub is a great tool for working with GitHub. The main site for it is [hub.github.com](https://hub.github.com/). Feel free to install this little Git wrapper.
|
Hub is a great tool for working with GitHub. The main site for it is [hub.github.com](https://hub.github.com/). Feel free to install this little Git wrapper.
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ origin https://github.com/gohugoio/hugo (fetch)
|
||||||
origin https://github.com/gohugoio/hugo (push)
|
origin https://github.com/gohugoio/hugo (push)
|
||||||
```
|
```
|
||||||
|
|
||||||
## The Hugo Git Contribution Workflow
|
## The Hugo Git contribution workflow
|
||||||
|
|
||||||
### Create a new branch
|
### Create a new branch
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ git checkout -b <BRANCH-NAME>
|
||||||
|
|
||||||
You can check on which branch you are with `git branch`. You should see a list of all local branches. The current branch is indicated with a little asterisk.
|
You can check on which branch you are with `git branch`. You should see a list of all local branches. The current branch is indicated with a little asterisk.
|
||||||
|
|
||||||
### Contribute to Documentation
|
### Contribute to documentation
|
||||||
|
|
||||||
Perhaps you want to start contributing to the Hugo docs. If so, you can ignore most of the following steps and focus on the `/docs` directory within your newly cloned repository. You can change directories into the Hugo docs using `cd docs`.
|
Perhaps you want to start contributing to the Hugo docs. If so, you can ignore most of the following steps and focus on the `/docs` directory within your newly cloned repository. You can change directories into the Hugo docs using `cd docs`.
|
||||||
|
|
||||||
|
@ -408,7 +408,7 @@ Thank you for reading through this contribution guide. Hopefully, we will see yo
|
||||||
|
|
||||||
Feel free to [open an issue][newissue] if you think you found a bug or you have a new idea to improve Hugo. We are happy to hear from you.
|
Feel free to [open an issue][newissue] if you think you found a bug or you have a new idea to improve Hugo. We are happy to hear from you.
|
||||||
|
|
||||||
## Additional References for Learning Git and Go
|
## Additional references for learning Git and Go
|
||||||
|
|
||||||
* [Codecademy's Free "Learn Git" Course][codecademy] (Free)
|
* [Codecademy's Free "Learn Git" Course][codecademy] (Free)
|
||||||
* [Code School and GitHub's "Try Git" Tutorial][trygit] (Free)
|
* [Code School and GitHub's "Try Git" Tutorial][trygit] (Free)
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
---
|
---
|
||||||
title: Contribute to the Hugo Docs
|
title: Contribute to documentation
|
||||||
linktitle: Documentation
|
linkTitle: Documentation
|
||||||
description: Documentation is an integral part of any open source project. The Hugo documentation is as much a work in progress as the source it attempts to cover.
|
description: Documentation is an integral part of any open source project. The Hugo documentation is as much a work in progress as the source it attempts to cover.
|
||||||
categories: [contribute]
|
categories: [contribute]
|
||||||
keywords: [docs,documentation,community, contribute]
|
keywords: [docs,documentation,community, contribute]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
parent: contribute
|
parent: contribute
|
||||||
weight: 20
|
weight: 30
|
||||||
toc: true
|
toc: true
|
||||||
weight: 20
|
weight: 30
|
||||||
aliases: [/contribute/docs/]
|
aliases: [/contribute/docs/]
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
---
|
---
|
||||||
title: Add Your Hugo Theme to the Showcase
|
title: Add your hugo theme to the showcase
|
||||||
linktitle: Themes
|
linkTitle: Themes
|
||||||
description: If you've built a Hugo theme and want to contribute back to the Hugo Community, share it with us.
|
description: If you've built a Hugo theme and want to contribute back to the Hugo Community, share it with us.
|
||||||
categories: [contribute]
|
categories: [contribute]
|
||||||
keywords: [contribute,themes,design]
|
keywords: [contribute,themes,design]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
parent: contribute
|
parent: contribute
|
||||||
weight: 30
|
weight: 40
|
||||||
weight: 30
|
weight: 40
|
||||||
aliases: [/contribute/theme/]
|
aliases: [/contribute/theme/]
|
||||||
toc: true
|
toc: true
|
||||||
---
|
---
|
||||||
|
@ -17,7 +17,7 @@ A collection of all themes created by the Hugo community, including screenshots
|
||||||
|
|
||||||
Another great site for Hugo themes is [jamstackthemes.dev/](https://jamstackthemes.dev/ssg/hugo/).
|
Another great site for Hugo themes is [jamstackthemes.dev/](https://jamstackthemes.dev/ssg/hugo/).
|
||||||
|
|
||||||
### Add Your Theme to the Repo
|
### Add your theme to the repository
|
||||||
|
|
||||||
In order to add your Hugo theme to [themes.gohugo.io] please [open a pull request in the theme repository](https://github.com/gohugoio/hugoThemesSiteBuilder). **Please make sure that you've read the theme submission guidelines in the [README](https://github.com/gohugoio/hugoThemesSiteBuilder/blob/main/README.md#hugo-themes) of the hugoThemesSiteBuilder repository.**
|
In order to add your Hugo theme to [themes.gohugo.io] please [open a pull request in the theme repository](https://github.com/gohugoio/hugoThemesSiteBuilder). **Please make sure that you've read the theme submission guidelines in the [README](https://github.com/gohugoio/hugoThemesSiteBuilder/blob/main/README.md#hugo-themes) of the hugoThemesSiteBuilder repository.**
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
---
|
---
|
||||||
title: Hugo Documentation
|
title: Hugo Documentation
|
||||||
linktitle: Hugo
|
linkTitle: Hugo
|
||||||
description: Hugo is the world's fastest static website engine. It's written in Go (aka Golang) and developed by bep, spf13 and friends.
|
description: Hugo is the world's fastest static website engine. It's written in Go (aka Golang) and developed by bep, spf13 and friends.
|
||||||
menu:
|
menu:
|
||||||
main:
|
main:
|
||||||
weight: 01
|
weight: 1
|
||||||
weight: 01
|
weight: 1
|
||||||
layout: documentation-home
|
layout: documentation-home
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
@ -37,15 +37,15 @@ And since `Page` also provides a `.GetPage` method, the above is the same as:
|
||||||
{{ end }}
|
{{ end }}
|
||||||
```
|
```
|
||||||
|
|
||||||
## .GetPage and Multilingual Sites
|
## .GetPage and multilingual sites
|
||||||
|
|
||||||
The previous examples have used the full content filename to look up the post. Depending on how you have organized your content (whether you have the language code in the file name or not, e.g. `my-post.en.md`), you may want to do the lookup without extension. This will get you the current language's version of the page:
|
The previous examples have used the full content file name to look up the post. Depending on how you have organized your content (whether you have the language code in the file name or not, e.g. `my-post.en.md`), you may want to do the lookup without extension. This will get you the current language's version of the page:
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ with .Site.GetPage "/blog/my-post" }}{{ .Title }}{{ end }}
|
{{ with .Site.GetPage "/blog/my-post" }}{{ .Title }}{{ end }}
|
||||||
```
|
```
|
||||||
|
|
||||||
## .GetPage Example
|
## .GetPage example
|
||||||
|
|
||||||
This code snippet---in the form of a [partial template][partials]---allows you to do the following:
|
This code snippet---in the form of a [partial template][partials]---allows you to do the following:
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ This code snippet---in the form of a [partial template][partials]---allows you t
|
||||||
</ul>
|
</ul>
|
||||||
{{< /code >}}
|
{{< /code >}}
|
||||||
|
|
||||||
## `.GetPage` on Page Bundles
|
## `.GetPage` on page bundles
|
||||||
|
|
||||||
If the page retrieved by `.GetPage` is a [Leaf Bundle][leaf_bundle], and you
|
If the page retrieved by `.GetPage` is a [Leaf Bundle][leaf_bundle], and you
|
||||||
need to get the nested _**page** resources_ in that, you will need to use the
|
need to get the nested _**page** resources_ in that, you will need to use the
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
---
|
---
|
||||||
title: Functions Quick Reference
|
title: Functions
|
||||||
|
linkTitle: Overview
|
||||||
description: Comprehensive list of Hugo templating functions, including basic and advanced usage examples.
|
description: Comprehensive list of Hugo templating functions, including basic and advanced usage examples.
|
||||||
keywords: []
|
keywords: []
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
|
identifier: functions-overview
|
||||||
parent: functions
|
parent: functions
|
||||||
weight: 01
|
weight: 10
|
||||||
|
weight: 10
|
||||||
aliases: [/layout/functions/,/templates/functions]
|
aliases: [/layout/functions/,/templates/functions]
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ The following shows `after` being used in conjunction with the [`slice` function
|
||||||
→ ["three", "four"]
|
→ ["three", "four"]
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example of `after` with `first`: 2nd–4th Most Recent Articles
|
## Example of `after` with `first`: 2nd–4th most recent articles
|
||||||
|
|
||||||
You can use `after` in combination with the [`first` function] and Hugo's [powerful sorting methods][lists]. Let's assume you have a list page at `example.com/articles`. You have 10 articles, but you want your templating for the [list/section page] to show only two rows:
|
You can use `after` in combination with the [`first` function] and Hugo's [powerful sorting methods][lists]. Let's assume you have a list page at `example.com/articles`. You have 10 articles, but you want your templating for the [list/section page] to show only two rows:
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
title: anchorize
|
title: anchorize
|
||||||
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.
|
description: Takes a string and sanitizes it the same way as the [`defaultMarkdownHandler`](/getting-started/configuration-markup#configure-markup) does for markdown headers.
|
||||||
categories: [functions]
|
categories: [functions]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
|
@ -10,7 +10,7 @@ signature: ["anchorize INPUT"]
|
||||||
relatedfuncs: [humanize]
|
relatedfuncs: [humanize]
|
||||||
---
|
---
|
||||||
|
|
||||||
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 [Goldmark](/getting-started/configuration-markup#goldmark) is set as `defaultMarkdownHandler`, the sanitizing logic adheres to the setting [`markup.goldmark.parser.autoHeadingIDType`](/getting-started/configuration-markup#goldmark).
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
title: apply
|
title: apply
|
||||||
description: Given a map, array, or slice, `apply` returns a new slice with a function applied over it.
|
description: Given an array or slice, `apply` returns a new slice with a function applied over it.
|
||||||
categories: [functions]
|
categories: [functions]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
|
|
|
@ -18,7 +18,7 @@ Note that the `key` can be either a `string` or a `string slice`. The latter is
|
||||||
{{ $m := dict (slice "a" "b" "c") "value" }}
|
{{ $m := dict (slice "a" "b" "c") "value" }}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example: Using `dict` to pass multiple values to a `partial`
|
## Example: using `dict` to pass multiple values to a `partial`
|
||||||
|
|
||||||
The partial below creates an SVG and expects `fill`, `height` and `width` from the caller:
|
The partial below creates an SVG and expects `fill`, `height` and `width` from the caller:
|
||||||
|
|
||||||
|
|
|
@ -14,12 +14,12 @@ relatedfuncs: []
|
||||||
|
|
||||||
See the [Emoji cheat sheet][emojis] for available emoticons.
|
See the [Emoji cheat sheet][emojis] for available emoticons.
|
||||||
|
|
||||||
The `emojify` function can be called in your templates but not directly in your content files by default. For emojis in content files, set `enableEmoji` to `true` in your site's [configuration][config]. Then you can write emoji shorthand directly into your content files; e.g. <code>I :</code><code>heart</code><code>: Hugo!</code>:
|
The `emojify` function can be called in your templates but not directly in your content files by default. For emojis in content files, set `enableEmoji` to `true` in your site's [configuration]. Then you can write emoji shorthand directly into your content files; e.g. <code>I :</code><code>heart</code><code>: Hugo!</code>:
|
||||||
|
|
||||||
I :heart: Hugo!
|
I :heart: Hugo!
|
||||||
|
|
||||||
|
|
||||||
[config]: /getting-started/configuration/
|
[configuration]: /getting-started/configuration/
|
||||||
[emojis]: https://www.webfx.com/tools/emoji-cheat-sheet/
|
[emojis]: https://www.webfx.com/tools/emoji-cheat-sheet/
|
||||||
[sc]: /templates/shortcode-templates/
|
[sc]: /templates/shortcode-templates/
|
||||||
[scsource]: https://github.com/gohugoio/hugo/tree/master/docs/layouts/shortcodes
|
[scsource]: https://github.com/gohugoio/hugo/tree/master/docs/layouts/shortcodes
|
||||||
|
|
|
@ -40,6 +40,6 @@ This will produce:
|
||||||
|
|
||||||
```
|
```
|
||||||
ERROR 2021/06/07 17:47:38 You should consider fixing this.
|
ERROR 2021/06/07 17:47:38 You should consider fixing this.
|
||||||
If you feel that this should not be logged as an ERROR, you can ignore it by adding this to your site config:
|
If you feel that this should not be logged as an ERROR, you can ignore it by adding this to your site configuration:
|
||||||
ignoreErrors = ["my-custom-error"]
|
ignoreErrors = ["my-custom-error"]
|
||||||
```
|
```
|
||||||
|
|
|
@ -25,7 +25,7 @@ Assuming a key-value of `date: 2017-03-03` in a content file's front matter, you
|
||||||
|
|
||||||
For formatting *any* string representations of dates defined in your front matter, see the [`dateFormat` function][dateFormat], which will still leverage the Go layout string explained below but uses a slightly different syntax.
|
For formatting *any* string representations of dates defined in your front matter, see the [`dateFormat` function][dateFormat], which will still leverage the Go layout string explained below but uses a slightly different syntax.
|
||||||
|
|
||||||
## Go's Layout String
|
## Go's layout string
|
||||||
|
|
||||||
Hugo templates [format your dates][time] via layout strings that point to a specific reference time:
|
Hugo templates [format your dates][time] via layout strings that point to a specific reference time:
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ Here is a visual explanation [taken directly from the Go docs][gdex]:
|
||||||
=> 1 2 3 4 5 6 -7
|
=> 1 2 3 4 5 6 -7
|
||||||
```
|
```
|
||||||
|
|
||||||
### Hugo Date and Time Templating Reference
|
### Hugo date and time templating reference
|
||||||
|
|
||||||
The following examples show the layout string followed by the rendered output.
|
The following examples show the layout string followed by the rendered output.
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ date: 2017-03-03T14:15:59-06:00
|
||||||
|
|
||||||
More examples can be found in Go's [documentation for the time package][timeconst].
|
More examples can be found in Go's [documentation for the time package][timeconst].
|
||||||
|
|
||||||
### Cardinal Numbers and Ordinal Abbreviations
|
### Cardinal s
|
||||||
|
|
||||||
Spelled-out cardinal numbers (e.g. "one", "two", and "three") are not currently supported.
|
Spelled-out cardinal numbers (e.g. "one", "two", and "three") are not currently supported.
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
---
|
---
|
||||||
title: hasprefix
|
title: hasprefix
|
||||||
linktitle: hasPrefix
|
|
||||||
description: Tests whether a string begins with prefix.
|
description: Tests whether a string begins with prefix.
|
||||||
date: 2017-02-01
|
date: 2017-02-01
|
||||||
publishdate: 2017-02-01
|
publishdate: 2017-02-01
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
title: hassuffix
|
title: hassuffix
|
||||||
linktitle: hasSuffix
|
linkTitle: hasSuffix
|
||||||
description: Tests whether a string ends with suffix.
|
description: Tests whether a string ends with suffix.
|
||||||
date: 2023-03-01
|
date: 2023-03-01
|
||||||
publishdate: 2023-03-01
|
publishdate: 2023-03-01
|
||||||
|
@ -18,4 +18,4 @@ deprecated: false
|
||||||
aliases: []
|
aliases: []
|
||||||
---
|
---
|
||||||
|
|
||||||
* `{{ hasSuffix "Hugo" "go" }}` → true
|
* `{{ hasSuffix "Hugo" "go" }}` → true
|
||||||
|
|
|
@ -91,8 +91,8 @@ Instead of specifying both `lineNos` and `lineNumbersInTable`, you can use the f
|
||||||
|
|
||||||
{{ $input := `echo "Hello World!"` }}
|
{{ $input := `echo "Hello World!"` }}
|
||||||
{{ $lang := "bash" }}
|
{{ $lang := "bash" }}
|
||||||
{{ $options := slice "lineNos=table" "style=dracula" }}
|
{{ $options := dict "lineNos" "table" "style" "dracula" }}
|
||||||
{{ transform.Highlight $input $lang (delimit $options ",") }}
|
{{ transform.Highlight $input $lang $options }}
|
||||||
```
|
```
|
||||||
|
|
||||||
[Chroma]: https://github.com/alecthomas/chroma
|
[Chroma]: https://github.com/alecthomas/chroma
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
title: Image Filters
|
title: Image filters
|
||||||
description: The images namespace provides a list of filters and other image related functions.
|
description: The images namespace provides a list of filters and other image related functions.
|
||||||
categories: [functions]
|
categories: [functions]
|
||||||
aliases: [/functions/imageconfig/]
|
aliases: [/functions/imageconfig/]
|
||||||
|
|
|
@ -37,7 +37,7 @@ You may write multiple indices as a slice:
|
||||||
{{ index $map $slice }} => 20
|
{{ index $map $slice }} => 20
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example: Load Data from a Path Based on Front Matter Params
|
## Example: load data from a path based on front matter parameters
|
||||||
|
|
||||||
Assume you want to add a `location = ""` field to your front matter for every article written in `content/vacations/`. You want to use this field to populate information about the location at the bottom of the article in your `single.html` template. You also have a directory in `data/locations/` that looks like the following:
|
Assume you want to add a `location = ""` field to your front matter for every article written in `content/vacations/`. You want to use this field to populate information about the location at the bottom of the article in your `single.html` template. You also have a directory in `data/locations/` that looks like the following:
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue