mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-26 19:15:16 +02:00
Enable main menu to be left aligned
This commit is contained in:
parent
84eb4a6e30
commit
b6e1dd2710
2 changed files with 12 additions and 2 deletions
|
@ -227,6 +227,9 @@ defaultContentLanguageInSubdir = false
|
|||
# To link a homepage widget, specify the URL as a hash `#` followed by the filename of the
|
||||
# desired widget in your `content/home/` folder.
|
||||
# The weight parameter defines the order that the links will appear in.
|
||||
[params.menus]
|
||||
# Align the main menu to the right of the page? (true/false)
|
||||
align_right = true
|
||||
|
||||
[[menu.main]]
|
||||
name = "Home"
|
||||
|
|
|
@ -25,7 +25,8 @@
|
|||
<div class="collapse navbar-collapse">
|
||||
|
||||
<!-- Left Nav Bar -->
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
{{ $align_right := .Site.Params.menus.align_right | default true }}
|
||||
<ul class="nav navbar-nav {{ if $align_right }}navbar-right{{ else }}navbar-left{{ end }}">
|
||||
{{ range .Site.Menus.main }}
|
||||
|
||||
{{ if .HasChildren }}
|
||||
|
@ -57,8 +58,14 @@
|
|||
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if and .IsTranslated (not $align_right) }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
||||
{{ if .IsTranslated }}
|
||||
{{ if .IsTranslated }}
|
||||
{{ if not $align_right }}
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
{{ end }}
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true">
|
||||
<i class="fa fa-globe" aria-hidden="true"></i>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue