AngeloStavrow / indigo

An IndieWeb-friendly custom theme for Hugo
MIT License
57 stars 32 forks source link

Archives or Tags? #80

Closed DesmondChoy closed 4 years ago

DesmondChoy commented 4 years ago

Hello, is it possible to showcase archives or tags in the main page? Something similar to: https://themes.gohugo.io/theme/hugo-tranquilpeak-theme/

If so, am I able to specify it so the link is at the top of the page with "Home"?

AngeloStavrow commented 4 years ago

Hey @DesmondChoy! Thanks for reaching out.

Right now, what's shown when you click on "Home" the navigation menu at the top of the page is the site's baseURL. It would be cool if you could change this in the config.toml file to point to something like

baseURL = "https://example.com/tags/unicorns"

but this would break the way the site works. You could create your own version of the nav menu in a new file, layouts/partials/pagenav.html like so:

<nav>
    {{ $currentPage := . }}
    <div id="page-nav">
        <div class="page-nav-item">
            <a href="{{ .Site.BaseURL }}tags/unicorns">Home</a>
        </div>
        {{ range .Site.Menus.main }}
            <div class="page-nav-item">
                <a href="{{ .URL }}">
                    {{ .Pre }}
                    <span>{{ .Name }}</span>
                </a>
            </div>
        {{ end }}
    </div>
</nav>

(Note the change on line 5 above, adding tags/unicorns after the site variable.)

This would override the current behaviour of the theme.

There's no implementation of "archives" in Indigo, however, so I think this would be limited to tags and categories.

Hope this helps! Don't hesitate to re-open this issue if you need any further clarification.