JohnPhilpin
JohnPhilpin

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?

|
Embed
SimonWoods
SimonWoods

@JohnPhilpin there are people working on it that's for sure 👀

(It's me. By people I mean me.)

|
Embed
In reply to
JohnPhilpin
JohnPhilpin

@simonwoods ooohh - background task i am sure - but do we see light?

|
Embed
SimonWoods
SimonWoods

@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.

|
Embed
JohnPhilpin
JohnPhilpin

@simonwoods excited to see - if you need a beta tester - I’m in.

|
Embed
pimoore
pimoore

@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.

|
Embed
JohnPhilpin
JohnPhilpin

@pimoore oh - thankyou … will try that out later - ctrl c ctrl v I can do !! thankyou again.

|
Embed
pimoore
pimoore

@JohnPhilpin You’re welcome, let me know if you’re able to get it to work! 👍🏻

|
Embed
JohnPhilpin
JohnPhilpin

@pimoore so far - not so good … more to come - will be more than ctrl c ctrl v IMHO

|
Embed
pimoore
pimoore

@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.

|
Embed
JohnPhilpin
JohnPhilpin

@pimoore Thankyou - which theme are you using? I am on Marfa and seems to not have an ‘articles’ page - which is the other issue

|
Embed
pimoore
pimoore

@JohnPhilpin I’m using this Kiko custom CSS mod as my base and have furthered modded it for my site.

|
Embed
JohnPhilpin
JohnPhilpin

@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 !

So Far - A Site That SHOULD look exactly the same as yours

|
Embed
JohnPhilpin
JohnPhilpin

@pimoore

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?

|
Embed
pimoore
pimoore

@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.

|
Embed
JohnPhilpin
JohnPhilpin

@pimoore I did indeed - so will look more today at what changes you made.

|
Embed
pimoore
pimoore

@JohnPhilpin Do you have a screenshot of what you’re seeing?

|
Embed
JohnPhilpin
JohnPhilpin

@pimoore I can do that … will be back … prolly tomorrow now … will make a story post.

|
Embed
JohnPhilpin
JohnPhilpin

@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.

|
Embed
pimoore
pimoore

@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.

|
Embed
JohnPhilpin
JohnPhilpin

@pimoore somehow I have this nagging feeling that you actually know what you are doing :-)

|
Embed
pimoore
pimoore

@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. 😂

|
Embed