-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding menu items to right side of the header. #4
Comments
Reference: https://discourse.gohugo.io/t/40965 config.toml
Override the header template mkdir -p layouts/partials
cp themes/hugo.386/layouts/partials/header.html layouts/partials/ Then modify layouts/partials/header.html diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 7fe2281..e3f2bf3 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -33,7 +33,12 @@
{{ end }}
{{ end }}
</ul>
+ <ul class="nav" style="float: right">
+ {{ range .AllTranslations }}
+ <li><a href="{{ .RelPermalink }}">{{ .Language.LanguageName }}</a></li>
+ {{ end }}
+ </ul>
</div>
</div>
</div> The language switcher is available in both the collapsed and expanded menu. Perhaps @maxlefou can suggest a better way to do this. |
this version isn't really supported anymore since another revamp is in the way for the main reason that it uses Bootstrap in version 2. but feel free to make pull requests |
It works! Thank you. However, I couldn't manage to do the margin equal to "My New Hugo Site" here is what I tried: Edit: Nevermind I solved it like this: |
Also two new problems occured, I want language buttons to send you to the homepage of the language so this is what I done:
Sadly that doesn't seem like how that works. |
Hello. I am not a web developer and this is my first time getting exposed to CSS and HTML but I tried to change some things on the theme. I semi successfully removed the aspect ratio limit (it still appears when I zoom in but looks fine when zoomed out):
However, one thing that really bothered me was the inability to add menus to the right side of the header instead of the default left side, here is what I tried so far:
header.html
The text was updated successfully, but these errors were encountered: