Add mainMenuAlignment param

This commit is contained in:
vimux 2019-02-17 17:10:19 -05:00
parent 59d1afeca1
commit 2375b2313d
No known key found for this signature in database
GPG key ID: 5A34FDC4EE832E34
3 changed files with 8 additions and 3 deletions

View file

@ -132,6 +132,7 @@ googleAnalytics = "" # Enable Google Analytics by entering your tracking id
dateFormat = "January 02, 2006" # Change the format of dates
colorTheme = "" # dark-green, dark-blue, dark-red, dark-violet
customCSS = ["css/custom.css"] # Include custom CSS files
mainMenuAlignment = "right" # Align main menu (desktop version) to the right side
authorbox = true # Show authorbox at bottom of single pages if true
toc = true # Enable Table of Contents for all site pages
tocOpen = true # Open Table of Contents block. Optional

View file

@ -8,11 +8,11 @@
</svg>
</div>
</button>
<ul id="menu" class="main-nav__list">
<ul id="menu" class="main-nav__list{{ if eq .Site.Params.mainMenuAlignment "right" }} main-nav__list--right{{ end }}">
{{- $currentNode := . }}
{{- range sort .Site.Menus.main }}
{{- if .Name}}
<li class="main-nav__item{{if or ($currentNode.IsMenuCurrent "main" .) ($currentNode.HasMenuCurrent "main" .) }} main-nav__item--active{{end}}">{{if or ($currentNode.IsMenuCurrent "main" .) ($currentNode.HasMenuCurrent "main" .) }}{{ .Name }}{{ else }}<a class="main-nav__link" href="{{ .URL }}">{{ .Name }}</a>{{end}}</li>
<li class="main-nav__item{{if or ($currentNode.IsMenuCurrent "main" .) ($currentNode.HasMenuCurrent "main" .) }} main-nav__item--active{{end}}">{{ if or ($currentNode.IsMenuCurrent "main" .) ($currentNode.HasMenuCurrent "main" .) }}{{ .Name }}{{ else }}<a class="main-nav__link" href="{{ .URL }}">{{ .Name }}</a>{{ end }}</li>
{{- end }}
{{- end }}
</ul>

View file

@ -598,7 +598,7 @@ button:not(:-moz-focusring):focus > .main-nav__btn-box {
}
.main-nav {
display: inline-block;
display: flex;
}
.main-nav__item {
@ -606,6 +606,10 @@ button:not(:-moz-focusring):focus > .main-nav__btn-box {
border: 0;
}
.main-nav__list--right {
margin-left: auto;
}
.main-nav__list.main-nav__list--active {
position: initial;
border: 0;