adityatelange / hugo-PaperMod

A fast, clean, responsive Hugo theme.
https://adityatelange.github.io/hugo-PaperMod/
MIT License
10.29k stars 2.73k forks source link

[FEATURE] Enable to Disable Language Toggle in Site Header #1633

Open jamesnulliu opened 4 days ago

jamesnulliu commented 4 days ago

What does this PR change? What problem does it solve?

This PR modifies "layouts/partials/header.html" by adding site.Params.disableLangToggle to disable language switch toggle if set to true. (I think sometimes users may just want to provide translation functionality in blogs instead of the whole site 🤔)

For example, if set params.disableLangToggle to false in "hugo.yaml/toml/...", everything stays the same:

image

If set to true, then the language switch toggle will not appear, but the one in blogs will still available:

image

Was the change discussed in an issue or in the Discussions before?

This change is not discussed in an issue before, but is a simple yet lovely enhancement.

PR Checklist

sonarcloud[bot] commented 4 days ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud