google / docsy

A set of Hugo doc templates for launching open source content.
https://docsy.dev
Apache License 2.0
2.59k stars 894 forks source link

Can the footer have active language dependent links? #264

Open ec1warc1 opened 4 years ago

ec1warc1 commented 4 years ago

Looking at these params.links:

[params.links]
[[params.links.developer]]
         name = "Account Management"
         url = "/en/acm/"
         icon = "fas fa-id-card"
         desc = "Manage your Account!"
[[params.links.developer]]
        name = "Donate"
        url = "/en/abt/don/"
        icon = "fa fa-heart"
        desc = "Help keep the site running! Donate!"

I don't see a way to make the links depend upon the active language similar to the menu. Is there a way to do it? Many thanks! Edward

LisaFC commented 4 years ago

It's not built in to the theme yet but it should be possible to do it. There's an in progress PR to do the same for the Feedback links, but this one is simpler as you don't need to switch a feature on and off as well. See #179

ec1warc1 commented 4 years ago

I was able to hack a solution. Here you can see how I modified entries in config.toml to make them language specific:

[[params.links.developer-en]]
        name = "Account Management"
        url = "/en/acm/"
        icon = "fas fa-id-card"
        desc = "Manage your e2e.ee JabberID!"
        target = "_self"

[[params.links.developer-es]]
        name = "Administración de Cuenta"
        url = "/es/acm/"
        icon = "fas fa-id-card"
        desc = "Manage your e2e.ee JabberID!"
        target = "_self"

Then, in themes/docsy/layouts/partials/footer.html: 2020-04-30_12-57-26 2020-04-30_13-02-14