diff options
Diffstat (limited to 'docs/content/en/getting-started')
-rw-r--r-- | docs/content/en/getting-started/_index.md | 2 | ||||
-rw-r--r-- | docs/content/en/getting-started/configuration.md | 23 | ||||
-rw-r--r-- | docs/content/en/getting-started/directory-structure.md | 22 | ||||
-rw-r--r-- | docs/content/en/getting-started/quick-start.md | 9 |
4 files changed, 24 insertions, 32 deletions
diff --git a/docs/content/en/getting-started/_index.md b/docs/content/en/getting-started/_index.md index bffc2e1b7..f953abb22 100644 --- a/docs/content/en/getting-started/_index.md +++ b/docs/content/en/getting-started/_index.md @@ -15,7 +15,7 @@ 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. +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. [installed]: /installation/ [quick start]: /getting-started/quick-start/ diff --git a/docs/content/en/getting-started/configuration.md b/docs/content/en/getting-started/configuration.md index 5a65dcdfc..39f27453f 100644 --- a/docs/content/en/getting-started/configuration.md +++ b/docs/content/en/getting-started/configuration.md @@ -554,7 +554,7 @@ force = false Setting `force=true` will make a redirect even if there is existing content in the path. Note that before Hugo 0.76 `force` was the default behavior, but this is inline with how Netlify does it. -## 404 Server Error Page +## 404 Server Error Page {#_404-server-error-page} {{< new-in "0.103.0" >}} @@ -567,19 +567,6 @@ Hugo will, by default, render all 404 errors when running `hugo server` with the status = 404 ``` -## 404 Server Error Page - -{{< new-in "0.103.0" >}} - -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](#server-config), you need to add the 404 redirect explicitly, e.g: - -```toml -[[redirects]] - from = "/**" - to = "/404.html" - status = 404 -``` - ## 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). @@ -591,7 +578,7 @@ HUGO_NUMWORKERMULTIPLIER ## Configuration Lookup Order -Similar to the template [lookup order][], Hugo has a default set of rules for searching for a configuration file in the root of your website's source directory as a default behavior: +Similar to the template [lookup order], Hugo has a default set of rules for searching for a configuration file in the root of your website's source directory as a default behavior: 1. `./config.toml` 2. `./config.yaml` @@ -602,7 +589,7 @@ In your `config` file, you can direct Hugo as to how you want your website rende ## Example Configuration -The following is a typical example of a configuration file. The values nested under `params:` will populate the [`.Site.Params`][] variable for use in [templates][]: +The following is a typical example of a configuration file. The values nested under `params:` will populate the [`.Site.Params`] variable for use in [templates]: {{< code-toggle file="config">}} baseURL: "https://yoursite.example.com/" @@ -645,6 +632,8 @@ Test and document setting params via JSON env var. ## Ignore Content and Data Files when Rendering +**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 ignore files ending with `.foo` or `.boo`: @@ -721,7 +710,7 @@ The above will try first to extract the value for `.Date` from the filename, the ## Configure Additional Output Formats -Hugo v0.20 introduced the ability to render your content to multiple output formats (e.g., to JSON, AMP html, or CSV). See [Output Formats][] for information on how to add these values to your Hugo project's configuration file. +Hugo v0.20 introduced the ability to render your content to multiple output formats (e.g., to JSON, AMP html, or CSV). See [Output Formats] for information on how to add these values to your Hugo project's configuration file. ## Configure Minify diff --git a/docs/content/en/getting-started/directory-structure.md b/docs/content/en/getting-started/directory-structure.md index d9f163498..b8c22b1df 100644 --- a/docs/content/en/getting-started/directory-structure.md +++ b/docs/content/en/getting-started/directory-structure.md @@ -42,36 +42,36 @@ The following is a high-level overview of each of the directories with links to [`archetypes`](/content-management/archetypes/) : You can create new content files in Hugo using the `hugo new` command. -By default, Hugo will create new content files with at least `date`, `title` (inferred from the filename), and `draft = true`. This saves time and promotes consistency for sites using multiple content types. You can create your own [archetypes][] with custom preconfigured front matter fields as well. +By default, Hugo will create new content files with at least `date`, `title` (inferred from the filename), and `draft = true`. This saves time and promotes consistency for sites using multiple content types. You can create your own [archetypes] with custom preconfigured front matter fields as well. -[`assets`][] +[`assets`] : Stores all the files which need be processed by [Hugo Pipes](/hugo-pipes/). Only the files whose `.Permalink` or `.RelPermalink` are used will be published to the `public` directory. [`config`](/getting-started/configuration/) -: Hugo ships with a large number of [configuration directives][]. +: Hugo ships with a large number of [configuration directives]. The [config directory](/getting-started/configuration/#configuration-directory) is where those directives are stored as JSON, YAML, or TOML files. Every root setting object can stand as its own file and structured by environments. Projects with minimal settings and no need for environment awareness can use a single `config.toml` file at its root. -Many sites may need little to no configuration, but Hugo ships with a large number of [configuration directives][] for more granular directions on how you want Hugo to build your website. Note: config directory is not created by default. +Many sites may need little to no configuration, but Hugo ships with a large number of [configuration directives] for more granular directions on how you want Hugo to build your website. Note: config directory is not created by default. -[`content`][] -: All content for your website will live inside this directory. Each top-level folder in Hugo is considered a [content section][]. For example, if your site has three main sections---`blog`, `articles`, and `tutorials`---you will have three directories at `content/blog`, `content/articles`, and `content/tutorials`. Hugo uses sections to assign default [content types][]. +[`content`] +: All content for your website will live inside this directory. Each top-level folder in Hugo is considered a [content section]. For example, if your site has three main sections---`blog`, `articles`, and `tutorials`---you will have three directories at `content/blog`, `content/articles`, and `content/tutorials`. Hugo uses sections to assign default [content types]. [`data`](/templates/data-templates/) : This directory is used to store configuration files that can be -used by Hugo when generating your website. You can write these files in YAML, JSON, or TOML format. In addition to the files you add to this folder, you can also create [data templates][] that pull from dynamic content. +used by Hugo when generating your website. You can write these files in YAML, JSON, or TOML format. In addition to the files you add to this folder, you can also create [data templates] that pull from dynamic content. -[`layouts`][] -: Stores templates in the form of `.html` files that specify how views of your content will be rendered into a static website. Templates include [list pages][lists], your [homepage][], [taxonomy templates][], [partials][], [single page templates][singles], and more. +[`layouts`] +: Stores templates in the form of `.html` files that specify how views of your content will be rendered into a static website. Templates include [list pages][lists], your [homepage], [taxonomy templates], [partials], [single page templates][singles], and more. -[`static`][] +[`static`] : Stores all the static content: images, CSS, JavaScript, etc. When Hugo builds your site, all assets inside your static directory are copied over as-is. A good example of using the `static` folder is for [verifying site ownership on Google Search Console][searchconsole], where you want Hugo to copy over a complete HTML file without modifying its content. {{% note %}} From **Hugo 0.31** you can have multiple static directories. {{% /note %}} -[`resources`][] +[`resources`] : 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/ diff --git a/docs/content/en/getting-started/quick-start.md b/docs/content/en/getting-started/quick-start.md index 829800048..824d6030a 100644 --- a/docs/content/en/getting-started/quick-start.md +++ b/docs/content/en/getting-started/quick-start.md @@ -33,9 +33,13 @@ You must also be comfortable working from the command line. ### Commands -Run these commands[^1] to create a Hugo site with the [Ananke] theme. The next section provides an explanation of each command. +{{% note %}} +If you are a Windows user, you must run these commands with [PowerShell]. You cannot use Windows Powershell, which is a different application, or the Command Prompt. You may also use a Linux shell if available. -[^1]: If you are a Windows user, you must run these commands with [PowerShell]. You cannot use Windows Powershell, which is a different application, or the Command Prompt. +[PowerShell]: https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows +{{% /note %}} + +Run these commands to create a Hugo site with the [Ananke] theme. The next section provides an explanation of each command. ```text hugo new site quickstart @@ -210,7 +214,6 @@ For other resources to help you learn Hugo, including books and video tutorials, [hosting and deployment]: /hosting-and-deployment/ [Install Git]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git [Install Hugo]: /installation/ -[PowerShell]: https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows [Requesting Help]: https://discourse.gohugo.io/t/requesting-help/9132 [Requesting Help]: https://discourse.gohugo.io/t/requesting-help/9132 [site configuration]: /getting-started/configuration/ |