mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Merge commit 'd2b1030060d3c91d5f9ffa3456418da16bd74f1d'
This commit is contained in:
@@ -48,7 +48,8 @@ See [Partial Templates][partials] to learn how to add the Disqus partial to your
|
||||
There are a few alternatives to commenting on static sites for those who do not want to use Disqus:
|
||||
|
||||
* [Static Man](https://staticman.net/)
|
||||
* [txtpen](https://txtpen.com)
|
||||
* [Talkyard](https://www.talkyard.io/blog-comments) (Open source, & serverless hosting)
|
||||
* [txtpen](https://txtpen.github.io/hn/)
|
||||
* [IntenseDebate](http://intensedebate.com/)
|
||||
* [Graph Comment][]
|
||||
* [Muut](http://muut.com/)
|
||||
|
@@ -219,6 +219,7 @@ Markdown syntax is simple enough to learn in a single sitting. The following are
|
||||
* [Daring Fireball: Markdown, John Gruber (Creator of Markdown)][fireball]
|
||||
* [Markdown Cheatsheet, Adam Pritchard][mdcheatsheet]
|
||||
* [Markdown Tutorial (Interactive), Garen Torikian][mdtutorial]
|
||||
* [The Markdown Guide, Matt Cone][mdguide]
|
||||
|
||||
[`emojify` function]: /functions/emojify/
|
||||
[ascii]: http://asciidoctor.org/
|
||||
@@ -237,6 +238,7 @@ Markdown syntax is simple enough to learn in a single sitting. The following are
|
||||
[ietf]: https://tools.ietf.org/html/
|
||||
[mathjaxdocs]: https://docs.mathjax.org/en/latest/
|
||||
[mdcheatsheet]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet
|
||||
[mdguide]: https://www.markdownguide.org/
|
||||
[mdtutorial]: http://www.markdowntutorial.com/
|
||||
[Miek Gieben's website]: https://miek.nl/2016/March/05/mmark-syntax-document/
|
||||
[mmark]: https://github.com/miekg/mmark
|
||||
|
@@ -115,7 +115,7 @@ url
|
||||
the multilingual feature.
|
||||
|
||||
weight
|
||||
: used for [ordering your content in lists][ordering].
|
||||
: used for [ordering your content in lists][ordering]. Lower weight gets higher precedence. So content with lower weight will come first.
|
||||
|
||||
\<taxonomies\>
|
||||
: field name of the *plural* form of the index. See `tags` and `categories` in the above front matter examples. _Note that the plural form of user-defined taxonomies cannot be the same as any of the predefined front matter variables._
|
||||
|
@@ -166,7 +166,7 @@ All of the above settings can also be set per image procecssing.
|
||||
|
||||
## Smart Cropping of Images
|
||||
|
||||
By default, Hugo will use the [Smartcrop](https://github.com/muesli/smartcrop), a library created by [muesli](https://github.com/muesli), when cropping images with `.Fill`. You can set the anchor point manually, but in most cases the smart option will make a good choice. And we will work with the libray author to improve this in the future.
|
||||
By default, Hugo will use the [Smartcrop](https://github.com/muesli/smartcrop), a library created by [muesli](https://github.com/muesli), when cropping images with `.Fill`. You can set the anchor point manually, but in most cases the smart option will make a good choice. And we will work with the library author to improve this in the future.
|
||||
|
||||
An example using the sunset image from above:
|
||||
|
||||
|
@@ -116,7 +116,7 @@ From the example above:
|
||||
- `documents/photo_specs.pdf` will get the `photo` icon.
|
||||
- `documents/checklist.pdf`, `documents/guide.pdf` and `documents/payment.docx` will get `Title` as set by `title`.
|
||||
- Every `PDF` in the bundle except `documents/photo_specs.pdf` will get the `pdf` icon.
|
||||
- All `PDF` files will get a new `Name`. The `name` parameter contains a special placeholder [`:counter`](#counter), so the `Name` will be `pdf-file-1`, `pdf-file-2`, `pdf-file-3`.
|
||||
- All `PDF` files will get a new `Name`. The `name` parameter contains a special placeholder [`:counter`](#the-counter-placeholder-in-name-and-title), so the `Name` will be `pdf-file-1`, `pdf-file-2`, `pdf-file-3`.
|
||||
- Every docx in the bundle will receive the `word` icon.
|
||||
|
||||
{{% warning %}}
|
||||
|
@@ -36,7 +36,7 @@ To list up to 5 related pages is as simple as including something similar to thi
|
||||
|
||||
|
||||
{{% note %}}
|
||||
Read [this blog article](https://regisphilibert.com/blog/2018/04/hugo-optmized-relashionships-with-related-content/) for a great explanation more advanced usage of this feature.
|
||||
Read [this blog article](https://regisphilibert.com/blog/2018/04/hugo-optmized-relashionships-with-related-content/) for a great explanation of more advanced usage of this feature.
|
||||
{{% /note %}}
|
||||
|
||||
The full set of methods available on the page lists can bee seen in this Go interface:
|
||||
|
@@ -18,7 +18,7 @@ toc: true
|
||||
|
||||
From Hugo 0.28, the default syntax hightlighter in Hugo is [Chroma](https://github.com/alecthomas/chroma); it is built in Go and is really, really fast -- and for the most important parts compatible with Pygments.
|
||||
|
||||
If you want to continue to use Pygments (see below), set `pygmentsUseClasses=true` in your site config.
|
||||
If you want to continue to use Pygments (see below), set `pygmentsUseClassic=true` in your site config.
|
||||
|
||||
The example below shows a simple code snippet from the Hugo source highlighted with the `highlight` shortcode. Note that the gohugo.io site is generated with `pygmentsUseClasses=true` (see [Generate Syntax Highlighter CSS](#generate-syntax-highlighter-css)).
|
||||
|
||||
@@ -94,7 +94,7 @@ linenos
|
||||
: For Chroma, any value in this setting will print line numbers. Pygments has some more fine grained control.
|
||||
|
||||
linenostart
|
||||
: Start the line numbers from this value (default is 1).
|
||||
: Start the line numbers from this value (default is 1).
|
||||
|
||||
|
||||
hl_lines
|
||||
@@ -143,7 +143,7 @@ Highlighting is carried out via the [built-in shortcode](/content-management/sho
|
||||
See [Highlight](/functions/highlight/).
|
||||
|
||||
## Highlight in Code Fences
|
||||
|
||||
|
||||
It is also possible to add syntax highlighting with GitHub flavored code fences. To enable this, set the `pygmentsCodeFences` to `true` in Hugo's [configuration file](/getting-started/configuration/);
|
||||
|
||||
````
|
||||
|
@@ -82,15 +82,23 @@ Moonrise Kingdom <- Value
|
||||
...
|
||||
```
|
||||
|
||||
## Hugo Taxonomy Defaults
|
||||
## Hugo Taxonomy Defaults {#default-taxonomies}
|
||||
|
||||
Hugo natively supports taxonomies.
|
||||
|
||||
Without adding a single line to your site's configuration file, Hugo will automatically create taxonomies for `tags` and `categories`. If you do not want Hugo to create any taxonomies, set `disableKinds` in your site's configuration to the following:
|
||||
Without adding a single line to your [site config][config] file, Hugo will automatically create taxonomies for `tags` and `categories`. That would be same as manually [configuring your taxonomies](#configuring-taxonomies) as below:
|
||||
|
||||
```
|
||||
{{< code-toggle copy="false" >}}
|
||||
[taxonomies]
|
||||
tag = "tags"
|
||||
category = "categories"
|
||||
{{</ code-toggle >}}
|
||||
|
||||
If you do not want Hugo to create any taxonomies, set `disableKinds` in your [site config][config] to the following:
|
||||
|
||||
{{< code-toggle copy="false" >}}
|
||||
disableKinds = ["taxonomy","taxonomyTerm"]
|
||||
```
|
||||
{{</ code-toggle >}}
|
||||
|
||||
### Default Destinations
|
||||
|
||||
@@ -99,11 +107,15 @@ When taxonomies are used---and [taxonomy templates][] are provided---Hugo will a
|
||||
* A single page at `example.com/categories/` that lists all the [terms within the taxonomy][]
|
||||
* [Individual taxonomy list pages][taxonomy templates] (e.g., `/categories/development/`) for each of the terms that shows a listing of all pages marked as part of that taxonomy within any content file's [front matter][]
|
||||
|
||||
## Configure Taxonomies
|
||||
## Configure Taxonomies {#configuring-taxonomies}
|
||||
|
||||
Taxonomies must be defined in your [website configuration][config] before they can be used throughout the site. You need to provide both the plural and singular labels for each taxonomy. For example, `singular key = "plural value"` for TOML and `singular key: "plural value"` for YAML.
|
||||
Custom taxonomies other than the [defaults](#default-taxonomies) must be defined in your [site config][config] before they can be used throughout the site. You need to provide both the plural and singular labels for each taxonomy. For example, `singular key = "plural value"` for TOML and `singular key: "plural value"` for YAML.
|
||||
|
||||
### Example: Taxonomy Configuration
|
||||
### Example: Adding a custom taxonomy named "series"
|
||||
|
||||
{{% note %}}
|
||||
While adding custom taxonomies, you need to put in the default taxonomies too, _if you want to keep them_.
|
||||
{{% /note %}}
|
||||
|
||||
{{< code-toggle copy="false" >}}
|
||||
[taxonomies]
|
||||
@@ -112,11 +124,22 @@ Taxonomies must be defined in your [website configuration][config] before they c
|
||||
series = "series"
|
||||
{{</ code-toggle >}}
|
||||
|
||||
### Example: Removing default taxonomies
|
||||
|
||||
If you want to have just the default `tags` taxonomy, and remove the `categories` taxonomy for your site, you can do so by modifying the `taxonomies` value in your [site config][config].
|
||||
|
||||
{{< code-toggle copy="false" >}}
|
||||
[taxonomies]
|
||||
tag = "tags"
|
||||
{{</ code-toggle >}}
|
||||
|
||||
If you want to disable all taxonomies altogether, see the use of `disableKinds` in [Hugo Taxonomy Defaults](#default-taxonomies).
|
||||
|
||||
### Preserve Taxonomy Values
|
||||
|
||||
By default, taxonomy names are normalized.
|
||||
|
||||
Therefore, if you want to have a taxonomy term with special characters such as `Gérard Depardieu` instead of `Gerard Depardieu`, set the value for `preserveTaxonomyNames` to `true` in your [site configuration][config]. Hugo will then preserve special characters in taxonomy values but will still title-ize the values for titles and normalize them in URLs.
|
||||
Therefore, if you want to have a taxonomy term with special characters such as `Gérard Depardieu` instead of `Gerard Depardieu`, set the value for `preserveTaxonomyNames` to `true` in your [site config][config]. Hugo will then preserve special characters in taxonomy values but will still title-ize the values for titles and normalize them in URLs.
|
||||
|
||||
Note that if you use `preserveTaxonomyNames` and intend to manually construct URLs to the archive pages, you will need to pass the taxonomy values through the [`urlize` template function][].
|
||||
|
||||
|
Reference in New Issue
Block a user