mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-25 22:00:58 +02:00
Merge commit 'a0c28c943c2f4714fa340b22a583b96f5013090b'
This commit is contained in:
@@ -100,7 +100,7 @@ Hugo supports GitHub-flavored markdown's use of triple back ticks, as well as pr
|
||||
|
||||
## Mmark
|
||||
|
||||
Mmark is a [fork of BlackFriday][mmark] and markdown superset that is well suited for writing [IETF documentation][ietf]. You can see examples of the syntax in the [Mmark GitHub repository][mmarkgh] or the full syntax on [Miek Gieben's website][].
|
||||
Mmark is a [fork of BlackFriday][mmark] and markdown superset that is well suited for writing [IETF documentation][ietf]. You can see examples of the syntax in the [Mmark GitHub repository][mmark] or the full syntax on [Miek Gieben's website][].
|
||||
|
||||
### Use Mmark
|
||||
|
||||
@@ -253,8 +253,7 @@ Markdown syntax is simple enough to learn in a single sitting. The following are
|
||||
[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
|
||||
[mmarkgh]: https://github.com/miekg/mmark/wiki/Syntax
|
||||
[mmark]: https://github.com/mmarkdown/mmark
|
||||
[org]: http://orgmode.org/
|
||||
[pandoc]: http://www.pandoc.org/
|
||||
[Pygments]: http://pygments.org/
|
||||
|
@@ -53,12 +53,15 @@ The examples above use two different delimiters, the difference being the `%` ch
|
||||
|
||||
### Shortcodes with Markdown
|
||||
|
||||
The `%` character indicates that the shortcode's inner content---called in the [shortcode template][sctemps] with the [`.Inner` variable][scvars]---needs further processing by the page's rendering processor (i.e. markdown via Blackfriday). In the following example, Blackfriday would convert `**World**` to `<strong>World</strong>`:
|
||||
In Hugo `0.55` we changed how the `%` delimiter works. Shortcodes using the `%` as the outer-most delimiter will now be fully rendered when sent to the content renderer (e.g. Blackfriday for Markdown), meaning they can be part of the generated table of contents, footnotes, etc.
|
||||
|
||||
If you want the old behavior, you can put the following line in the start of your shortcode template:
|
||||
|
||||
```
|
||||
{{%/* myshortcode */%}}Hello **World!**{{%/* /myshortcode */%}}
|
||||
{{ $_hugo_config := `{ "version": 1 }` }}
|
||||
```
|
||||
|
||||
|
||||
### Shortcodes Without Markdown
|
||||
|
||||
The `<` character indicates that the shortcode's inner content does *not* need further rendering. Often shortcodes without markdown include internal HTML:
|
||||
|
@@ -135,24 +135,16 @@ If you want to have just the default `tags` taxonomy, and remove the `categories
|
||||
|
||||
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 config][config]. Hugo will then preserve special characters in taxonomy values but will still 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][].
|
||||
|
||||
{{% note %}}
|
||||
You can add content and front matter to your taxonomy list and taxonomy terms pages. See [Content Organization](/content-management/organization/) for more information on how to add an `_index.md` for this purpose.
|
||||
|
||||
Much like regular pages, taxonomy list [permalinks](/content-management/urls/) are configurable, but taxonomy term page permalinks are not.
|
||||
{{% /note %}}
|
||||
|
||||
{{% warning "`preserveTaxonomyNames` behaviour change" %}}
|
||||
Before 0.49, Hugo would make the first character upper case for the taxonomy values for titles even if `preserveTaxonomyNames` was active. This no longer the case, which (for instance) makes it possible to have fully lower-case values.
|
||||
{{% warning %}}
|
||||
The configuration option `preserveTaxonomyNames` was removed in Hugo 0.55.
|
||||
|
||||
If you actually need to title-ize these values, you can do so using the `strings.FirstUpper` template function.
|
||||
You can now use `.Page.Title` on the relevant taxonomy node to get the original value.
|
||||
{{% /warning %}}
|
||||
|
||||
## Add Taxonomies to Content
|
||||
|
@@ -84,7 +84,6 @@ The following is a list of values that can be used in a `permalink` definition i
|
||||
|
||||
Aliases can be used to create redirects to your page from other URLs.
|
||||
|
||||
|
||||
Aliases comes in two forms:
|
||||
|
||||
1. Starting with a `/` meaning they are relative to the `BaseURL`, e.g. `/posts/my-blogpost/`
|
||||
@@ -130,6 +129,8 @@ aliases:
|
||||
---
|
||||
```
|
||||
|
||||
From Hugo 0.55 you can also have page-relative aliases, so ` /es/posts/my-original-post/` can be simplified to the more portable `my-original-post/`
|
||||
|
||||
### How Hugo Aliases Work
|
||||
|
||||
When aliases are specified, Hugo creates a directory to match the alias entry. Inside the directory, Hugo creates an `.html` file specifying the canonical URL for the page and the new redirect target.
|
||||
@@ -257,12 +258,29 @@ Or, if you are on Windows and do not have `grep` installed:
|
||||
hugo config | FINDSTR /I canon
|
||||
```
|
||||
|
||||
## Override URLs with Front Matter
|
||||
## Set URL in Front Matter
|
||||
|
||||
In addition to specifying permalink values in your site configuration for different content sections, Hugo provides even more granular control for individual pieces of content.
|
||||
|
||||
Both `slug` and `url` can be defined in individual front matter. For more information on content destinations at build time, see [Content Organization][contentorg].
|
||||
|
||||
From Hugo 0.55, you can use URLs relative to the current site context (the language), which makes it simpler to maintain. For a Japanese translation, both of the following examples would get the same URL:
|
||||
|
||||
```markdown
|
||||
---
|
||||
title: "Custom URL!"
|
||||
url: "/jp/custom/foo"
|
||||
---
|
||||
```
|
||||
|
||||
```markdown
|
||||
---
|
||||
title: "Custom URL!"
|
||||
url: "custom/foo"
|
||||
---
|
||||
```
|
||||
|
||||
|
||||
## Relative URLs
|
||||
|
||||
By default, all relative URLs are left unchanged by Hugo, which can be problematic when you want to make your site browsable from a local file system.
|
||||
|
Reference in New Issue
Block a user