Category (automatic) page with an introduction?

MB allows us to create pages out of categories, and in turn, filter content into categories by RSS feed.

On my blog (taonaw.com) I now have two pages like this: Movies and Games. Both pages are categories, and both categories display content I post up on different website (letterboxd for movies and backloggd for games). This is all nice and good.

What I want to do next is to add a static “intro” paragraph at the top of the Games page, under the title. Something that tells folks how to find me on backloggd where I have more game information. Same idea for Movies as well. How do I go around and do that? Where should I look? I’m not sure if this is a template issue, plug in, something in between…?

Thanks!

Template— you’ll want some if blocks in your taxonomy template that checks the page term and displays text embedded there when in the right category.

any idea how that would look like or where I can see an example? Thank you :slight_smile:

In my layouts/_default/term.html template I have an if block for my now page to show only one post:

{{ if eq .Data.Term "now" }} and then I do stuff under that, for example.

If you’re not familiar with Hugo, I think this will be a bit challenging.

Thanks @jsonbecker , I wasn’t exactly around for a bit, but I see this now.
I am familiar with Hugo, but not proficient with the coding aspect of it that much - actually it’s one of the reasons I switched from having a Hugo site to MB, and I’m happier here.

I’ll see if I can work with this!

Hi Json - a thought:

Since my Games page is created automatically from an RSS feed (https://www.backloggd.com/u/JTR/reviews/rss/), wouldn’t it be possible to create a page normally, call it Games, give it an intro, and then somehow tell MB to grab posts from the above link?

I’m guessing MB has a piece of code that “sees” an RSS feed and then uses the page theme on it. Can’t I just tell MB to run this code manually somehow when I’m done with the HTML part of the page?

I’ve done something similar with my blogrolls page. I included a shortcode {{< jtr-blogroll-emacs >}} (which points to the code @manton put up) toward the end. Could that work here somehow?

Not at this time. @pratik always talks about wanting this-- there’s no automatic way to set a category based on the feed source. If there is a common word/phrase or piece of content in that feed for every post (and not others), you could use that to automatically mark those posts as being in a specific category, and then it would work like any other category page.

@JTR I have gotten around this by using filters in Micro.blog and using the URL as the condition. I also use emojis for filtering and sometimes even image types (JPGs vs. JPEGS. vs. PNG). It works pretty well.

@pratik @jsonbecker this sounds like it could work. Since my RSS comes from a specific website, I can use that website (in the URL) as the keyword for the category, which ill create the page. OK, page is created, but now how do I add the RSS feed to it, so posts are created automatically in that page?

Is there an example (from behind the scenes, on MB) somewhere? Perhaps I’m not getting it fully, @pratik can you explain in steps maybe? I appreciate the help!

You add the RSS feed as a source to your blog under sources on the left nav. The category page gives you the filter to apply the category. All categories by default have an existing category RSS feed and category index pages.

1 Like

Yup. What Jason said. It’s a two-step process. You first have to get the posts into Micro.blog via RSS and then you can categorize them via filters. Then style the category page. You can also use redirects in Micro.blog if you want a different URL and not ‘/category/category-name’

1 Like

ohh I see. I was so stuck on the RSS part, didn’t realize you just create a “regular” category page out of it, using the URL as a trigger instead of, say, a camera emoticon (which is what I do for my photos page). Smart! Will try.

I still don’t get it. In theory it makes sense, I tried on my test blog today and I’m stuck.

I’m using my alternative mastodon RSS as test on my test blog.

  1. I added the RSS feed to my list of sources
  2. Under categories, I added a filter: “or text contains:” is the domain, 500.social. “Set category:” is 500.
  3. So now I have the page /categories/500 with the posts from the RSS, ok
  4. …now what?

you said “then style the category page,” but when I go to my “500” page through my categories, it’s a page with name, path, and feeds. That’s it:

When I go to “500” via “Pages” on the side, I have room to enter text, but since I have the redirect at the bottom right to /categories/500, it seems to ignore that and just display the feed. I need to point it to the feed though, because otherwise this will just be a regular content page… no?

what am I missing?

You have to customize your theme template now. You’re done with all the parts that are built in, now you need to delve into Hugo theming and customizing what gets shown on that particular category page.

I see. My knowledge here is very basic.

From what I understand, all the static pages are governed by layouts/_default/single.html, which is why they all look the same. I need to create a new html page for this category page.

So in general, copy-paste layouts/_default/single.html, and do the adjustments I want (say add a paragraph at the top). I will call it ``layouts/_default/single_500.html`.

OK, now how do I tell Hugo to go to that page if someone clicks on 500 in the nav bar? It seems like the condition you listed above when we started this discussion, yes?

See I thought this was a work around that, because I don’t have the understanding of Hugo to do that, at least not yet. If I have to use that, that’s fine, I just need to know that I’m not missing something more basic.

Thanks for the help

Yeah, you’re pretty far off. The category page you see is the default list page, and you’ll need to create a new list page layout for categories or data terms. I’d read the Hugo docs on template order and templates in general to get started. I strongly recommend running Hugo locally and playing with a very basic site/blank theme to understand how it works.

You’re up to the part I mentioned earlier Category (automatic) page with an introduction? - #4 by jsonbecker

1 Like