MicroBlog question …
Is there an easy way to expose a post’s category on your web page, so that you can click on it and see other posts in that category?
MicroBlog question …
Is there an easy way to expose a post’s category on your web page, so that you can click on it and see other posts in that category?
@JohnPhilpin there are people working on it that's for sure 👀
(It's me. By people I mean me.)
@simonwoods ooohh - background task i am sure - but do we see light?
@JohnPhilpin Sadly not, no -- move and all. As soon as I work it out, I'll share it. The method I'm likely to use will involve editing the theme a bit but I'll do a write-up of some type.
@JohnPhilpin The Minos theme has this code to show categories in the metadata of the post page. I’m likely going to add this to my blog theme as well but just haven’t gotten around to it yet.
@pimoore oh - thankyou … will try that out later - ctrl c ctrl v I can do !! thankyou again.
@JohnPhilpin Sorry, I missed some code on my highlight before. Here’s what I got to work on my test blog with a single and multiple categories:
{{ $Site := .Site }}
{{ if .Params.categories }}
<div class="post-categories”>
<div class="article-category">
{{ range $i, $e := .Params.categories }}
{{ if gt $i 0 }}
<span>></span>
{{ end }}
<a class="article-category-link" href="{{ $Site.BaseURL }}/categories/{{ $e | urlize }}">{{ $e }}</a>
{{ end }}
</div>
</div>
{{ end }}
The “>” symbol in the span is the separator, which you can make something different if you want.
@pimoore Thankyou - which theme are you using? I am on Marfa and seems to not have an ‘articles’ page - which is the other issue
@JohnPhilpin I’m using this Kiko custom CSS mod as my base and have furthered modded it for my site.
@pimoore thankyou - I have now enabled Kiko and all of your CSS - and will now introduce back in some of the CSS that made my original site mine. It was time to revamp the look anyway ... first job - those darn categories !
and already hit a glitch!
your css doesn’t make any modification in style for 'blockquote' - BUT - when I add it in to the CSS - nothing changes ... any thoughts welcome. The style must be coming from somewhere - but my CSS won't override like it use to on the Marfa theme?
@JohnPhilpin I’ve further modified the blockquote on my own site so you wouldn’t see that change. Did you enable the base Kiko theme as well as plugging in the custom CSS? You have to be using both for this to work.
@pimoore not forgotten and tried today - but in the end I changed the theme - but went back to my original CSS and then ‘borrowing’ bits from yours that I like - Eg system font - clever.
I have lost my post height and a few other things I need to fix … so time for more learning.
Thanks for your help.
@JohnPhilpin You’re welcome, it’s a learning experience for me as well while I work on my new theme so I know the feeling. I’ve really enjoyed it though so that makes up for any breakage as I go along.
@pimoore somehow I have this nagging feeling that you actually know what you are doing :-)
@JohnPhilpin I was already familiar with HTML beforehand, and I’ve done enough coding that some of the templating started to make sense for me when I had to tweak the underlying theme. Now, if you asked me to template a Hugo theme and CSS from scratch, good luck with that. 😂