mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
Merge commit '9e1dcefc5f559944b70d2fa520f6acd5c56a69f2'
This commit is contained in:
@@ -38,6 +38,13 @@ permalinks:
|
||||
|
||||
Only the content under `posts/` will have the new URL structure. For example, the file `content/posts/sample-entry.md` with `date: 2017-02-27T19:20:00-05:00` in its front matter will render to `public/2017/02/sample-entry/index.html` at build time and therefore be reachable at `https://example.com/2017/02/sample-entry/`.
|
||||
|
||||
To configure the `permalinks` option for pages in the "root" section, use **/** as the key:
|
||||
|
||||
{{< code-toggle file="config" copy="false" >}}
|
||||
permalinks:
|
||||
/: /:year/:month/:filename/
|
||||
{{< /code-toggle >}}
|
||||
|
||||
If the standard date-based permalink configuration does not meet your needs, you can also format URL segments using [Go time formatting directives](https://golang.org/pkg/time/#Time.Format). For example, a URL structure with two digit years and month and day digits without zero padding can be accomplished with:
|
||||
|
||||
{{< code-toggle file="config" copy="false" >}}
|
||||
|
Reference in New Issue
Block a user