hugo-theme-hello-friend icon indicating copy to clipboard operation
hugo-theme-hello-friend copied to clipboard

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

Open ike-keith opened this issue 3 years ago • 2 comments

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!

ike-keith avatar Mar 29 '23 02:03 ike-keith

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

overlandandseas avatar May 04 '23 12:05 overlandandseas

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"

ike-keith avatar May 12 '23 01:05 ike-keith