Replicating the Blog Posts summary for similar Help section

Hello Team,

Apologies in advance; starting to replace my manually built static sites with Hugo so still on a learning curve.

The Blog feature allows me to create a list of posts that are shown in preview with banners & abstract (with tags & categories) from site.com/blog/. Thereby I don’t have to constantly add links pointing to new blog posts. Hugo does this automatically. :heart:

I would like to replicate this feature for a set of Help pages in addition to the Blog pages. How can I replicate the Blog functionality to a set of Help pages? For example with config.toml set for blog = "/blog/:year/:month/:filename/"

blog/2017/10/blog-post-name3
blog/2017/9/blog-post-name2
blog/2017/8/blog-post-name1

and

help/help-page-name3
help/help-page-name2
help/help-page-name1

I would not want the Help pages showing a creation year/month like Blog. How would I configure the HELP section to adopt help = /help/:filename/

Any pointers greatly appreciated!
Nick

The thing you are looking for is called permalinks.

So presuming you are adding them to config.toml:

[permalinks]
  blog = "/blog/:year/:month/:filename/"
  help = "/help/:filename/"

Maybe you are missing the quotes, or have that somewhere else in your config. Make sure it looks like the example.

1 Like

Thanks for the links to the right part of the docs.

I’ve added the help permalinks to config.toml:

[Permalinks]
	blog = "/blog/:year/:month/:filename/"
	help = "/help/:filename/"

I’ve added Help into the top menu in config.toml:

[[menu.main]]
    name = "Help"
    url  = "/help/"
    weight = 3

I’ve regenerated my help page content:

hugo new help/help-page1.md
hugo new help/help-page2.md
hugo new help/help-page3.md

Running the local server hugo server -D --verbose shows my new “Help” link but browsing to /help/ displays the theme, with page titled “HELPS” with no content.

Generating the static site with hugo --verbose updates pages index.html, 404.html, index.xml. sitemap.xml with the same empty content as above. The help pages appear in sitemap.xml.

I’m still sort of stuck working out if I’m using permalinks correctly. I’m expecting /help/ to work identically to /blog/. Any ideas what I’m missing?

This is the test site: http://lama.info.s3-website.us-east-2.amazonaws.com/

Nick

Adding a link to your website doesn’t help us help you. The source would help.

Here’s the complete site ZIP:
https://s3.us-east-2.amazonaws.com/lama.info/sentencingguidelines.co.uk.zip

Posted link to ZIP file which is pending Admin clearance.

It would probably get a better response if you link to, say, a GitHub repo or similar where we could look at the source.

Sorry, don’t have this in Github. Guess I’ll have to wait for the documentation to catch-up.

That is a backhanded and disgraceful response, and I’ll tell you why: everyone is volunteering here, including the folks updating the docs. We are in this together, rather than a drive-thru window for technical advice. In the future, please be more considerate and less dismissive.

Also, you issue is with the range in /themes/hugo-universal-theme/layouts/_default/list.html:

{{ $paginator := .Paginate (where .Data.Pages "Type" "blog") }}
{{ range $paginator.Pages }}

This is a theme-specific issue, so please read the pagination and iteration in templates docs, and then seek assistance from the theme creator.

1 Like

@maiki thanks for unusual welcome to the community … and these pointers!

I’ll drop back here and contribute some config when I’ve got it all working. :smiley: