You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.6 KiB

4 years ago
  1. +++
  2. title = "Last Modified"
  3. description = "Help visitors understand when posts were last modified."
  4. categories = ["experience"]
  5. tags = ["publishing", "expired", "future", "posts", "date", "time"]
  6. features = ["code highlighter", "snippets", "related content"]
  7. [[copyright]]
  8. owner = "Josh Habdas"
  9. date = "2019"
  10. license = "agpl-3.0-or-later"
  11. +++
  12. Denote posts with substantive changes or simply draw older, more relevant posts closer to the top of the listings with last modified.
  13. Modifications will be made obvious to visitors with a visible callout in post summaries and the original publish date will be kept intact in the [Post Bylines](../post-bylines).
  14. For robots, making this change will automatically update Schema Structured Data, RSS feeds and the `lastmod` setting in your {{< external href="https://gohugo.io/templates/sitemap-template/" text="Sitemap" />}}.
  15. Adjust last modified by adding a `publishdate` to post {{< external href="https://gohugo.io/content-management/front-matter/" text="Front Matter" />}} and updating the `date` to the date and time you would like to show for the modification.
  16. You can be specific and use a datetime (with timezone offset) like:
  17. ```toml
  18. date = "2017-02-02T01:20:56-06:00"
  19. publishdate = "2016-11-21T10:32:33+08:00"
  20. ```
  21. Or less specific and use just the dates:
  22. ```toml
  23. date = "2017-02-02"
  24. publishdate = "2016-11-21"
  25. ```
  26. It's also possible to set future and expiry dates for content in Hugo. To learn more see the documentation on {{< external href="https://gohugo.io/getting-started/usage/#draft-future-and-expired-content" text="Draft, Future, and Expired Content" />}}.