panr / hugo-theme-hello-friend

Pretty basic theme for Hugo that covers all of the essentials. All you have to do is start typing!
https://github.com/panr/hugo-theme-hello-friend/
MIT License
1.06k stars 1.23k forks source link

[Help Wanted] How can I adjust the archive page so that it does not contain microblog entries? #330

Open ike-keith opened 1 year ago

ike-keith commented 1 year ago

I really like this theme, thanks to the original author and all the contributors.

I added microblogs folder under content folder to contain short untitled blog posts like tweets.

content/ ├── archive.md ├── microblogs │   ├── microblog-1.md │   ├── microblog-2.md │   └── microblog-3.md ├── posts    ├── post-1.md     ├── post-2.md     └── post-3.md

When I checked the archive page, it seemed that the archive page added the microblog (no title) entries. image

I want microblogs not to appear on the archive page.

After some research, I'm guessing it might be that something needs tweaking here: archive/list.html

line 7    {{ range .Site.RegularPages.GroupByPublishDate "2006" }}

line 15                {{ range where .Pages "Type" $contentTypeName }}
line 16                  {{ if eq .Kind "page" }}

But I don't know how to fix it, so came here for help, thanks!

overlandandseas commented 1 year ago

the archive page is going to look at "params.contentTypeName" in the config.

You need to have

params:
  contentTypeName: posts

in your config if you are using YAML or

[params]
  contentTypeName = "posts"

if you are using TOML

ike-keith commented 1 year ago

the archive page is going to look at "params.contentTypeName" in the config.

You need to have

params:
  contentTypeName: posts

in your config if you are using YAML or

[params]
  contentTypeName = "posts"

if you are using TOML

Thank you for your reply. I confirmed that my config file has the following content:

[params]
  # dir name of your blog content (default is `content/posts`)
  contentTypeName = "posts"