mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Squashed 'docs/' changes from 9be494de3..ac2c4a487
ac2c4a487 Update documentation for Ugly URLs (#1082) 88bdec17a Change 072.0 to 0.72.0 in release post's description 2aa7d7818 Update rss.md (#1104) c80677aeb Update quick-start.md (#1076) d04196bbd Minor spelling and capitalization fixes 837d2feba Fixed spelling mistake 67dc78e12 Update installing.md ce280c5d6 Update relurl.md bb4d0e703 Capitalization and Redirecting URL fixes e1fecada0 Update partials.md 1d99bb182 Typos and whitespacing issues fixed b20dba125 actually fix index function link this time f47d6f1e3 Fixing typos, whitespace issues and links dc82309b9 fix link to the index function 1eab0cbea add missing word (#1130) 9c3ee62ae more fixes e9bc5880a whitespace, typos and HTTPS fixes 93b806493 Add missing word to Module section 80ced9062 Display image on page bundles page. 727029b0a Update index.md 51fc48e4d Release 0.72.0 1ff68ac3b releaser: Add release notes to /docs for release of 0.72.0 f74a25b92 common/maps: Add Scratch.Values 2fd83db96 Add redirect support to the server bdfccf9f4 Fix typo in install instructions e12737ea6 Create SUPPORT.md git-subtree-dir: docs git-subtree-split: ac2c4a4871e90ddfb180f23704ce7ec9023529ca
This commit is contained in:
parent
9e1dcefc5f
commit
efa74c5c6e
76 changed files with 170 additions and 154 deletions
3
.github/SUPPORT.md
vendored
Normal file
3
.github/SUPPORT.md
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
### 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.
|
|
@ -28,7 +28,7 @@ This has many benefits. The most noticeable is performance. HTTP servers are *ve
|
||||||
## 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]
|
||||||
* ["Static Site Generators", O'Reilly][]
|
* ["Static Site Generators", O'Reilly][]
|
||||||
* [StaticGen: Top Open-Source Static Site Generators (GitHub Stars)][]
|
* [StaticGen: Top Open-Source Static Site Generators (GitHub Stars)][]
|
||||||
* ["Top 10 Static Website Generators", Netlify blog][]
|
* ["Top 10 Static Website Generators", Netlify blog][]
|
||||||
|
|
|
@ -44,7 +44,7 @@ toc: true
|
||||||
* Automatic and user defined [content summaries][]
|
* Automatic and user defined [content summaries][]
|
||||||
* [Shortcodes][] to enable rich content inside of Markdown
|
* [Shortcodes][] to enable rich content inside of Markdown
|
||||||
* ["Minutes to Read"][pagevars] functionality
|
* ["Minutes to Read"][pagevars] functionality
|
||||||
* ["Wordcount"][pagevars] functionality
|
* ["WordCount"][pagevars] functionality
|
||||||
|
|
||||||
## Additional Features
|
## Additional Features
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
title: Hugo and the General Data Protection Regulation (GDPR)
|
title: Hugo and the General Data Protection Regulation (GDPR)
|
||||||
linktitle: Hugo and GDPR
|
linktitle: Hugo and GDPR
|
||||||
|
@ -98,7 +96,7 @@ useSessionStorage
|
||||||
simple
|
simple
|
||||||
: If simple mode is enabled, a static and no-JS version of the Instagram image card will be built. Note that this only supports image cards and the image itself will be fetched from Instagram's servers.
|
: If simple mode is enabled, a static and no-JS version of the Instagram image card will be built. Note that this only supports image cards and the image itself will be fetched from Instagram's servers.
|
||||||
|
|
||||||
**Note:** If you use the _simple mode_ for Instagram and a site styled with Bootstrap 4, you may want to disable the inlines styles provided by Hugo:
|
**Note:** If you use the _simple mode_ for Instagram and a site styled with Bootstrap 4, you may want to disable the inline styles provided by Hugo:
|
||||||
|
|
||||||
{{< code-toggle file="config">}}
|
{{< code-toggle file="config">}}
|
||||||
[services]
|
[services]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
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.
|
||||||
date: 2019-10-01
|
date: 2019-10-01
|
||||||
layout: single
|
layout: single
|
||||||
keywords: ["Security", "Privacy"]
|
keywords: ["Security", "Privacy"]
|
||||||
|
@ -19,7 +19,7 @@ toc: true
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
But when developing and building your site, the runtime is the `hugo` executable. Securing a runtime can be [a real challenge](https://blog.logrocket.com/how-to-protect-your-node-js-applications-from-malicious-dependencies-5f2e60ea08f9/).
|
But when developing and building your site, the runtime is the `hugo` executable. Securing a runtime can be [a real challenge](https://blog.logrocket.com/how-to-protect-your-node-js-applications-from-malicious-dependencies-5f2e60ea08f9/).
|
||||||
|
|
||||||
**Hugo's main approach is that of sandboxing:**
|
**Hugo's main approach is that of sandboxing:**
|
||||||
|
|
||||||
|
|
|
@ -39,9 +39,7 @@ Hugo is for people who want to hand code their own website without worrying abou
|
||||||
|
|
||||||
Hugo is for people building a blog, a company site, a portfolio site, documentation, a single landing page, or a website with thousands of pages.
|
Hugo is for people building a blog, a company site, a portfolio site, documentation, a single landing page, or a website with thousands of pages.
|
||||||
|
|
||||||
|
[@spf13]: https://twitter.com/spf13
|
||||||
|
|
||||||
[@spf13]: https://twitter.com/@spf13
|
|
||||||
[Aerobatic]: https://www.aerobatic.com/
|
[Aerobatic]: https://www.aerobatic.com/
|
||||||
[Amazon S3]: https://aws.amazon.com/s3/
|
[Amazon S3]: https://aws.amazon.com/s3/
|
||||||
[Azure]: https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website
|
[Azure]: https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website
|
||||||
|
@ -51,7 +49,7 @@ Hugo is for people building a blog, a company site, a portfolio site, documentat
|
||||||
[GitHub Pages]: https://pages.github.com/
|
[GitHub Pages]: https://pages.github.com/
|
||||||
[GitLab Pages]: https://about.gitlab.com/features/pages/
|
[GitLab Pages]: https://about.gitlab.com/features/pages/
|
||||||
[Go language]: https://golang.org/
|
[Go language]: https://golang.org/
|
||||||
[GoDaddy]: https://www.godaddy.com/ "Godaddy.com Hosting"
|
[GoDaddy]: https://www.godaddy.com/ "GoDaddy.com Hosting"
|
||||||
[Google Cloud Storage]: https://cloud.google.com/storage/
|
[Google Cloud Storage]: https://cloud.google.com/storage/
|
||||||
[Heroku]: https://www.heroku.com/
|
[Heroku]: https://www.heroku.com/
|
||||||
[Jekyll]: https://jekyllrb.com/
|
[Jekyll]: https://jekyllrb.com/
|
||||||
|
@ -61,5 +59,5 @@ Hugo is for people building a blog, a company site, a portfolio site, documentat
|
||||||
[Rackspace]: https://www.rackspace.com/cloud/files
|
[Rackspace]: https://www.rackspace.com/cloud/files
|
||||||
[Surge]: https://surge.sh
|
[Surge]: https://surge.sh
|
||||||
[contributing to it]: https://github.com/gohugoio/hugo
|
[contributing to it]: https://github.com/gohugoio/hugo
|
||||||
[rackspace]: https://www.rackspace.com/cloud/files
|
[rackspace]: https://www.rackspace.com/openstack/public/files
|
||||||
[static site generator]: /about/benefits/
|
[static site generator]: /about/benefits/
|
||||||
|
|
|
@ -15,7 +15,7 @@ hugo is the main command, used to build your Hugo site.
|
||||||
Hugo is a Fast and Flexible Static Site Generator
|
Hugo is a Fast and Flexible Static Site Generator
|
||||||
built with love by spf13 and friends in Go.
|
built with love by spf13 and friends in Go.
|
||||||
|
|
||||||
Complete documentation is available at http://gohugo.io/.
|
Complete documentation is available at https://gohugo.io/.
|
||||||
|
|
||||||
```
|
```
|
||||||
hugo [flags]
|
hugo [flags]
|
||||||
|
|
|
@ -15,7 +15,6 @@ Delete the Hugo Module cache for the current project.
|
||||||
Note that after you run this command, all of your dependencies will be re-downloaded next time you run "hugo".
|
Note that after you run this command, all of your dependencies will be re-downloaded next time you run "hugo".
|
||||||
|
|
||||||
Also note that if you configure a positive maxAge for the "modules" file cache, it will also be cleaned as part of "hugo --gc".
|
Also note that if you configure a positive maxAge for the "modules" file cache, it will also be cleaned as part of "hugo --gc".
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -18,7 +18,7 @@ Some examples:
|
||||||
Install the latest version possible for a given module:
|
Install the latest version possible for a given module:
|
||||||
|
|
||||||
hugo mod get github.com/gohugoio/testshortcodes
|
hugo mod get github.com/gohugoio/testshortcodes
|
||||||
|
|
||||||
Install a specific version:
|
Install a specific version:
|
||||||
|
|
||||||
hugo mod get github.com/gohugoio/testshortcodes@v0.3.0
|
hugo mod get github.com/gohugoio/testshortcodes@v0.3.0
|
||||||
|
|
|
@ -18,8 +18,6 @@ toc: true
|
||||||
comments: Before this page is published, need to also update both site- and page-level variables documentation.
|
comments: Before this page is published, need to also update both site- and page-level variables documentation.
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Larger sites often have multiple content authors. Hugo provides standardized author profiles to organize relationships between content and content creators for sites operating under a distributed authorship model.
|
Larger sites often have multiple content authors. Hugo provides standardized author profiles to organize relationships between content and content creators for sites operating under a distributed authorship model.
|
||||||
|
|
||||||
## Author Profiles
|
## Author Profiles
|
||||||
|
@ -107,7 +105,7 @@ You can find a list of all template variables to access the profile information
|
||||||
|
|
||||||
### Link Social Network Accounts
|
### Link Social Network Accounts
|
||||||
|
|
||||||
As aforementioned, Hugo is able to generate links to profiles of the most popular social networks. The following social networks with their corresponding identifiers are supported: `github`, `facebook`, `twitter`, `pinterest`, `instagram`, `youtube` and `linkedin`.
|
As aforementioned, Hugo is able to generate links to profiles of the most popular social networks. The following social networks with their corresponding identifiers are supported: `github`, `facebook`, `twitter`, `pinterest`, `instagram`, `youtube` and `linkedin`.
|
||||||
|
|
||||||
This is can be done with the `.Social.URL` function. Its only parameter is the name of the social network as they are defined in the profile (e.g. `facebook`, `twitter`). Custom variables like `website` remain as they are.
|
This is can be done with the `.Social.URL` function. Its only parameter is the name of the social network as they are defined in the profile (e.g. `facebook`, `twitter`). Custom variables like `website` remain as they are.
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ 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 incldued 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`, `$page.Pages`.
|
: The page will be included in all page collections, e.g. `site.RegularPages`, `$page.Pages`.
|
||||||
|
|
|
@ -56,7 +56,7 @@ There are a few alternatives to commenting on static sites for those who do not
|
||||||
* [IntenseDebate](https://intensedebate.com/)
|
* [IntenseDebate](https://intensedebate.com/)
|
||||||
* [Graph Comment][]
|
* [Graph Comment][]
|
||||||
* [Muut](https://muut.com/)
|
* [Muut](https://muut.com/)
|
||||||
* [isso](https://posativ.org/isso/) (Self-hosted, Python)
|
* [Isso](https://posativ.org/isso/) (Self-hosted, Python)
|
||||||
* [Tutorial on Implementing Isso with Hugo][issotutorial]
|
* [Tutorial on Implementing Isso with Hugo][issotutorial]
|
||||||
* [Utterances](https://utteranc.es/) (Open source, GitHub comments widget built on GitHub issues)
|
* [Utterances](https://utteranc.es/) (Open source, GitHub comments widget built on GitHub issues)
|
||||||
* [Remark](https://github.com/umputun/remark) (Open source, Golang, Easy to run docker)
|
* [Remark](https://github.com/umputun/remark) (Open source, Golang, Easy to run docker)
|
||||||
|
|
|
@ -98,7 +98,7 @@ Sometimes it can be useful to create the filter chain once and then reuse it:
|
||||||
|
|
||||||
Provides an [Exif](https://en.wikipedia.org/wiki/Exif) object with metadata about the image.
|
Provides an [Exif](https://en.wikipedia.org/wiki/Exif) object with metadata about the image.
|
||||||
|
|
||||||
Note that this is only suported for JPEG and TIFF images, so it's recommended to wrap the access with a `with`, e.g.:
|
Note that this is only supported for JPEG and TIFF images, so it's recommended to wrap the access with a `with`, e.g.:
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ with $img.Exif }}
|
{{ with $img.Exif }}
|
||||||
|
|
|
@ -63,7 +63,7 @@ When working with front matter `Params` in [single page templates][singles], omi
|
||||||
|
|
||||||
`defaultContentLanguage` sets the project's default language. If not set, the default language will be `en`.
|
`defaultContentLanguage` sets the project's default language. If not set, the default language will be `en`.
|
||||||
|
|
||||||
If the default language needs to be rendererd below its own language code (`/en`) like the others, set `defaultContentLanguageInSubdir: true`.
|
If the default language needs to be rendered below its own language code (`/en`) like the others, set `defaultContentLanguageInSubdir: true`.
|
||||||
|
|
||||||
Only the obvious non-global options can be overridden per language. Examples of global options are `baseURL`, `buildDrafts`, etc.
|
Only the obvious non-global options can be overridden per language. Examples of global options are `baseURL`, `buildDrafts`, etc.
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ public
|
||||||
|
|
||||||
**All URLs (i.e `.Permalink` etc.) will be generated from that root. So the English home page above will have its `.Permalink` set to `https://example.com/`.**
|
**All URLs (i.e `.Permalink` etc.) will be generated from that root. So the English home page above will have its `.Permalink` set to `https://example.com/`.**
|
||||||
|
|
||||||
When you run `hugo server` we will start multiple HTTP servers. You will typlically see something like this in the console:
|
When you run `hugo server` we will start multiple HTTP servers. You will typically see something like this in the console:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
Web Server is available at 127.0.0.1:1313 (bind address 127.0.0.1)
|
Web Server is available at 127.0.0.1:1313 (bind address 127.0.0.1)
|
||||||
|
@ -204,7 +204,7 @@ languages:
|
||||||
|
|
||||||
The value of `contentDir` can be any valid path -- even absolute path references. The only restriction is that the content directories cannot overlap.
|
The value of `contentDir` can be any valid path -- even absolute path references. The only restriction is that the content directories cannot overlap.
|
||||||
|
|
||||||
Considering the following example in conjunction with the configuration above:
|
Considering the following example in conjunction with the configuration above:
|
||||||
|
|
||||||
1. `/content/english/about.md`
|
1. `/content/english/about.md`
|
||||||
2. `/content/french/about.md`
|
2. `/content/french/about.md`
|
||||||
|
|
|
@ -23,9 +23,9 @@ Hugo `0.32` announced page-relative images and other resources packaged into `Pa
|
||||||
|
|
||||||
These terms are connected, and you also need to read about [Page Resources]({{< relref "/content-management/page-resources" >}}) and [Image Processing]({{< relref "/content-management/image-processing" >}}) to get the full picture.
|
These terms are connected, and you also need to read about [Page Resources]({{< relref "/content-management/page-resources" >}}) and [Image Processing]({{< relref "/content-management/image-processing" >}}) to get the full picture.
|
||||||
|
|
||||||
{{% imgproc 1-featured Resize "300x" %}}
|
{{< imgproc 1-featured Resize "300x" >}}
|
||||||
The illustration shows 3 bundles. Note that the home page bundle cannot contain other content pages, but other files (images etc.) are fine.
|
The illustration shows 3 bundles. Note that the home page bundle cannot contain other content pages, but other files (images etc.) are fine.
|
||||||
{{% /imgproc %}}
|
{{< /imgproc >}}
|
||||||
|
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
|
@ -112,7 +112,7 @@ Single content files in each of your sections are going to be rendered as [singl
|
||||||
content/posts/my-first-hugo-post.md
|
content/posts/my-first-hugo-post.md
|
||||||
```
|
```
|
||||||
|
|
||||||
At the time Hugo builds your site, the content will be output to the following destination:
|
When Hugo builds your site, the content will be outputted to the following destination:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,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](http://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).
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
Resources of type `page` get `Title` etc. from their own front matter.
|
Resources of type `page` get `Title` etc. from their own front matter.
|
||||||
|
|
|
@ -21,7 +21,7 @@ toc: true
|
||||||
|
|
||||||
## 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 `<iframes>`) 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.
|
||||||
|
|
||||||
Hugo created **shortcodes** to circumvent these limitations.
|
Hugo created **shortcodes** to circumvent these limitations.
|
||||||
|
|
||||||
|
@ -418,7 +418,7 @@ To learn more about creating custom shortcodes, see the [shortcode template docu
|
||||||
[`figure` shortcode]: #figure
|
[`figure` shortcode]: #figure
|
||||||
[contentmanagementsection]: /content-management/formats/
|
[contentmanagementsection]: /content-management/formats/
|
||||||
[examplegist]: https://gist.github.com/spf13/7896402
|
[examplegist]: https://gist.github.com/spf13/7896402
|
||||||
[figureelement]: http://html5doctor.com/the-figure-figcaption-elements/ "An article from HTML5 doctor discussing the fig and figcaption elements."
|
[figureelement]: https://html5doctor.com/the-figure-figcaption-elements/ "An article from HTML5 doctor discussing the fig and figcaption elements."
|
||||||
[Hugo and the GDPR]: /about/hugo-and-gdpr/
|
[Hugo and the GDPR]: /about/hugo-and-gdpr/
|
||||||
[Instagram]: https://www.instagram.com/
|
[Instagram]: https://www.instagram.com/
|
||||||
[pagevariables]: /variables/page/
|
[pagevariables]: /variables/page/
|
||||||
|
|
|
@ -209,7 +209,7 @@ content/posts/post-1.md
|
||||||
|
|
||||||
## Ugly URLs
|
## Ugly URLs
|
||||||
|
|
||||||
If you would like to have what are often referred to as "ugly URLs" (e.g., example.com/urls.html), set `uglyurls = true` or `uglyurls: true` in your site's `config.toml` or `config.yaml`, respectively. You can also use the `--uglyURLs=true` [flag from the command line][usage] with `hugo` or `hugo server`.
|
If you would like to have what are often referred to as "ugly URLs" (e.g., example.com/urls.html), set `uglyurls = true` or `uglyurls: true` in your site's `config.toml` or `config.yaml`, respectively. You can also set the `HUGO_UGLYURLS` environment variable to `true` when running `hugo` or `hugo server`.
|
||||||
|
|
||||||
If you want a specific piece of content to have an exact URL, you can specify this in the [front matter][] under the `url` key. The following are examples of the same content directory and what the eventual URL structure will be when Hugo runs with its default behavior.
|
If you want a specific piece of content to have an exact URL, you can specify this in the [front matter][] under the `url` key. The following are examples of the same content directory and what the eventual URL structure will be when Hugo runs with its default behavior.
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ aliases: []
|
||||||
toc: false
|
toc: false
|
||||||
layout: documentation-home
|
layout: documentation-home
|
||||||
---
|
---
|
||||||
Hugo is the **world's fastest static website engine.** It's written in Go (aka Golang) and developed by [bep](https://github.com/bep), [spf13](https://github.com/spf13) and [friends](https://github.com/gohugoio/hugo/graphs/contributors).
|
|
||||||
|
Hugo is the **world's fastest static website engine.** It's written in Go (aka Golang) and developed by [bep](https://github.com/bep), [spf13](https://github.com/spf13) and [friends](https://github.com/gohugoio/hugo/graphs/contributors).
|
||||||
|
|
||||||
Below you will find some of the most common and helpful pages from our documentation.
|
Below you will find some of the most common and helpful pages from our documentation.
|
||||||
|
|
|
@ -18,8 +18,7 @@ deprecated: false
|
||||||
aliases: []
|
aliases: []
|
||||||
---
|
---
|
||||||
|
|
||||||
|
By default all matches will be included. The number of matches can be limited with an optional third parameter.
|
||||||
By default all matches will be included. The number of matches can be limitted with an optional third parameter.
|
|
||||||
|
|
||||||
The example below returns a list of all second level headers (`<h2>`) in the content:
|
The example below returns a list of all second level headers (`<h2>`) in the content:
|
||||||
|
|
||||||
|
@ -40,7 +39,6 @@ Hugo uses Go's [Regular Expression package](https://golang.org/pkg/regexp/), whi
|
||||||
If you are just learning RegEx, or at least Go's flavor, you can practice pattern matching in the browser at <https://regex101.com/>.
|
If you are just learning RegEx, or at least Go's flavor, you can practice pattern matching in the browser at <https://regex101.com/>.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
|
|
||||||
[partials]: /templates/partials/
|
[partials]: /templates/partials/
|
||||||
[`plainify`]: /functions/plainify/
|
[`plainify`]: /functions/plainify/
|
||||||
[toc]: /content-management/toc/
|
[toc]: /content-management/toc/
|
||||||
|
|
|
@ -20,7 +20,7 @@ aliases: []
|
||||||
|
|
||||||
Takes a string containing the name of the variable as input. Returns
|
Takes a string containing the name of the variable as input. Returns
|
||||||
an empty string if the variable is not set, otherwise returns the
|
an empty string if the variable is not set, otherwise returns the
|
||||||
value of the variable.
|
value of the variable.
|
||||||
|
|
||||||
```
|
```
|
||||||
{{ getenv "HOME" }}
|
{{ getenv "HOME" }}
|
||||||
|
|
|
@ -22,5 +22,5 @@ aliases: []
|
||||||
In the result `&` becomes `&` and so on. It escapes only: `<`, `>`, `&`, `'` and `"`.
|
In the result `&` becomes `&` and so on. It escapes only: `<`, `>`, `&`, `'` and `"`.
|
||||||
|
|
||||||
```
|
```
|
||||||
{{ htmlEscape "Hugo & Caddy > Wordpress & Apache" }} → "Hugo & Caddy > Wordpress & Apache"
|
{{ htmlEscape "Hugo & Caddy > WordPress & Apache" }} → "Hugo & Caddy > WordPress & Apache"
|
||||||
```
|
```
|
||||||
|
|
|
@ -19,10 +19,10 @@ deprecated: false
|
||||||
aliases: []
|
aliases: []
|
||||||
---
|
---
|
||||||
|
|
||||||
`htmlUnescape` returns the given string with HTML escape codes un-escaped.
|
`htmlUnescape` returns the given string with HTML escape codes un-escaped.
|
||||||
|
|
||||||
Remember to pass the output of this to `safeHTML` if fully un-escaped characters are desired. Otherwise, the output will be escaped again as normal.
|
Remember to pass the output of this to `safeHTML` if fully un-escaped characters are desired. Otherwise, the output will be escaped again as normal.
|
||||||
|
|
||||||
```
|
```
|
||||||
{{ htmlUnescape "Hugo & Caddy > Wordpress & Apache" }} → "Hugo & Caddy > Wordpress & Apache"
|
{{ htmlUnescape "Hugo & Caddy > WordPress & Apache" }} → "Hugo & Caddy > WordPress & Apache"
|
||||||
```
|
```
|
||||||
|
|
|
@ -20,7 +20,7 @@ deprecated: false
|
||||||
draft: false
|
draft: false
|
||||||
aliases: []
|
aliases: []
|
||||||
---
|
---
|
||||||
|
|
||||||
`hugo` returns an instance that contains the following functions:
|
`hugo` returns an instance that contains the following functions:
|
||||||
|
|
||||||
hugo.Generator
|
hugo.Generator
|
||||||
|
@ -29,7 +29,7 @@ hugo.Generator
|
||||||
hugo.Version
|
hugo.Version
|
||||||
: the current version of the Hugo binary you are using e.g. `0.63.2`
|
: the current version of the Hugo binary you are using e.g. `0.63.2`
|
||||||
|
|
||||||
|
|
||||||
`hugo` returns an instance that contains the following functions:
|
`hugo` returns an instance that contains the following functions:
|
||||||
|
|
||||||
hugo.Environment
|
hugo.Environment
|
||||||
|
|
|
@ -38,8 +38,6 @@ The function takes multiple indices as arguments, and this can be used to get ne
|
||||||
{{ index $map "c" "e" }} => 20
|
{{ index $map "c" "e" }} => 20
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Example: Load Data from a Path Based on Front Matter Params
|
## Example: Load Data from a Path Based on Front Matter Params
|
||||||
|
|
||||||
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:
|
||||||
|
@ -93,4 +91,3 @@ Now the call will return the specific file according to the location specified i
|
||||||
{{ (index .Site.Data.locations .Params.location).pop_city }}
|
{{ (index .Site.Data.locations .Params.location).pop_city }}
|
||||||
=> 658390
|
=> 658390
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,6 @@ draft: false
|
||||||
aliases: []
|
aliases: []
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
{{ range last 10 .Pages }}
|
{{ range last 10 .Pages }}
|
||||||
{{ .Render "summary" }}
|
{{ .Render "summary" }}
|
||||||
|
|
|
@ -19,8 +19,6 @@ deprecated: false
|
||||||
aliases: []
|
aliases: []
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
{{ md5 "Hello world, gophers!" }}
|
{{ md5 "Hello world, gophers!" }}
|
||||||
<!-- returns the string "b3029f756f98f79e7f1b7f1d1f0dd53b" -->
|
<!-- returns the string "b3029f756f98f79e7f1b7f1d1f0dd53b" -->
|
||||||
|
|
|
@ -14,7 +14,7 @@ keywords: [strings]
|
||||||
signature: ["plainify INPUT"]
|
signature: ["plainify INPUT"]
|
||||||
workson: []
|
workson: []
|
||||||
hugoversion:
|
hugoversion:
|
||||||
relatedfuncs: [jsonify,]
|
relatedfuncs: [jsonify]
|
||||||
deprecated: false
|
deprecated: false
|
||||||
aliases: []
|
aliases: []
|
||||||
---
|
---
|
||||||
|
@ -25,7 +25,4 @@ aliases: []
|
||||||
|
|
||||||
See also the `.PlainWords`, `.Plain`, and `.RawContent` [page variables][pagevars].
|
See also the `.PlainWords`, `.Plain`, and `.RawContent` [page variables][pagevars].
|
||||||
|
|
||||||
|
|
||||||
[pagevars]: /variables/page/
|
[pagevars]: /variables/page/
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
title: relURL
|
title: relURL
|
||||||
description: Given a string, prepends the relative URL according to a page's position in the project directory structure.
|
description: Creates a baseURL-relative URL.
|
||||||
godocref:
|
godocref:
|
||||||
date: 2017-02-01
|
date: 2017-02-01
|
||||||
publishdate: 2017-02-01
|
publishdate: 2017-02-01
|
||||||
|
|
|
@ -113,6 +113,11 @@ Removes the given key
|
||||||
{{ .Scratch.Delete "greetings" }}
|
{{ .Scratch.Delete "greetings" }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### .Values
|
||||||
|
|
||||||
|
`Values` returns the raw backing map. Note that you should just use this method on the locally scoped `Scratch` instances you obtain via `newScratch`, not
|
||||||
|
`.Page.Scratch` etc., as that will lead to concurrency issues.
|
||||||
|
|
||||||
## Scope
|
## Scope
|
||||||
The scope of the backing data is global for the given `Page` or `Shortcode`, and spans partial and shortcode includes.
|
The scope of the backing data is global for the given `Page` or `Shortcode`, and spans partial and shortcode includes.
|
||||||
|
|
||||||
|
|
|
@ -48,4 +48,4 @@ $indexStartingAt1 := (add $index 1)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
[GNU's seq]: http://www.gnu.org/software/coreutils/manual/html_node/seq-invocation.html#seq-invocation
|
[GNU's seq]: https://www.gnu.org/software/coreutils/manual/html_node/seq-invocation.html#seq-invocation
|
||||||
|
|
|
@ -22,7 +22,7 @@ toc: false
|
||||||
deprecated: false
|
deprecated: false
|
||||||
---
|
---
|
||||||
|
|
||||||
A template file is any file living below the `layouts` directories of either the project or any of its theme components incudling partials and shortcodes.
|
A template file is any file living below the `layouts` directories of either the project or any of its theme components including partials and shortcodes.
|
||||||
|
|
||||||
The function is particularly handy with dynamic path. The following example ensures the build will not break on a `.Type` missing its dedicated `header` partial.
|
The function is particularly handy with dynamic path. The following example ensures the build will not break on a `.Type` missing its dedicated `header` partial.
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ aliases: []
|
||||||
|
|
||||||
## Example: Using `time` to get Month Index
|
## Example: Using `time` to get Month Index
|
||||||
|
|
||||||
The following example takes a UNIX timestamp---set as `utimestamp: "1489276800"` in a content's front matter---converts the timestamp (string) to an integer using the [`int` function][int], and then uses [`printf`][] to convert the `Month` property of `time` into an index.
|
The following example takes a UNIX timestamp---set as `utimestamp: "1489276800"` in a content's front matter---converts the timestamp (string) to an integer using the [`int` function][int], and then uses [`printf`][] to convert the `Month` property of `time` into an index.
|
||||||
|
|
||||||
The following example may be useful when setting up [multilingual sites][multilingual]:
|
The following example may be useful when setting up [multilingual sites][multilingual]:
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,4 @@ Since both values are integers, they can be subtracted and then divided by the n
|
||||||
Hugo's output is *static*. For the example above to be realistic, the site needs to be built every day.
|
Hugo's output is *static*. For the example above to be realistic, the site needs to be built every day.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[partial template]: /templates/partials/
|
[partial template]: /templates/partials/
|
||||||
|
|
|
@ -21,7 +21,7 @@ aliases: []
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
{{ $url := urls.Parse "http://www.gohugo.io" }}
|
{{ $url := urls.Parse "http://www.gohugo.io" }}
|
||||||
```
|
```
|
||||||
|
|
||||||
and returns a [URL](https://godoc.org/net/url#URL) structure. The struct fields are accessed via the `.` notation:
|
and returns a [URL](https://godoc.org/net/url#URL) structure. The struct fields are accessed via the `.` notation:
|
||||||
|
|
|
@ -349,6 +349,20 @@ Content-Security-Policy = "script-src localhost:1313"
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
|
|
||||||
|
{{< new-in "0.72.0" >}}
|
||||||
|
|
||||||
|
You can also specify simple redirects rules for the server. The syntax is again similar to Netlify's.
|
||||||
|
|
||||||
|
Note that a `status` code of 200 will trigger a [URL rewrite](https://docs.netlify.com/routing/redirects/rewrites-proxies/), which is what you want in SPA situations, e.g:
|
||||||
|
|
||||||
|
{{< code-toggle file="config/development/server">}}
|
||||||
|
[[redirects]]
|
||||||
|
from = "/myspa/**"
|
||||||
|
to = "/myspa/"
|
||||||
|
status = 200
|
||||||
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Configure Title Case
|
## Configure Title Case
|
||||||
|
|
|
@ -5,7 +5,7 @@ description: A list of tutorials and books on Hugo.
|
||||||
date: 2019-10-20
|
date: 2019-10-20
|
||||||
publishdate: 2019-10-20
|
publishdate: 2019-10-20
|
||||||
lastmod: 2019-10-20
|
lastmod: 2019-10-20
|
||||||
keywords: [books,tutorials,learning,usage]
|
keywords: [books, tutorials, learning, usage]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
parent: "getting-started"
|
parent: "getting-started"
|
||||||
|
@ -17,7 +17,9 @@ toc: false
|
||||||
---
|
---
|
||||||
|
|
||||||
## Books
|
## Books
|
||||||
|
|
||||||
### Hugo In Action
|
### Hugo In Action
|
||||||
|
|
||||||
[![Hugo In Action](hia.jpg)](https://www.manning.com/books/hugo-in-action)
|
[![Hugo In Action](hia.jpg)](https://www.manning.com/books/hugo-in-action)
|
||||||
|
|
||||||
Hugo in Action is a step-by-step guide to using Hugo to create static websites. Working with a complete example website and source code samples, you’ll learn how to build and host a low-maintenance, high-performance site that will wow your users and stay stable without relying on a third-party server.
|
Hugo in Action is a step-by-step guide to using Hugo to create static websites. Working with a complete example website and source code samples, you’ll learn how to build and host a low-maintenance, high-performance site that will wow your users and stay stable without relying on a third-party server.
|
||||||
|
@ -25,5 +27,7 @@ Hugo in Action is a step-by-step guide to using Hugo to create static websites.
|
||||||
[Hugo In Action Home Page](https://www.manning.com/books/hugo-in-action)
|
[Hugo In Action Home Page](https://www.manning.com/books/hugo-in-action)
|
||||||
|
|
||||||
## Video tutorials
|
## Video tutorials
|
||||||
|
|
||||||
### Video Playlist by Mike Dane
|
### Video Playlist by Mike Dane
|
||||||
Mike Dane expains the various features of via dedicated tutorials on [Youtube](https://www.youtube.com/watch?list=PLLAZ4kZ9dFpOnyRlyS-liKL5ReHDcj4G3&v=qtIqKaDlqXo).
|
|
||||||
|
Mike Dane explains the various features of Hugo via dedicated tutorials on [YouTube](https://www.youtube.com/watch?list=PLLAZ4kZ9dFpOnyRlyS-liKL5ReHDcj4G3&v=qtIqKaDlqXo).
|
||||||
|
|
|
@ -44,6 +44,10 @@ Download the appropriate version for your platform from [Hugo Releases][releases
|
||||||
|
|
||||||
Ideally, you should install it somewhere in your `PATH` for easy use. `/usr/local/bin` is the most probable location.
|
Ideally, you should install it somewhere in your `PATH` for easy use. `/usr/local/bin` is the most probable location.
|
||||||
|
|
||||||
|
### Docker
|
||||||
|
|
||||||
|
We currently do not official Hugo images for Docker, but we do recommend these up to date distributions: https://hub.docker.com/r/klakegg/hugo/
|
||||||
|
|
||||||
### Homebrew (macOS)
|
### Homebrew (macOS)
|
||||||
|
|
||||||
If you are on macOS and using [Homebrew][brew], you can install Hugo with the following one-liner:
|
If you are on macOS and using [Homebrew][brew], you can install Hugo with the following one-liner:
|
||||||
|
@ -444,7 +448,7 @@ Directory of C:\hugo\sites\example.com
|
||||||
|
|
||||||
### Snap Package
|
### Snap Package
|
||||||
|
|
||||||
In any of the [Linux distributions that support snaps][snaps], you may install install the "extended" Sass/SCSS version with this command:
|
In any of the [Linux distributions that support snaps][snaps], you may install the "extended" Sass/SCSS version with this command:
|
||||||
|
|
||||||
snap install hugo --channel=extended
|
snap install hugo --channel=extended
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ The above will create a new Hugo site in a folder named `quickstart`.
|
||||||
|
|
||||||
See [themes.gohugo.io](https://themes.gohugo.io/) for a list of themes to consider. This quickstart uses the beautiful [Ananke theme](https://themes.gohugo.io/gohugo-theme-ananke/).
|
See [themes.gohugo.io](https://themes.gohugo.io/) for a list of themes to consider. This quickstart uses the beautiful [Ananke theme](https://themes.gohugo.io/gohugo-theme-ananke/).
|
||||||
|
|
||||||
First, download the theme from Github and add it to your site's `theme` directory:
|
First, download the theme from GitHub and add it to your site's `theme` directory:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd quickstart
|
cd quickstart
|
||||||
|
@ -83,7 +83,7 @@ echo 'theme = "ananke"' >> config.toml
|
||||||
|
|
||||||
## Step 4: Add Some Content
|
## Step 4: Add Some Content
|
||||||
|
|
||||||
You can manually create content files (for example as `content/<CATEGORY>/<FILE>.<FORMAT>`) and provide metadata in them, however you can use the `new` command to do few things for you (like add title and date):
|
You can manually create content files (for example as `content/<CATEGORY>/<FILE>.<FORMAT>`) and provide metadata in them, however you can use the `new` command to do a few things for you (like add title and date):
|
||||||
|
|
||||||
```
|
```
|
||||||
hugo new posts/my-first-post.md
|
hugo new posts/my-first-post.md
|
||||||
|
|
|
@ -58,7 +58,7 @@ Next, execute this command to generate a new keypair called `rsa_id`:
|
||||||
|
|
||||||
You'll be prompted for a passphrase, which is an extra layer of protection. Enter the passphrase you'd like to use, and then enter it again when prompted, or leave it blank if you don't want to have a passphrase. Not using a passphrase will let you transfer files non-interactively, as you won't be prompted for a password when you log in, but it is slightly less secure.
|
You'll be prompted for a passphrase, which is an extra layer of protection. Enter the passphrase you'd like to use, and then enter it again when prompted, or leave it blank if you don't want to have a passphrase. Not using a passphrase will let you transfer files non-interactively, as you won't be prompted for a password when you log in, but it is slightly less secure.
|
||||||
|
|
||||||
To make logging in easier, add a definition for your web host to the file `~/.ssh/config` with the following command, replacing `HOST` with the IP address or hostname of your web host, and `USER` with the username you use to log in to your web host when transfering files:
|
To make logging in easier, add a definition for your web host to the file `~/.ssh/config` with the following command, replacing `HOST` with the IP address or hostname of your web host, and `USER` with the username you use to log in to your web host when transferring files:
|
||||||
|
|
||||||
```
|
```
|
||||||
~/.ssh/$ cat >> config <<EOF
|
~/.ssh/$ cat >> config <<EOF
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
title: Host on AWS Amplify
|
title: Host on AWS Amplify
|
||||||
linktitle: Host on AWS Amplify
|
linktitle: Host on AWS Amplify
|
||||||
description: Develop and deploy a cloud-powered web app with AWS Amplify.
|
description: Develop and deploy a cloud-powered web app with AWS Amplify.
|
||||||
date: 2018-01-31
|
date: 2018-01-31
|
||||||
publishdate: 2018-01-31
|
publishdate: 2018-01-31
|
||||||
lastmod: 2018-01-31
|
lastmod: 2018-01-31
|
||||||
|
|
|
@ -57,7 +57,7 @@ This is a much simpler setup as your Hugo files and generated content are publis
|
||||||
4. Paste your existing Hugo project into the new local `<YOUR-PROJECT>` repository. Make sure your website works locally (`hugo server` or `hugo server -t <YOURTHEME>`) and open your browser to <http://localhost:1313>.
|
4. Paste your existing Hugo project into the new local `<YOUR-PROJECT>` repository. Make sure your website works locally (`hugo server` or `hugo server -t <YOURTHEME>`) and open your browser to <http://localhost:1313>.
|
||||||
5. Once you are happy with the results:
|
5. Once you are happy with the results:
|
||||||
* Press <kbd>Ctrl</kbd>+<kbd>C</kbd> to kill the server
|
* Press <kbd>Ctrl</kbd>+<kbd>C</kbd> to kill the server
|
||||||
* Before proceeding run `rm -rf public` to completely remove the `public` directory
|
* Before proceeding run `rm -rf public` to completely remove the `public` directory
|
||||||
6. `git submodule add -b master https://github.com/<USERNAME>/<USERNAME>.github.io.git public`. This creates a git [submodule][]. Now when you run the `hugo` command to build your site to `public`, the created `public` directory will have a different remote origin (i.e. hosted GitHub repository).
|
6. `git submodule add -b master https://github.com/<USERNAME>/<USERNAME>.github.io.git public`. This creates a git [submodule][]. Now when you run the `hugo` command to build your site to `public`, the created `public` directory will have a different remote origin (i.e. hosted GitHub repository).
|
||||||
|
|
||||||
### Put it Into a Script
|
### Put it Into a Script
|
||||||
|
|
|
@ -24,13 +24,13 @@ draft: false
|
||||||
|
|
||||||
## Create a KeyCDN Pull Zone
|
## Create a KeyCDN Pull Zone
|
||||||
|
|
||||||
The first step will be to login to your KeyCDN account and create a new zone. Name this whatever you like and select the [Pull Zone](https://www.keycdn.com/support/create-a-pull-zone/) option. As for the origin URL, your site will be running on [GitLab Pages](https://docs.gitlab.com/ee/user/project/pages/getting_started_part_one.html) with a URL of `https://youruser.gitlab.io/reponame/`. Use this as the Origin URL.
|
The first step will be to login to your KeyCDN account and create a new zone. Name this whatever you like and select the [Pull Zone](https://www.keycdn.com/support/create-a-pull-zone/) option. As for the origin URL, your site will be running on [GitLab Pages](https://docs.gitlab.com/ee/user/project/pages/getting_started_part_one.html) with a URL of `https://youruser.gitlab.io/reponame/`. Use this as the Origin URL.
|
||||||
|
|
||||||
![Screenshot of KeyCDN's pull zone creation page](/images/hosting-and-deployment/hosting-on-keycdn/keycdn-pull-zone.png)
|
![Screenshot of KeyCDN's pull zone creation page](/images/hosting-and-deployment/hosting-on-keycdn/keycdn-pull-zone.png)
|
||||||
|
|
||||||
While the origin location doesn’t exist yet, you will need to use your new Zone URL address (or [Zonealias](https://www.keycdn.com/support/create-a-zonealias/)) in the `.gitlab-ci.yml` file that will be uploaded to your GitLab project.
|
While the origin location doesn’t exist yet, you will need to use your new Zone URL address (or [Zone Alias](https://www.keycdn.com/support/create-a-zone-alias/)) in the `.gitlab-ci.yml` file that will be uploaded to your GitLab project.
|
||||||
|
|
||||||
Ensure that you use your Zone URL or Zonealias as the `BASEURL` variable in the example below. This will be the user-visible website address.
|
Ensure that you use your Zone URL or Zone alias as the `BASEURL` variable in the example below. This will be the user-visible website address.
|
||||||
|
|
||||||
## Configure Your .gitlab-ci.yml File
|
## Configure Your .gitlab-ci.yml File
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ Any of the above can be omitted.
|
||||||
min
|
min
|
||||||
: The minimum Hugo version supported, e.g. `0.55.0`
|
: The minimum Hugo version supported, e.g. `0.55.0`
|
||||||
|
|
||||||
max
|
max
|
||||||
: The maximum Hugo version supported, e.g. `0.55.0`
|
: The maximum Hugo version supported, e.g. `0.55.0`
|
||||||
|
|
||||||
extended
|
extended
|
||||||
|
@ -73,7 +73,7 @@ extended
|
||||||
ignoreConfig = false
|
ignoreConfig = false
|
||||||
disable = false
|
disable = false
|
||||||
[[module.imports]]
|
[[module.imports]]
|
||||||
path = "my-shortcodes"
|
path = "my-shortcodes"
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
path
|
path
|
||||||
|
|
|
@ -33,10 +33,10 @@ hugo mod init github.com/gohugoio/myShortcodes
|
||||||
Also see the [CLI Doc](/commands/hugo_mod_init/).
|
Also see the [CLI Doc](/commands/hugo_mod_init/).
|
||||||
|
|
||||||
## Use a Module for a Theme
|
## Use a Module for a Theme
|
||||||
The easiest way to use a for a theme is to import it in the config.
|
The easiest way to use a Module for a theme is to import it in the config.
|
||||||
|
|
||||||
1. Initialize the hugo module system: `hugo mod init github.com/<your_user>/<your_project>`
|
1. Initialize the hugo module system: `hugo mod init github.com/<your_user>/<your_project>`
|
||||||
2. Import the theme in your `config.toml`:
|
2. Import the theme in your `config.toml`:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[module]
|
[module]
|
||||||
|
@ -87,7 +87,7 @@ One way to do local development of a module imported in a project is to add a re
|
||||||
replace github.com/bep/hugotestmods/mypartials => /Users/bep/hugotestmods/mypartials
|
replace github.com/bep/hugotestmods/mypartials => /Users/bep/hugotestmods/mypartials
|
||||||
```
|
```
|
||||||
|
|
||||||
If you have the `hugo server` running, the configuration will be reloaded and `/Users/bep/hugotestmods/mypartials` put on the watch list.
|
If you have the `hugo server` running, the configuration will be reloaded and `/Users/bep/hugotestmods/mypartials` put on the watch list.
|
||||||
|
|
||||||
|
|
||||||
## Print Dependency Graph
|
## Print Dependency Graph
|
||||||
|
@ -114,7 +114,7 @@ Also see the [CLI Doc](/commands/hugo_mod_graph/).
|
||||||
|
|
||||||
## Vendor Your Modules
|
## Vendor Your Modules
|
||||||
|
|
||||||
`hugo mod vendor` will write all the module depencies to a `_vendor` folder, which will then be used for all subsequent builds.
|
`hugo mod vendor` will write all the module dependencies to a `_vendor` folder, which will then be used for all subsequent builds.
|
||||||
|
|
||||||
Note that:
|
Note that:
|
||||||
|
|
||||||
|
|
|
@ -15,12 +15,10 @@ sections_weight: 60
|
||||||
draft: false
|
draft: false
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
Asset files of the same MIME type can be bundled into one resource using `resources.Concat` which takes two arguments, a target path and a slice of resource objects.
|
Asset files of the same MIME type can be bundled into one resource using `resources.Concat` which takes two arguments, a target path and a slice of resource objects.
|
||||||
|
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ $plugins := resources.Get "js/plugins.js" }}
|
{{ $plugins := resources.Get "js/plugins.js" }}
|
||||||
{{ $global := resources.Get "js/global.js" }}
|
{{ $global := resources.Get "js/global.js" }}
|
||||||
{{ $js := slice $plugins $global | resources.Concat "js/bundle.js" }}
|
{{ $js := slice $plugins $global | resources.Concat "js/bundle.js" }}
|
||||||
```
|
```
|
||||||
|
|
|
@ -16,7 +16,7 @@ draft: false
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
Fingerprinting and [SRI](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) can be applied to any asset file using `resources.Fingerprint` which takes two arguments, the resource object and a [hash function](https://en.wikipedia.org/wiki/Cryptographic_hash_function).
|
Fingerprinting and [SRI](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) can be applied to any asset file using `resources.Fingerprint` which takes two arguments, the resource object and a [hash function](https://en.wikipedia.org/wiki/Cryptographic_hash_function).
|
||||||
|
|
||||||
The default hash function is `sha256`. Other available functions are `sha384` (from Hugo `0.55`), `sha512` and `md5`.
|
The default hash function is `sha256`. Other available functions are `sha384` (from Hugo `0.55`), `sha512` and `md5`.
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ weight: 01
|
||||||
sections_weight: 01
|
sections_weight: 01
|
||||||
draft: false
|
draft: false
|
||||||
aliases: [/assets/]
|
aliases: [/assets/]
|
||||||
---
|
---
|
||||||
|
|
||||||
### Asset directory
|
### Asset directory
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ draft: false
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
Any resource of the aforementioned types can be minifed using `resources.Minify` which takes for argument the resource object.
|
Any resource of the aforementioned types can be minified using `resources.Minify` which takes for argument the resource object.
|
||||||
|
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
|
|
|
@ -20,7 +20,7 @@ There are currently two limitations to this:
|
||||||
|
|
||||||
1. This only works in `*.html` templates (i.e. templates that produces HTML files).
|
1. This only works in `*.html` templates (i.e. templates that produces HTML files).
|
||||||
2. You cannot manipulate the values returned from the resource's methods. E.g. the `upper` in this example will not work as expected:
|
2. You cannot manipulate the values returned from the resource's methods. E.g. the `upper` in this example will not work as expected:
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ $css := resources.Get "css/main.css" }}
|
{{ $css := resources.Get "css/main.css" }}
|
||||||
{{ $css = $css | resources.PostCSS | minify | fingerprint | resources.PostProcess }}
|
{{ $css = $css | resources.PostCSS | minify | fingerprint | resources.PostProcess }}
|
||||||
|
|
BIN
content/en/news/0.72.0-relnotes/hugo-72-featured.png
Normal file
BIN
content/en/news/0.72.0-relnotes/hugo-72-featured.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 251 KiB |
41
content/en/news/0.72.0-relnotes/index.md
Normal file
41
content/en/news/0.72.0-relnotes/index.md
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
|
||||||
|
---
|
||||||
|
date: 2020-05-31
|
||||||
|
title: URL rewrites in dev server
|
||||||
|
description: "Hugo 0.72.0 comes with dev server redirects and URL rewrites, Goldmark typography extension fixes, Scratch.Values."
|
||||||
|
categories: ["Releases"]
|
||||||
|
---
|
||||||
|
|
||||||
|
This is a rather small release, its probably main motivation being the fixes in Goldmark's [Typographer extension](https://github.com/gohugoio/hugo/commit/432885c499849efb29d3e50196f377fe0e908333).
|
||||||
|
|
||||||
|
This release also adds [redirect and URL rewrite support](https://gohugo.io/getting-started/configuration/#configure-server) to the development server, with mostly Netlify-compatible configuration syntax. This is especially useful if you're building a [SPA](https://en.wikipedia.org/wiki/Single-page_application) with client-side routing.
|
||||||
|
|
||||||
|
|
||||||
|
This release represents **13 contributions by 3 contributors** to the main Hugo code base.
|
||||||
|
|
||||||
|
Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs),
|
||||||
|
which has received **9 contributions by 6 contributors**. A special thanks to [@faraixyz](https://github.com/faraixyz), [@bep](https://github.com/bep), [@coliff](https://github.com/coliff), and [@Leon0824](https://github.com/Leon0824) for their work on the documentation site.
|
||||||
|
|
||||||
|
|
||||||
|
Hugo now has:
|
||||||
|
|
||||||
|
* 44383+ [stars](https://github.com/gohugoio/hugo/stargazers)
|
||||||
|
* 437+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
|
||||||
|
* 327+ [themes](http://themes.gohugo.io/)
|
||||||
|
|
||||||
|
## Enhancements
|
||||||
|
|
||||||
|
### Other
|
||||||
|
|
||||||
|
* Add Scratch.Values [2919a6a5](https://github.com/gohugoio/hugo/commit/2919a6a503f7b369154d6eb787023a1fe58a9ad4) [@bep](https://github.com/bep) [#7335](https://github.com/gohugoio/hugo/issues/7335)
|
||||||
|
* Update Goldmark to improve Typographer [432885c4](https://github.com/gohugoio/hugo/commit/432885c499849efb29d3e50196f377fe0e908333) [@bep](https://github.com/bep) [#7289](https://github.com/gohugoio/hugo/issues/7289)
|
||||||
|
* Add redirect support to the server [6a3e8974](https://github.com/gohugoio/hugo/commit/6a3e89743ccad58097a6dd203a63448946a2304d) [@bep](https://github.com/bep) [#7323](https://github.com/gohugoio/hugo/issues/7323)
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
### Other
|
||||||
|
|
||||||
|
* Fix tag collector for nested table elements [c950c86b](https://github.com/gohugoio/hugo/commit/c950c86b4e5fb93f787ec78ca823bded9ef9fa3a) [@bep](https://github.com/bep) [#7318](https://github.com/gohugoio/hugo/issues/7318)
|
||||||
|
* Fix build error: my previous commits did not fix it [91520249](https://github.com/gohugoio/hugo/commit/915202494b140882d594e0542153531f6afada02) [@anthonyfok](https://github.com/anthonyfok)
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ images:
|
||||||
- images/gohugoio-card-1.png
|
- images/gohugoio-card-1.png
|
||||||
---
|
---
|
||||||
|
|
||||||
**Netlify** recently announced support for [HTTP/2 server push](https://www.netlify.com/blog/2017/07/18/http/2-server-push-on-netlify/), and we have now added it to the **gohugo.io** sites for the main `CSS` and `JS` bundles, along with server-side 301 redirect support.
|
**Netlify** recently announced support for [HTTP/2 server push](https://www.netlify.com/blog/2017/07/18/http/2-server-push-on-netlify/), and we have now added it to the **gohugo.io** sites for the main `CSS` and `JS` bundles, along with server-side 301 redirect support.
|
||||||
|
|
||||||
If you navigate to https://gohugo.io and look in the Chrome developer network console, you should now see `Push` as the new source ("Initiator") for the `CSS` and `JSS`:
|
If you navigate to https://gohugo.io and look in the Chrome developer network console, you should now see `Push` as the new source ("Initiator") for the `CSS` and `JSS`:
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ baseName = "_headers"
|
||||||
isPlainText = true
|
isPlainText = true
|
||||||
notAlternative = true
|
notAlternative = true
|
||||||
```
|
```
|
||||||
## 2. Add Template For the _headers File
|
## 2. Add Template For the _headers File
|
||||||
|
|
||||||
Add `layouts/index.headers`:
|
Add `layouts/index.headers`:
|
||||||
|
|
||||||
|
@ -63,9 +63,7 @@ The template above creates both a security header definition and a HTTP/2 server
|
||||||
Also note that this is a template for the home page, so the full `Page` with its `Site` and many variables are available. You can also use `partial` to include other templates.
|
Also note that this is a template for the home page, so the full `Page` with its `Site` and many variables are available. You can also use `partial` to include other templates.
|
||||||
|
|
||||||
|
|
||||||
|
## 3. Add Template For the _redirects File
|
||||||
|
|
||||||
## 3. Add Template For the _redirects File
|
|
||||||
Add `layouts/index.redir`:
|
Add `layouts/index.redir`:
|
||||||
```bash
|
```bash
|
||||||
# Netlify redirects. See https://www.netlify.com/docs/redirects/
|
# Netlify redirects. See https://www.netlify.com/docs/redirects/
|
||||||
|
|
|
@ -18,7 +18,7 @@ Finding a tool that will make your customers, writers, designers, _and_ DevOps t
|
||||||
**Hugo is static**. We're a security company, so we swear by static sites and use them wherever possible. We feel much safer pointing customers at HTML files than at a complicated server which needs to be hardened.
|
**Hugo is static**. We're a security company, so we swear by static sites and use them wherever possible. We feel much safer pointing customers at HTML files than at a complicated server which needs to be hardened.
|
||||||
|
|
||||||
**Hugo is Go**. We love the Go programming language at 1Password, and we were delighted to learn that Hugo used the same Go template syntax that our designers and front-end developers had already mastered.
|
**Hugo is Go**. We love the Go programming language at 1Password, and we were delighted to learn that Hugo used the same Go template syntax that our designers and front-end developers had already mastered.
|
||||||
|
|
||||||
**Hugo is FAST**. Our previous static site generator took nearly a minute to compile our (then much smaller) site. Developers might be used to this, but it wasn't cutting it for writers who wanted to see live previews of their work. Hugo did the same job in milliseconds, and to this day compiles 400 pages in five languages in the blink of an eye.
|
**Hugo is FAST**. Our previous static site generator took nearly a minute to compile our (then much smaller) site. Developers might be used to this, but it wasn't cutting it for writers who wanted to see live previews of their work. Hugo did the same job in milliseconds, and to this day compiles 400 pages in five languages in the blink of an eye.
|
||||||
|
|
||||||
**Hugo is flexible**. Thanks to Hugo's content and layout system, we were able to preserve our existing file and folder structure and port our entire production site in a few days. We could then create new content types that weren't possible before, like these snazzy [showcases](https://support.1password.com/explore/extension/).
|
**Hugo is flexible**. Thanks to Hugo's content and layout system, we were able to preserve our existing file and folder structure and port our entire production site in a few days. We could then create new content types that weren't possible before, like these snazzy [showcases](https://support.1password.com/explore/extension/).
|
||||||
|
|
|
@ -8,7 +8,7 @@ byline: "[Didier Divinerites](https://github.com/divinerites)"
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Swiss [Arolla campsite](https://www.camping-arolla.com) runs the highest campsite in Europe and I'm completely re-doing their actuel Website with Hugo.
|
Swiss [Arolla campsite](https://www.camping-arolla.com) runs the highest campsite in Europe and I'm completely re-doing their actual Website with Hugo.
|
||||||
|
|
||||||
But they just launch a brand new offer (luxury tents with bed and fire oven), and we couldn't wait for the proper new website for having this promoted: we needed the website up and running within 24h!
|
But they just launch a brand new offer (luxury tents with bed and fire oven), and we couldn't wait for the proper new website for having this promoted: we needed the website up and running within 24h!
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
title: fireship.io
|
title: fireship.io
|
||||||
date: 2019-02-02
|
date: 2019-02-02
|
||||||
description: "Showcase: \"Hugo helps us create complex technical content that integrates engaging web components\""
|
description: "Showcase: \"Hugo helps us create complex technical content that integrates engaging web components\""
|
||||||
|
@ -10,9 +9,9 @@ byline: "[Jeff Delaney](https://github.com/codediodeio), Fireship.io Creator"
|
||||||
|
|
||||||
After careful consideration of JavaScript/JSX-based static site generators, it became clear that Hugo was the only tool capable of handling our project's complex demands. Not only do we have multiple content formats and taxonomies, but we often need to customize the experience at a more granular level. The problems Hugo has solved for us include:
|
After careful consideration of JavaScript/JSX-based static site generators, it became clear that Hugo was the only tool capable of handling our project's complex demands. Not only do we have multiple content formats and taxonomies, but we often need to customize the experience at a more granular level. The problems Hugo has solved for us include:
|
||||||
|
|
||||||
- **Render speed.** We know from past experience that JavaScript-based static site generators become very slow when you have thousands of pages and images.
|
- **Render speed.** We know from past experience that JavaScript-based static site generators become very slow when you have thousands of pages and images.
|
||||||
- **Feature-rich.** Our site has a long list of specialized needs and Hugo somehow manages to cover every single use case.
|
- **Feature-rich.** Our site has a long list of specialized needs and Hugo somehow manages to cover every single use case.
|
||||||
- **Composability.** Hugo's partial and shortcode systems empower us to write DRY and maintainable templates.
|
- **Composability.** Hugo's partial and shortcode systems empower us to write DRY and maintainable templates.
|
||||||
- **Simplicity.** Hugo is easy to learn (even without Go experience) and doesn't burden us with brittle dependencies.
|
- **Simplicity.** Hugo is easy to learn (even without Go experience) and doesn't burden us with brittle dependencies.
|
||||||
|
|
||||||
The site is able to achieve Lighthouse performance scores of 95+, despite the fact that it is a fully interactive PWA that ships Angular and Firebase in the JS bundle. This is made possible by (1) prerendering content with Hugo and (2) lazily embedding native web components directly in the HTML and markdown. We provide a [detailed explanation](https://youtu.be/gun8OiGtlNc) of the architecture on YouTube and can't imagine development without Hugo.
|
The site is able to achieve Lighthouse performance scores of 95+, despite the fact that it is a fully interactive PWA that ships Angular and Firebase in the JS bundle. This is made possible by (1) prerendering content with Hugo and (2) lazily embedding native web components directly in the HTML and markdown. We provide a [detailed explanation](https://youtu.be/gun8OiGtlNc) of the architecture on YouTube and can't imagine development without Hugo.
|
||||||
|
|
|
@ -15,7 +15,7 @@ Hugo addresses all these needs, coupled with [Forestry.io](https://forestry.io/)
|
||||||
|
|
||||||
|
|
||||||
## What we liked
|
## What we liked
|
||||||
- The **multilingual** content support, especially simpel to setup.
|
- The **multilingual** content support, especially simple to setup.
|
||||||
- The **multiple environments** support (develop, staging, test, production, ...).
|
- The **multiple environments** support (develop, staging, test, production, ...).
|
||||||
- Although a hard start with the Go language, the power of the **Hugo's templating**.
|
- Although a hard start with the Go language, the power of the **Hugo's templating**.
|
||||||
- The **partial layouts**, including the `internals` (e.g. social metas).
|
- The **partial layouts**, including the `internals` (e.g. social metas).
|
||||||
|
|
|
@ -1,15 +1,9 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
title: Linode Docs
|
title: Linode Docs
|
||||||
|
|
||||||
date: 2018-02-12
|
date: 2018-02-12
|
||||||
|
|
||||||
description: "Showcase: \"Hugo allows us to build thousands of pages in seconds.\""
|
description: "Showcase: \"Hugo allows us to build thousands of pages in seconds.\""
|
||||||
|
|
||||||
siteURL: https://linode.com/docs/
|
siteURL: https://linode.com/docs/
|
||||||
|
|
||||||
siteSource: https://github.com/linode/docs
|
siteSource: https://github.com/linode/docs
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
The documentation team at Linode has been writing guides since 2009, with the goal of helping new and experienced Linux users find the best tools and get the most out of their systems.
|
The documentation team at Linode has been writing guides since 2009, with the goal of helping new and experienced Linux users find the best tools and get the most out of their systems.
|
||||||
|
|
|
@ -15,7 +15,7 @@ siteURL: https://www.paceup.com/
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
From the beginning, at Pace, we were focused on solving customer needs and didn't want to over-engineer our marketing or sales. At the same time we didn't want to lock ourselves into a Wordpress, Squarespace or the like.
|
From the beginning, at Pace, we were focused on solving customer needs and didn't want to over-engineer our marketing or sales. At the same time we didn't want to lock ourselves into a WordPress, Squarespace or the like.
|
||||||
|
|
||||||
The ideal was a fast, simple, static site builder. When we came across Hugo we were blown away. Being a European company we wanted to be multi-lingual from the get-go and allow multiple team-members to collaborate and own their content. We also felt that a tech-company in 2018 should be capable of hosting its own blog in a simple way.
|
The ideal was a fast, simple, static site builder. When we came across Hugo we were blown away. Being a European company we wanted to be multi-lingual from the get-go and allow multiple team-members to collaborate and own their content. We also felt that a tech-company in 2018 should be capable of hosting its own blog in a simple way.
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ byline: "[Sebastian Schirmer](mailto:sebastian.schirmer@quiply.com), Quiply Co-F
|
||||||
|
|
||||||
With the launch of our Employee Communications app Quiply we created a very simple and static one-page website to showcase our product.
|
With the launch of our Employee Communications app Quiply we created a very simple and static one-page website to showcase our product.
|
||||||
|
|
||||||
As our customer base and demand for marketing and communication started to grow, we needed a solution to easily grow and extend the contents of our web presence. As we do not have the need to serve dynamic content, we decided to use a static site generator. Amongst a couple of others, we tried Hugo and it became immediately clear that we'd use Hugo going forward as it compiles super-fast, is intuitive to use and offers all the features we need.
|
As our customer base and demand for marketing and communication started to grow, we needed a solution to easily grow and extend the contents of our web presence. As we do not have the need to serve dynamic content, we decided to use a static site generator. Amongst a couple of others, we tried Hugo and it became immediately clear that we'd use Hugo going forward as it compiles super-fast, is intuitive to use and offers all the features we need.
|
||||||
|
|
||||||
Our website which we launched a couple of weeks ago is still growing and new content is being added constantly. By using Hugo, this can be easily done by content authors writing markdown files without always having to touch HTML or CSS code. It is available in German only for the time being, an English version is in the works.
|
Our website which we launched a couple of weeks ago is still growing and new content is being added constantly. By using Hugo, this can be easily done by content authors writing markdown files without always having to touch HTML or CSS code. It is available in German only for the time being, an English version is in the works.
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
title: StackImpact
|
title: StackImpact
|
||||||
|
|
||||||
date: 2018-02-20
|
date: 2018-02-20
|
||||||
|
|
||||||
description: "\"Hugo is a perfect choice for a product website.\""
|
description: "\"Hugo is a perfect choice for a product website.\""
|
||||||
|
|
||||||
siteURL: https://stackimpact.com/
|
siteURL: https://stackimpact.com/
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
After gradually handing over the control of our website to WordPress plugins, we realized that we needed to act.
|
After gradually handing over the control of our website to WordPress plugins, we realized that we needed to act.
|
||||||
|
|
|
@ -15,7 +15,7 @@ We would really appreciate if you could:
|
||||||
|
|
||||||
1. Fork https://github.com/gohugoio/hugoDocs
|
1. Fork https://github.com/gohugoio/hugoDocs
|
||||||
2. Run `hugo new showcase/your-site` (this requires >= Hugo 0.49). This will use the archetype bundle in the [docs repo](https://github.com/gohugoio/hugoDocs/tree/master/archetypes).
|
2. Run `hugo new showcase/your-site` (this requires >= Hugo 0.49). This will use the archetype bundle in the [docs repo](https://github.com/gohugoio/hugoDocs/tree/master/archetypes).
|
||||||
3. Follow the instructions in the newly created page bundle.
|
3. Follow the instructions in the newly created page bundle.
|
||||||
3. Create a new pull request in https://github.com/gohugoio/hugoDocs/pulls
|
3. Create a new pull request in https://github.com/gohugoio/hugoDocs/pulls
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -357,7 +357,7 @@ The following two examples are functionally the same:
|
||||||
|
|
||||||
### Example 2: `index`
|
### Example 2: `index`
|
||||||
|
|
||||||
The following accesses the page parameter called "disqus_url" and escapes the HTML. This example also uses the [`index` function][index], which is built into Go Templates:
|
The following accesses the page parameter called "disqus_url" and escapes the HTML. This example also uses the [`index` function](/functions/index-function/), which is built into Go Templates:
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ index .Params "disqus_url" | html }}
|
{{ index .Params "disqus_url" | html }}
|
||||||
|
|
|
@ -177,27 +177,10 @@ The following `footer.html` partial template is used for [spf13.com](https://spf
|
||||||
<p>
|
<p>
|
||||||
© 2013-14 Steve Francia.
|
© 2013-14 Steve Francia.
|
||||||
<a href="https://creativecommons.org/licenses/by/3.0/" title="Creative Commons Attribution">Some rights reserved</a>;
|
<a href="https://creativecommons.org/licenses/by/3.0/" title="Creative Commons Attribution">Some rights reserved</a>;
|
||||||
please attribute properly and link back. Hosted by <a href="http://servergrove.com">ServerGrove</a>.
|
please attribute properly and link back.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
<script type="text/javascript">
|
|
||||||
|
|
||||||
var _gaq = _gaq || [];
|
|
||||||
_gaq.push(['_setAccount', 'UA-XYSYXYSY-X']);
|
|
||||||
_gaq.push(['_trackPageview']);
|
|
||||||
|
|
||||||
(function() {
|
|
||||||
var ga = document.createElement('script');
|
|
||||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' :
|
|
||||||
'http://www') + '.google-analytics.com/ga.js';
|
|
||||||
ga.setAttribute('async', 'true');
|
|
||||||
document.documentElement.firstChild.appendChild(ga);
|
|
||||||
})();
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
{{< /code >}}
|
{{< /code >}}
|
||||||
|
|
||||||
[context]: /templates/introduction/ "The most easily overlooked concept to understand about Go templating is how the dot always refers to the current context."
|
[context]: /templates/introduction/ "The most easily overlooked concept to understand about Go templating is how the dot always refers to the current context."
|
||||||
|
|
|
@ -22,7 +22,7 @@ toc: true
|
||||||
See [Template Lookup Order](/templates/lookup-order/) for the complete reference.
|
See [Template Lookup Order](/templates/lookup-order/) for the complete reference.
|
||||||
|
|
||||||
{{% note "Hugo Ships with an RSS Template" %}}
|
{{% note "Hugo Ships with an RSS Template" %}}
|
||||||
Hugo ships with its own [RSS 2.0 template](#the-embedded-rss-xml). The embedded template will be sufficient for most use cases.
|
Hugo ships with its own [RSS 2.0 template](#the-embedded-rssxml). The embedded template will be sufficient for most use cases.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
RSS pages are of the type `Page` and have all the [page variables](/variables/page/) available to use in the templates.
|
RSS pages are of the type `Page` and have all the [page variables](/variables/page/) available to use in the templates.
|
||||||
|
|
|
@ -21,7 +21,7 @@ toc: false
|
||||||
* [enwrite](https://github.com/zzamboni/enwrite). Enwrite enables evernote-powered, statically generated blogs and websites. Now posting to your blog or updating your website is as easy as writing a new note in Evernote!
|
* [enwrite](https://github.com/zzamboni/enwrite). Enwrite enables evernote-powered, statically generated blogs and websites. Now posting to your blog or updating your website is as easy as writing a new note in Evernote!
|
||||||
* [Lipi](https://github.com/SohanChy/Lipi). Lipi is a native GUI frontend written in Java to manage your Hugo websites.
|
* [Lipi](https://github.com/SohanChy/Lipi). Lipi is a native GUI frontend written in Java to manage your Hugo websites.
|
||||||
* [Netlify CMS](https://netlifycms.org). Netlify CMS is an open source, serverless solution for managing Git based content in static sites, and it works on any platform that can host static sites. A [Hugo/Netlify CMS starter](https://github.com/netlify-templates/one-click-hugo-cms) is available to get new projects running quickly.
|
* [Netlify CMS](https://netlifycms.org). Netlify CMS is an open source, serverless solution for managing Git based content in static sites, and it works on any platform that can host static sites. A [Hugo/Netlify CMS starter](https://github.com/netlify-templates/one-click-hugo-cms) is available to get new projects running quickly.
|
||||||
* [Hokus CMS](https://github.com/julianoappelklein/hokus). Hokus CMS is an open source, multiplatform, easy to use, desktop application for Hugo. Build from simple to complex user interfaces for Hugo websites by choosing from a dozen ready-to-use components — all for free, with no vendor lock-in.
|
* [Hokus CMS](https://github.com/julianoappelklein/hokus). Hokus CMS is an open source, multi-platform, easy to use, desktop application for Hugo. Build from simple to complex user interfaces for Hugo websites by choosing from a dozen ready-to-use components — all for free, with no vendor lock-in.
|
||||||
|
|
||||||
|
|
||||||
## Commercial Services
|
## Commercial Services
|
||||||
|
|
|
@ -42,19 +42,19 @@ Alternatively, you can use the new [Jekyll import command](/commands/hugo_import
|
||||||
|
|
||||||
## DokuWiki
|
## DokuWiki
|
||||||
|
|
||||||
- [dokuwiki-to-hugo](https://github.com/wgroeneveld/dokuwiki-to-hugo) - Migrates your dokuwiki source pages from [DokuWiki syntax](https://www.dokuwiki.org/wiki:syntax) to Hugo Markdown syntax. Includes extra's like the TODO plugin. Written with extensibility in mind using python 3. Also generates a TOML header for each page. Designed to copypaste the wiki directory into your /content directory.
|
- [dokuwiki-to-hugo](https://github.com/wgroeneveld/dokuwiki-to-hugo) - Migrates your DokuWiki source pages from [DokuWiki syntax](https://www.dokuwiki.org/wiki:syntax) to Hugo Markdown syntax. Includes extra's like the TODO plugin. Written with extensibility in mind using python 3. Also generates a TOML header for each page. Designed to copypaste the wiki directory into your /content directory.
|
||||||
|
|
||||||
## WordPress
|
## WordPress
|
||||||
|
|
||||||
- [wordpress-to-hugo-exporter](https://github.com/SchumacherFM/wordpress-to-hugo-exporter) - A one-click WordPress plugin that converts all posts, pages, taxonomies, metadata, and settings to Markdown and YAML which can be dropped into Hugo. (Note: If you have trouble using this plugin, you can [export your site for Jekyll](https://wordpress.org/plugins/jekyll-exporter/) and use Hugo's built in Jekyll converter listed above.)
|
- [wordpress-to-hugo-exporter](https://github.com/SchumacherFM/wordpress-to-hugo-exporter) - A one-click WordPress plugin that converts all posts, pages, taxonomies, metadata, and settings to Markdown and YAML which can be dropped into Hugo. (Note: If you have trouble using this plugin, you can [export your site for Jekyll](https://wordpress.org/plugins/jekyll-exporter/) and use Hugo's built in Jekyll converter listed above.)
|
||||||
- [exitwp-for-hugo](https://github.com/wooni005/exitwp-for-hugo) - A python script which works with the xml export from Wordpress and converts Wordpress pages and posts to Markdown and YAML for hugo.
|
- [exitwp-for-hugo](https://github.com/wooni005/exitwp-for-hugo) - A python script which works with the xml export from WordPress and converts WordPress pages and posts to Markdown and YAML for hugo.
|
||||||
- [blog2md](https://github.com/palaniraja/blog2md) - Works with [exported xml](https://en.support.wordpress.com/export/) file of your free YOUR-TLD.wordpress.com website. It also saves approved comments to `YOUR-POST-NAME-comments.md` file along with posts.
|
- [blog2md](https://github.com/palaniraja/blog2md) - Works with [exported xml](https://en.support.wordpress.com/export/) file of your free YOUR-TLD.wordpress.com website. It also saves approved comments to `YOUR-POST-NAME-comments.md` file along with posts.
|
||||||
- [wordhugopress](https://github.com/nantipov/wordhugopress) - A small utility written in Java, exports the entire WordPress site from the database and resource (e.g. images) files stored locally or remotelly. Therefore, migration from the backup files is possible. Supports merging of the multiple WordPress sites into a single Hugo one.
|
- [wordhugopress](https://github.com/nantipov/wordhugopress) - A small utility written in Java, exports the entire WordPress site from the database and resource (e.g. images) files stored locally or remotely. Therefore, migration from the backup files is possible. Supports merging of the multiple WordPress sites into a single Hugo one.
|
||||||
|
|
||||||
## Medium
|
## Medium
|
||||||
|
|
||||||
- [medium2md](https://github.com/gautamdhameja/medium-2-md) - A simple Medium to Hugo exporter able to import stories in one command, including Front Matter.
|
- [medium2md](https://github.com/gautamdhameja/medium-2-md) - A simple Medium to Hugo exporter able to import stories in one command, including Front Matter.
|
||||||
- [medium-to-hugo](https://github.com/bgadrian/medium-to-hugo) - CLI tool written in Go to export medium posts into a Hugo compatible Markdown format. Tags and images are included. All images will be downloaded locally and linked appropriately.
|
- [medium-to-hugo](https://github.com/bgadrian/medium-to-hugo) - CLI tool written in Go to export medium posts into a Hugo compatible Markdown format. Tags and images are included. All images will be downloaded locally and linked appropriately.
|
||||||
|
|
||||||
## Tumblr
|
## Tumblr
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ Alternatively, you can use the new [Jekyll import command](/commands/hugo_import
|
||||||
|
|
||||||
- [blogimport](https://github.com/natefinch/blogimport) - A tool to import from Blogger posts to Hugo.
|
- [blogimport](https://github.com/natefinch/blogimport) - A tool to import from Blogger posts to Hugo.
|
||||||
- [blogger-to-hugo](https://bitbucket.org/petraszd/blogger-to-hugo) - Another tool to import Blogger posts to Hugo. It also downloads embedded images so they will be stored locally.
|
- [blogger-to-hugo](https://bitbucket.org/petraszd/blogger-to-hugo) - Another tool to import Blogger posts to Hugo. It also downloads embedded images so they will be stored locally.
|
||||||
- [blog2md](https://github.com/palaniraja/blog2md) - Works with [exported xml](https://support.google.com/blogger/answer/41387?hl=en) file of your YOUR-TLD.blogspot.com website. It also saves comments to `YOUR-POST-NAME-comments.md` file along with posts.
|
- [blog2md](https://github.com/palaniraja/blog2md) - Works with [exported xml](https://support.google.com/blogger/answer/41387?hl=en) file of your YOUR-TLD.blogspot.com website. It also saves comments to `YOUR-POST-NAME-comments.md` file along with posts.
|
||||||
- [BloggerToHugo](https://github.com/huanlin/blogger-to-hugo) - Yet another tool to import Blogger posts to Hugo. For Windows platform only, and .NET Framework 4.5 is required. See README.md before using this tool.
|
- [BloggerToHugo](https://github.com/huanlin/blogger-to-hugo) - Yet another tool to import Blogger posts to Hugo. For Windows platform only, and .NET Framework 4.5 is required. See README.md before using this tool.
|
||||||
|
|
||||||
## Contentful
|
## Contentful
|
||||||
|
@ -84,4 +84,4 @@ Alternatively, you can use the new [Jekyll import command](/commands/hugo_import
|
||||||
|
|
||||||
## BlogML
|
## BlogML
|
||||||
|
|
||||||
- [BlogML2Hugo](https://github.com/jijiechen/BlogML2Hugo) - A tool that helps you convert BlogML xml file to Hugo markdown files. Users need to take care of links to attachments and images by themselves. This helps the blogs that export BlogML files (e.g. BlogEngine.NET) tramsform to hugo sites easily.
|
- [BlogML2Hugo](https://github.com/jijiechen/BlogML2Hugo) - A tool that helps you convert BlogML xml file to Hugo markdown files. Users need to take care of links to attachments and images by themselves. This helps the blogs that export BlogML files (e.g. BlogEngine.NET) transform to hugo sites easily.
|
||||||
|
|
|
@ -26,7 +26,7 @@ A static website with a dynamic search function? Yes, Hugo provides an alternati
|
||||||
* [hugo-lunr-zh](https://www.npmjs.com/package/hugo-lunr-zh). A bit like Hugo-lunr, but Hugo-lunr-zh can help you separate the Chinese keywords.
|
* [hugo-lunr-zh](https://www.npmjs.com/package/hugo-lunr-zh). A bit like Hugo-lunr, but Hugo-lunr-zh can help you separate the Chinese keywords.
|
||||||
* [Github Gist for Fuse.js integration](https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae). This gist demonstrates how to leverage Hugo's existing build time processing to generate a searchable JSON index used by [Fuse.js](https://fusejs.io/) on the client side. Although this gist uses Fuse.js for fuzzy matching, any client side search tool capable of reading JSON indexes will work. Does not require npm, grunt or other build-time tools except Hugo!
|
* [Github Gist for Fuse.js integration](https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae). This gist demonstrates how to leverage Hugo's existing build time processing to generate a searchable JSON index used by [Fuse.js](https://fusejs.io/) on the client side. Although this gist uses Fuse.js for fuzzy matching, any client side search tool capable of reading JSON indexes will work. Does not require npm, grunt or other build-time tools except Hugo!
|
||||||
* [hugo-search-index](https://www.npmjs.com/package/hugo-search-index). A library containing Gulp tasks and a prebuilt browser script that implements search. Gulp generates a search index from project markdown files.
|
* [hugo-search-index](https://www.npmjs.com/package/hugo-search-index). A library containing Gulp tasks and a prebuilt browser script that implements search. Gulp generates a search index from project markdown files.
|
||||||
* [hugofastsearch](https://gist.github.com/cmod/5410eae147e4318164258742dd053993). A usability and speed update to "Github Gist for Fuse.js integration" — global, keyboard-optimized search.
|
* [hugofastsearch](https://gist.github.com/cmod/5410eae147e4318164258742dd053993). A usability and speed update to "GitHub Gist for Fuse.js integration" — global, keyboard-optimized search.
|
||||||
|
|
||||||
## Commercial Search Services
|
## Commercial Search Services
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
title: Troubleshoot
|
title: Troubleshoot
|
||||||
linktitle: Troubleshoot
|
linktitle: Troubleshoot
|
||||||
description: Frequently asked questions and known issues pulled from the Hugo Discuss forum.
|
description: Frequently asked questions and known issues pulled from the Hugo Discuss forum.
|
||||||
date: 2017-02-01
|
date: 2017-02-01
|
||||||
|
@ -9,7 +9,7 @@ menu:
|
||||||
docs:
|
docs:
|
||||||
parent: "troubleshooting"
|
parent: "troubleshooting"
|
||||||
weight: 1
|
weight: 1
|
||||||
weight: 1
|
weight: 1
|
||||||
draft: false
|
draft: false
|
||||||
hidesectioncontents: false
|
hidesectioncontents: false
|
||||||
slug:
|
slug:
|
||||||
|
@ -20,7 +20,4 @@ notesforauthors:
|
||||||
|
|
||||||
The Troubleshooting section includes known issues, recent workarounds, and FAQs pulled from the [Hugo Discussion Forum][forum].
|
The Troubleshooting section includes known issues, recent workarounds, and FAQs pulled from the [Hugo Discussion Forum][forum].
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[forum]: https://discourse.gohugo.io
|
[forum]: https://discourse.gohugo.io
|
||||||
|
|
|
@ -19,7 +19,7 @@ aliases: [/faq/]
|
||||||
|
|
||||||
## I can't see my content!
|
## I can't see my content!
|
||||||
|
|
||||||
Is your markdown file [in draft mode](https://gohugo.io/content-management/front-matter/#front-matter-variables)? When testing, run `hugo server` with the `-D` or `--buildDrafts` [switch](https://gohugo.io/getting-started/usage/#draft-future-and-expired-content).
|
Is your markdown file [in draft mode](https://gohugo.io/content-management/front-matter/#front-matter-variables)? When testing, run `hugo server` with the `-D` or `--buildDrafts` [switch](https://gohugo.io/getting-started/usage/#draft-future-and-expired-content).
|
||||||
|
|
||||||
## Can I set configuration variables via OS environment?
|
## Can I set configuration variables via OS environment?
|
||||||
|
|
||||||
|
|
|
@ -33,9 +33,9 @@ The `.File` object contains the following fields:
|
||||||
.File.TranslationBaseName
|
.File.TranslationBaseName
|
||||||
: the filename without extension or optional language identifier (e.g., `foo`)
|
: the filename without extension or optional language identifier (e.g., `foo`)
|
||||||
|
|
||||||
.File.ContentBaseName
|
.File.ContentBaseName
|
||||||
: is a either TranslationBaseName or name of containing folder if file is a leaf bundle.
|
: is a either TranslationBaseName or name of containing folder if file is a leaf bundle.
|
||||||
|
|
||||||
.File.BaseFileName
|
.File.BaseFileName
|
||||||
: the filename without extension (e.g., `foo.en`)
|
: the filename without extension (e.g., `foo.en`)
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ wip: false
|
||||||
---
|
---
|
||||||
|
|
||||||
{{% warning "Deprecated" %}}
|
{{% warning "Deprecated" %}}
|
||||||
Page's `.Hugo` is deprecated and will be removed in a future release. Use the global `hugo` function.
|
Page's `.Hugo` is deprecated and will be removed in a future release. Use the global `hugo` function.
|
||||||
For example: `hugo.Generator`.
|
For example: `hugo.Generator`.
|
||||||
{{% /warning %}}
|
{{% /warning %}}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
date = "2017-02-19"
|
date = "2017-02-19"
|
||||||
|
|
||||||
[[article]]
|
[[article]]
|
||||||
title = "Switching from Wordpress to Hugo"
|
title = "Switching from WordPress to Hugo"
|
||||||
url = "http://schnuddelhuddel.de/switching-from-wordpress-to-hugo/"
|
url = "http://schnuddelhuddel.de/switching-from-wordpress-to-hugo/"
|
||||||
author = "Mario Martelli"
|
author = "Mario Martelli"
|
||||||
date = "2017-02-19"
|
date = "2017-02-19"
|
||||||
|
@ -119,7 +119,7 @@
|
||||||
date = "2016-09-21"
|
date = "2016-09-21"
|
||||||
|
|
||||||
[[article]]
|
[[article]]
|
||||||
title = "Building our site: From Django & Wordpress to a static generator (Part I)"
|
title = "Building our site: From Django & WordPress to a static generator (Part I)"
|
||||||
url = "https://tryolabs.com/blog/2016/09/20/building-our-site-django-wordpress-to-static-part-i/"
|
url = "https://tryolabs.com/blog/2016/09/20/building-our-site-django-wordpress-to-static-part-i/"
|
||||||
author = "Alan Descoins"
|
author = "Alan Descoins"
|
||||||
date = "2016-09-20"
|
date = "2016-09-20"
|
||||||
|
|
|
@ -3,7 +3,7 @@ publish = "public"
|
||||||
command = "hugo --gc --minify"
|
command = "hugo --gc --minify"
|
||||||
|
|
||||||
[context.production.environment]
|
[context.production.environment]
|
||||||
HUGO_VERSION = "0.71.1"
|
HUGO_VERSION = "0.72.0"
|
||||||
HUGO_ENV = "production"
|
HUGO_ENV = "production"
|
||||||
HUGO_ENABLEGITINFO = "true"
|
HUGO_ENABLEGITINFO = "true"
|
||||||
|
|
||||||
|
@ -11,20 +11,20 @@ HUGO_ENABLEGITINFO = "true"
|
||||||
command = "hugo --gc --minify --enableGitInfo"
|
command = "hugo --gc --minify --enableGitInfo"
|
||||||
|
|
||||||
[context.split1.environment]
|
[context.split1.environment]
|
||||||
HUGO_VERSION = "0.71.1"
|
HUGO_VERSION = "0.72.0"
|
||||||
HUGO_ENV = "production"
|
HUGO_ENV = "production"
|
||||||
|
|
||||||
[context.deploy-preview]
|
[context.deploy-preview]
|
||||||
command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
|
command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
|
||||||
|
|
||||||
[context.deploy-preview.environment]
|
[context.deploy-preview.environment]
|
||||||
HUGO_VERSION = "0.71.1"
|
HUGO_VERSION = "0.72.0"
|
||||||
|
|
||||||
[context.branch-deploy]
|
[context.branch-deploy]
|
||||||
command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
|
command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
|
||||||
|
|
||||||
[context.branch-deploy.environment]
|
[context.branch-deploy.environment]
|
||||||
HUGO_VERSION = "0.71.1"
|
HUGO_VERSION = "0.72.0"
|
||||||
|
|
||||||
[context.next.environment]
|
[context.next.environment]
|
||||||
HUGO_ENABLEGITINFO = "true"
|
HUGO_ENABLEGITINFO = "true"
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 83 KiB |
Binary file not shown.
After Width: | Height: | Size: 142 KiB |
Loading…
Reference in a new issue