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
Progress spinner
In reply to
SimonWoods
SimonWoods

@JohnPhilpin there are people working on it that's for sure šŸ‘€

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

|
Embed
Progress spinner
JohnPhilpin
JohnPhilpin

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

|
Embed
Progress spinner
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
Progress spinner
JohnPhilpin
JohnPhilpin

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

|
Embed
Progress spinner
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
Progress spinner
JohnPhilpin
JohnPhilpin

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

|
Embed
Progress spinner
pimoore
pimoore

@JohnPhilpin Youā€™re welcome, let me know if youā€™re able to get it to work! šŸ‘šŸ»

|
Embed
Progress spinner
JohnPhilpin
JohnPhilpin

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

|
Embed
Progress spinner
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
Progress spinner
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
Progress spinner
pimoore
pimoore

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

|
Embed
Progress spinner
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
Progress spinner
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
Progress spinner
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
Progress spinner
JohnPhilpin
JohnPhilpin

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

|
Embed
Progress spinner
pimoore
pimoore

@JohnPhilpin Do you have a screenshot of what youā€™re seeing?

|
Embed
Progress spinner
JohnPhilpin
JohnPhilpin

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

|
Embed
Progress spinner
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
Progress spinner
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
Progress spinner
JohnPhilpin
JohnPhilpin

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

|
Embed
Progress spinner
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
Progress spinner