mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-19 21:21:39 +02:00
2.5 KiB
2.5 KiB
_comment
| _comment |
|---|
| Do not remove front matter. |
:year- The 4-digit year as defined in the front matter
datefield. :month- The 2-digit month as defined in the front matter
datefield. :monthname- The name of the month as defined in the front matter
datefield. :day- The 2-digit day as defined in the front matter
datefield. :weekday- The 1-digit day of the week as defined in the front matter
datefield (Sunday =0). :weekdayname- The name of the day of the week as defined in the front matter
datefield. :yearday- The 1- to 3-digit day of the year as defined in the front matter
datefield. :section- The content's section.
:sections- The content's sections hierarchy. You can use a selection of the sections using slice syntax:
:sections[1:]includes all but the first,:sections[:last]includes all but the last,:sections[last]includes only the last,:sections[1:2]includes section 2 and 3. Note that this slice access will not throw any out-of-bounds errors, so you don't have to be exact. :title- The
titleas defined in front matter, else the automatic title. Hugo generates titles automatically for section, taxonomy, and term pages that are not backed by a file. :slug- The
slugas defined in front matter, else thetitleas defined in front matter, else the automatic title. Hugo generates titles automatically for section, taxonomy, and term pages that are not backed by a file. :filename- The content's file name without extension, applicable to the
pagepage kind.{{< deprecated-in v0.144.0 >}} The
:filenametoken has been deprecated. Use:contentbasenameinstead. {{< /deprecated-in >}} :slugorfilename- The
slugas defined in front matter, else the content's file name without extension, applicable to thepagepage kind.{{< deprecated-in v0.144.0 >}} The
:slugorfilenametoken has been deprecated. Use:slugorcontentbasenameinstead. {{< /deprecated-in >}} :contentbasename- {{< new-in 0.144.0 />}}
- The content base name.
:slugorcontentbasename- {{< new-in 0.144.0 />}}
- The
slugas defined in front matter, else the content base name.
For time-related values, you can also use the layout string components defined in Go's time package. For example:
{{< code-toggle file=hugo >}} permalinks: posts: /:06/:1/:2/:title/ {{< /code-toggle >}}