Merge commit 'f96384a3b596f9bc0a3a035970b09b2c601f0ccb'

This commit is contained in:
Bjørn Erik Pedersen
2023-05-22 16:47:07 +02:00
341 changed files with 3107 additions and 4238 deletions

View File

@@ -2,17 +2,14 @@
title: Get Started
linktitle: Get Started Overview
description: Quick start and guides for installing Hugo on your preferred operating system.
date: 2017-02-01
publishdate: 2017-02-01
categories: [getting started]
keywords: [usage,docs]
menu:
docs:
parent: "getting-started"
parent: getting-started
weight: 1
weight: 0001 #rem
weight: 0001
aliases: [/overview/introduction/]
toc: false
---
If this is your first time using Hugo and you've [already installed Hugo on your machine][installed], we recommend the [quick start]. You can also use [external learning resources] to learn Hugo.

View File

@@ -1,11 +1,9 @@
---
title: Configure Markup
description: How to handle Markdown and other markup related configuration.
date: 2019-11-15
categories: [getting started,fundamentals]
keywords: [configuration,highlighting]
weight: 65
sections_weight: 65
slug: configuration-markup
toc: true
---

View File

@@ -2,16 +2,13 @@
title: Configure Hugo
linktitle: Configuration
description: How to configure your Hugo site.
date: 2013-07-01
publishdate: 2017-01-02
categories: [getting started,fundamentals]
keywords: [configuration,toml,yaml,json]
menu:
docs:
parent: "getting-started"
parent: getting-started
weight: 60
weight: 60
sections_weight: 60
aliases: [/overview/source-directory/,/overview/configuration/]
toc: true
---
@@ -35,11 +32,9 @@ hugo --config a.toml,b.toml,c.toml
Multiple site config files can be specified as a comma-separated string to the `--config` switch.
{{% /note %}}
{{< todo >}}TODO: distinct config.toml and others (the root object files){{< /todo >}}
## hugo.toml vs config.toml
In Hugo 0.110.0 we changed the default config base filename to `hugo`, e.g. `hugo.toml`. We will still look for `config.toml` etc., but we recommend you eventually rename it (but you need to wait if you want to support older Hugo versions). The main reason we're doing this is to make it easier code editors and build tools to identify this as a Hugo configuration file and project.
In Hugo 0.110.0 we changed the default config base filename to `hugo`, e.g. `hugo.toml`. We will still look for `config.toml` etc., but we recommend you eventually rename it (but you need to wait if you want to support older Hugo versions). The main reason we're doing this is to make it easier for code editors and build tools to identify this as a Hugo configuration file and project.
{{< new-in "0.110.0" >}}
@@ -88,7 +83,7 @@ Let's take an example to understand this better. Let's say you are using Google
- `G-SSSSSSSS` for staging
This is how you need to configure your `config.toml` files considering the above scenario:
1. In `_default/config.toml` you don't need to mention `googleAnalytics` parameter at all. This ensures that no Google Analytics code is loaded in your development server i.e. when you run `hugo serve`. This works since, by default Hugo sets `Environment=development` when you run `hugo serve` which uses the config files from `_default` folder
1. In `_default/config.toml` you don't need to mention `googleAnalytics` parameter at all. This ensures that no Google Analytics code is loaded in your development server i.e. when you run `hugo server`. This works since, by default Hugo sets `Environment=development` when you run `hugo server` which uses the config files from `_default` folder
2. In `production/config.toml` you just need to have one line:
```googleAnalytics = "G-PPPPPPPP"```
@@ -140,7 +135,7 @@ The directory where Hugo finds asset files used in [Hugo Pipes](/hugo-pipes/). {
### baseURL
Hostname (and path) to the root, e.g. https://bep.is/
The absolute URL (protocol, host, path, and trailing slash) of your published site (e.g., `https://www.example.org/docs/`).
### build
@@ -321,7 +316,7 @@ See [Configure Media Types](/templates/output-formats/#media-types).
### menus
See [Add Non-content Entries to a Menu](/content-management/menus/#add-non-content-entries-to-a-menu).
See [Menus](/content-management/menus/#define-in-site-configuration).
### minify
@@ -419,7 +414,7 @@ Maximum number of items in the RSS feed.
### sectionPagesMenu
See ["Section Menu for Lazy Bloggers"](/templates/menu-templates/#section-menu-for-lazy-bloggers).
See [Menus](/content-management/menus/#define-in-site-configuration).
### security
@@ -571,16 +566,22 @@ Setting `force=true` will make a redirect even if there is existing content in t
Hugo will, by default, render all 404 errors when running `hugo server` with the `404.html` template. Note that if you have already added one or more redirects to your [Server Config](#configure-server), you need to add the 404 redirect explicitly, e.g:
```toml
{{< code-toggle file="config/development/server" copy=false >}}
[[redirects]]
from = "/**"
to = "/404.html"
status = 404
```
from = "/**"
to = "/404.html"
status = 404
{{< /code-toggle >}}
## Configure Title Case
Set `titleCaseStyle` to specify the title style used by the [title](/functions/title/) template function and the automatic section titles in Hugo. It defaults to [AP Stylebook](https://www.apstylebook.com/) for title casing, but you can also set it to `Chicago` or `Go` (every word starts with a capital letter).
Set `titleCaseStyle` to specify the title style used by the [title](/functions/title/) template function and the automatic section titles in Hugo.
By default, Hugo adheres to the capitalization rules in the [Associated Press (AP) Stylebook]. Set `titleCaseStyle` to `chicago` if you would prefer to follow the [Chicago Manual of Style], or set if to `go` to use Go's convention of capitalizing every word.
[Associated Press (AP) Stylebook]: https://www.apstylebook.com/
[Chicago Manual of Style]: https://www.chicagomanualofstyle.org/home.html
[site configuration]: /getting-started/configuration/#configure-title-case
## Configuration Environment Variables
@@ -629,7 +630,7 @@ $ env HUGO_TITLE="Some Title" hugo
This is really useful if you use a service such as Netlify to deploy your site. Look at the Hugo docs [Netlify configuration file](https://github.com/gohugoio/hugoDocs/blob/master/netlify.toml) for an example.
{{% note "Setting Environment Variables" %}}
{{% note %}}
Names must be prefixed with `HUGO_` and the configuration key must be set in uppercase when setting operating system environment variables.
To set config params, prefix the name with `HUGO_PARAMS_`
@@ -645,17 +646,17 @@ Test and document setting params via JSON env var.
**Note:** This works, but we recommend you use the newer and more powerful [includeFiles and excludeFiles](https://gohugo.io/hugo-modules/configuration/#module-config-mounts) mount options.
To exclude specific files from the `content` and `data` directories when rendering your site, set `ignoreFiles` to one or more regular expressions to match against the absolute file path.
To exclude specific files from the `content`, `data`, and `i18n` directories when rendering your site, set `ignoreFiles` to one or more regular expressions to match against the absolute file path.
To ignore files ending with `.foo` or `.boo`:
{{< code-toggle copy="false" >}}
{{< code-toggle copy=false >}}
ignoreFiles = ['\.foo$', '\.boo$']
{{< /code-toggle >}}
To ignore a file using the absolute file path:
{{< code-toggle copy="false" >}}
{{< code-toggle copy=false >}}
ignoreFiles = ['^/home/user/project/content/test\.md$']
{{< /code-toggle >}}

View File

@@ -1,17 +1,13 @@
---
title: Directory Structure
linktitle: Directory Structure
description: Hugo's CLI scaffolds a project directory structure and then takes that single directory and uses it as the input to create a complete website.
date: 2017-01-02
publishdate: 2017-02-01
categories: [getting started,fundamentals]
keywords: [source, organization, directories]
menu:
docs:
parent: "getting-started"
parent: getting-started
weight: 50
weight: 50
sections_weight: 50
aliases: [/overview/source-directory/]
toc: true
---
@@ -75,7 +71,7 @@ From **Hugo 0.31** you can have multiple static directories.
: Caches some files to speed up generation. Can be also used by template authors to distribute built Sass files, so you don't have to have the preprocessor installed. Note: resources directory is not created by default.
[archetypes]: /content-management/archetypes/
[`assets`]: /hugo-pipes/introduction#asset-directory/
[`assets`]: /hugo-pipes/introduction#asset-directory
[configuration directives]: /getting-started/configuration/#all-configuration-settings
[`content`]: /content-management/organization/
[content section]: /content-management/sections/
@@ -85,7 +81,7 @@ From **Hugo 0.31** you can have multiple static directories.
[`layouts`]: /templates/
[`static`]: /content-management/static-files/
[`resources`]: /getting-started/configuration/#configure-file-caches
[lists]: /templates/list/
[lists]: /templates/lists/
[pagevars]: /variables/page/
[partials]: /templates/partials/
[searchconsole]: https://support.google.com/webmasters/answer/9008080#zippy=%2Chtml-file-upload

View File

@@ -1,19 +1,12 @@
---
title: External Learning Resources
linktitle: External Learning Resources
description: A list of tutorials and books on Hugo.
date: 2019-10-20
publishdate: 2019-10-20
lastmod: 2019-10-20
keywords: [books, tutorials, learning, usage]
menu:
docs:
parent: "getting-started"
parent: getting-started
weight: 70
weight: 70
sections_weight: 70
draft: false
toc: false
---
## Books

View File

@@ -1,6 +1,5 @@
---
title: Quick Start
linktitle: Quick Start
description: Learn to create a Hugo site in minutes.
categories: [getting started]
keywords: [quick start,usage]

View File

@@ -1,15 +1,13 @@
---
title: Basic usage
linktitle: Basic usage
description: Hugo's command line interface (CLI) is fully featured but simple to use, even for those with limited experience working from the command line.
categories: [getting started]
keywords: [usage,livereload,command,flags]
menu:
docs:
parent: "getting-started"
parent: getting-started
weight: 40
weight: 40
sections_weight: 40
aliases: [/overview/usage/,/extras/livereload/,/doc/usage/,/usage/]
toc: true
---