mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-19 21:21:39 +02:00
Merge commit '35febb2e2a3780c3338a2665fddea7dda28a17f4'
This commit is contained in:
@@ -115,7 +115,7 @@ defaultContentLanguageInSubdir (false)
|
||||
: Render the default content language in subdir, e.g. `content/en/`. The site root `/` will then redirect to `/en/`.
|
||||
|
||||
disableAliases (false)
|
||||
: Will disable generation of alias redirects. Note that even if `disableAliases` is set, the aliases themselves are preserved on the page. The motivation with this is to be able to generate 301 redirects in an `.htacess`, a Netlify `_redirects` file or similar using a custom output format.
|
||||
: Will disable generation of alias redirects. Note that even if `disableAliases` is set, the aliases themselves are preserved on the page. The motivation with this is to be able to generate 301 redirects in an `.htaccess`, a Netlify `_redirects` file or similar using a custom output format.
|
||||
|
||||
disableHugoGeneratorInject (false)
|
||||
: Hugo will, by default, inject a generator meta tag in the HTML head on the _home page only_. You can turn it off, but we would really appreciate if you don't, as this is a good way to watch Hugo's popularity on the rise.
|
||||
@@ -265,6 +265,9 @@ timeout (10000)
|
||||
title ("")
|
||||
: Site title.
|
||||
|
||||
titleCaseStyle ("AP")
|
||||
: See [Configure Title Case](#configure-title-case)
|
||||
|
||||
uglyURLs (false)
|
||||
: When enabled, creates URL of the form `/filename.html` instead of `/filename/`.
|
||||
|
||||
@@ -291,6 +294,10 @@ enableemoji: true
|
||||
```
|
||||
{{% /note %}}
|
||||
|
||||
## 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).
|
||||
|
||||
## Configuration Environment Variables
|
||||
|
||||
HUGO_NUMWORKERMULTIPLIER
|
||||
@@ -498,5 +505,5 @@ dir
|
||||
[Output Formats]: /templates/output-formats/
|
||||
[templates]: /templates/
|
||||
[toml]: https://github.com/toml-lang/toml
|
||||
[yaml]: http://yaml.org/spec/
|
||||
[yaml]: https://yaml.org/spec/
|
||||
[static-files]: /content-management/static-files/
|
||||
|
@@ -27,8 +27,7 @@ Running the `hugo new site` generator from the command line will create a direct
|
||||
```
|
||||
.
|
||||
├── archetypes
|
||||
├── assets
|
||||
├── config
|
||||
├── config.toml
|
||||
├── content
|
||||
├── data
|
||||
├── layouts
|
||||
@@ -46,14 +45,14 @@ The following is a high-level overview of each of the directories with links to
|
||||
By default, Hugo will create new content files with at least `date`, `title` (inferred from the file name), 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`][]
|
||||
: Stores all the files which need be processed by [Hugo Pipes]({{< ref "/hugo-pipes" >}}). Only the files whose `.Permalink` or `.RelPermalink` are used will be published to the `public` directory.
|
||||
: Stores all the files which need be processed by [Hugo Pipes]({{< ref "/hugo-pipes" >}}). Only the files whose `.Permalink` or `.RelPermalink` are used will be published to the `public` directory. Note: assets directory is not created by default.
|
||||
|
||||
[`config`](/getting-started/configuration/)
|
||||
: Hugo ships with a large number of [configuration directives](https://gohugo.io/getting-started/configuration/#all-variables-yaml).
|
||||
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.
|
||||
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][].
|
||||
|
@@ -54,6 +54,16 @@ brew install hugo
|
||||
|
||||
For more detailed explanations, read the installation guides that follow for installing on macOS and Windows.
|
||||
|
||||
### Linuxbrew (Linux)
|
||||
|
||||
If you are on Linux and using [Linuxbrew][linuxbrew], you can install Hugo with the following one-liner:
|
||||
|
||||
{{< code file="install-with-linuxbrew.sh" >}}
|
||||
brew install hugo
|
||||
{{< /code >}}
|
||||
|
||||
Installation guides for Linuxbrew are available on their [website][linuxbrew].
|
||||
|
||||
### Chocolatey (Windows)
|
||||
|
||||
If you are on a Windows machine and use [Chocolatey][] for package management, you can install Hugo with the following one-liner:
|
||||
@@ -437,7 +447,7 @@ To install the non-extended version without Sass/SCSS support:
|
||||
To switch between the two, use either `snap refresh hugo --channel=extended` or `snap refresh hugo --channel=stable`.
|
||||
|
||||
{{% note %}}
|
||||
Hugo-as-a-snap can write only inside the user’s `$HOME` directory---and gvfs-mounted directories owned by the user---because of Snaps’ confinement and security model. More information is also available [in this related GitHub issue](https://github.com/gohugoio/hugo/issues/3143). Use ```sudo snap install hugo --classic``` to disable the default security model if you want hugo to be able to have write access in other paths besides the user’s `$HOME` directory.
|
||||
Hugo installed via Snap can write only inside the user’s `$HOME` directory---and gvfs-mounted directories owned by the user---because of Snaps’ confinement and security model. More information is also available [in this related GitHub issue](https://github.com/gohugoio/hugo/issues/3143).
|
||||
{{% /note %}}
|
||||
|
||||
### Debian and Ubuntu
|
||||
@@ -507,6 +517,7 @@ Now that you've installed Hugo, read the [Quick Start guide][quickstart] and exp
|
||||
[highlight shortcode]: /content-management/shortcodes/#highlight
|
||||
[installgit]: http://git-scm.com/
|
||||
[installgo]: https://golang.org/dl/
|
||||
[linuxbrew]: https://linuxbrew.sh/
|
||||
[Path Editor]: https://patheditor2.codeplex.com/
|
||||
[pygments]: http://pygments.org
|
||||
[quickstart]: /getting-started/quick-start/
|
||||
|
@@ -83,16 +83,27 @@ echo 'theme = "ananke"' >> config.toml
|
||||
|
||||
{{< asciicast 7naKerRYUGVPj8kiDmdh5k5h9 >}}
|
||||
|
||||
|
||||
## 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 `new` commend to do few things for you (like add title and date):
|
||||
|
||||
```
|
||||
hugo new posts/my-first-post.md
|
||||
```
|
||||
|
||||
{{< asciicast eUojYCfRTZvkEiqc52fUsJRBR >}}
|
||||
|
||||
Edit the newly created content file if you want, it will start with something like this:
|
||||
|
||||
Edit the newly created content file if you want.
|
||||
```markdown
|
||||
---
|
||||
title: "My First Post"
|
||||
date: 2019-03-26T08:47:11+01:00
|
||||
draft: true
|
||||
---
|
||||
|
||||
```
|
||||
|
||||
|
||||
## Step 5: Start the Hugo server
|
||||
@@ -130,6 +141,8 @@ Press Ctrl+C to stop
|
||||
|
||||
**Navigate to your new site at [http://localhost:1313/](http://localhost:1313/).**
|
||||
|
||||
Feel free to edit or add new content and simply refresh in browser to see changes quickly (You might need to force refresh in webbrowser, something like Ctrl-R usually works).
|
||||
|
||||
|
||||
## Step 6: Customize the Theme
|
||||
|
||||
@@ -157,3 +170,13 @@ For theme specific configuration options, see the [theme site](https://github.co
|
||||
|
||||
**For further theme customization, see [Customize a Theme](/themes/customizing/).**
|
||||
|
||||
|
||||
### Step 7: Build static pages
|
||||
|
||||
It is simple. Just call:
|
||||
|
||||
```
|
||||
hugo
|
||||
```
|
||||
|
||||
Output will be in `./public/` directory by default (`-d`/`--destination` flag to change it, or set `publishdir` in the config file).
|
||||
|
Reference in New Issue
Block a user