Providing Timeless Online Help in Themes

Despite the misnomer, Online Help is help documentation included with something. In the case of Hugo, that can mean dogfooding your README directly within the theme, giving users working offline something to do when they’re not reading Disconnect.

Here’s how you can add Online Help to your themes:

  1. Create an archetypes/help.md containing your themes help documentation.
  2. Set expirydate = {{ .Date }} in the frontmatter.
  3. Use the help archetype to generate some content like hugo new post/welcome.md --kind help.
  4. Then serve the site with the --buildExpired flag. Use hugo list draft to ensure the content has been published.

Users will now see a help post they can use online or off for help using their site and it will not change until they upgrade their theme and regenerate the help documentation.

1 Like