Skip to content

Commit

Permalink
docs: describe page last modification date (#562)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuri1969 authored Jan 23, 2025
1 parent bbe3c46 commit c60d1f5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions exampleSite/content/docs/guide/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,22 @@ Options for `theme.default`:
The `theme.displayToggle` parameter allows you to display a toggle button for changing themes.
When set to `true`, visitors can switch between light or dark mode, overriding the default setting.

### Page Last Modification

The date of the page's last modification can be displayed by enabling the `params.displayUpdatedDate` flag. To use Git commit date as the source, enable also the `enableGitInfo` flag.

To customize the date format, set the `params.dateFormat` parameter. Its layout matches Hugo's [`time.Format`](https://gohugo.io/functions/time/format/).

```yaml {filename="hugo.yaml"}
# Parse Git commit
enableGitInfo: true
params:
# Display the last modification date
displayUpdatedDate: true
dateFormat: "January 2, 2006"
```

### Page Width

The width of the page can be customized by the `params.page.width` parameter in the config file:
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ baseURL: "https://example.com/"
title: "Hextra"

enableRobotsTXT: true
# Parse Git commit
enableGitInfo: true
# enableEmoji: false
hasCJKLanguage: true
Expand Down Expand Up @@ -135,6 +136,7 @@ params:
displayPoweredBy: true
width: normal

# Display the last modification date
displayUpdatedDate: true
dateFormat: "January 2, 2006"

Expand Down

0 comments on commit c60d1f5

Please sign in to comment.