monkeyWzr / hugo-theme-cactus

Cactus theme for hugo
MIT License
541 stars 341 forks source link

Tags design seems too big #98

Open goakshit opened 3 years ago

goakshit commented 3 years ago

If we use few tags very frequently, the tags page turns into a bad UI.

Berndinox commented 2 years ago

Yes, by bad UI we mean something like font size 50.

CuriousMagpie commented 2 years ago

In /layouts/_default/terms.html I replaced the code in <div class="tag-cloud-tags"> with:

    {{- range $.Site.Taxonomies.tags.ByCount -}}
        <a href="{{ .Page.RelPermalink }}">#{{ .Page.Title }} ({{ .Count }})</a>&nbsp;
    {{- end -}}

Which got me a much nicer UI for my new site (still working on general look and feel, I can't leave anything alone):

Screen Shot 2022-06-02 at 9 33 10 PM

Hope you find this helpful! :)

cookieoverflow commented 2 years ago

In /layouts/_default/terms.html you can also modify the font-size calculation (line 14)

From: <a style="font-size: {{ (add 0.8 (mul 15 (div (float $elem.Count) $AllRegularPagesCount))) }}rem; To: <a style="font-size: {{ (add 0.3 (mul 3 (div (float $elem.Count) $AllRegularPagesCount))) }}rem; or whatever numbers work for you.

Is there a way to do this outside of the themes folder to avoid overwriting customisations when pulling changes?

CuriousMagpie commented 2 years ago

You can create a custom.css file and import it into style.css. You'll just need to make sure that you're overriding the correct class/id/element in the CSS--I would think it's potentially in tags.css but don't quote me on that, as there are a lot of CSS files and I found it a bit of a challenge to figure out which ones were taking precedence so I could override them.

Also, to be completely honest here: it looks like the theme's author has abandoned the project, so I wouldn't be too worried about overwriting changes. That's also why I didn't clone it into my project as a submodule--I wanted to be able to make as many changes as I wanted to the theme. I have made so many changes and have more planned that I am going to end up with a completely different theme by the time I'm done.