mirror of
https://github.com/alanorth/hugo-theme-bootstrap4-blog.git
synced 2024-12-19 09:02:18 +01:00
Merge pull request #15 from ejsmit/navbar-menu
Add custom navbar support
This commit is contained in:
commit
f6e262f05e
@ -23,6 +23,14 @@ paginate = 5
|
|||||||
name = "Link 2"
|
name = "Link 2"
|
||||||
url = "https://example.org"
|
url = "https://example.org"
|
||||||
|
|
||||||
|
# custom navbar menu entry. See the custom_navbar parameter below for
|
||||||
|
# details.
|
||||||
|
|
||||||
|
#[[menu.navbar]]
|
||||||
|
# name = "Link 1"
|
||||||
|
# url = "https://example.org"
|
||||||
|
|
||||||
|
|
||||||
# Theme variables
|
# Theme variables
|
||||||
#
|
#
|
||||||
[params]
|
[params]
|
||||||
@ -51,6 +59,15 @@ paginate = 5
|
|||||||
#cookie_consent_info_url = "/cookie-information/"
|
#cookie_consent_info_url = "/cookie-information/"
|
||||||
#cookie_consent_info_url = "http://cookiesandyou.com"
|
#cookie_consent_info_url = "http://cookiesandyou.com"
|
||||||
|
|
||||||
|
# customise the contents of the navbar at the top of the page. The default
|
||||||
|
# behaviour is to list all static pages not in the posts directory. When the
|
||||||
|
# parameter below is set to true you will have to manually add entries to the
|
||||||
|
# navbar, either by adding the following menu variable to the front matter of
|
||||||
|
# the relevant pages
|
||||||
|
# menu = "navbar"
|
||||||
|
# or by specifying menu entries in a similar way to the sidebar menu above.
|
||||||
|
#custom_navbar = true
|
||||||
|
|
||||||
[params.sidebar]
|
[params.sidebar]
|
||||||
# Optional about block for sidebar (can be Markdown)
|
# Optional about block for sidebar (can be Markdown)
|
||||||
about = "A simple Hugo theme based on the [Bootstrap v4 blog example](http://v4-alpha.getbootstrap.com/examples/blog/)."
|
about = "A simple Hugo theme based on the [Bootstrap v4 blog example](http://v4-alpha.getbootstrap.com/examples/blog/)."
|
||||||
|
@ -31,8 +31,14 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<nav class="nav blog-nav">
|
<nav class="nav blog-nav">
|
||||||
<a class="nav-link {{ if .IsHome }}active{{ end }}" href="{{ .Site.BaseURL | absLangURL }}">{{ i18n "home" }}</a>
|
<a class="nav-link {{ if .IsHome }}active{{ end }}" href="{{ .Site.BaseURL | absLangURL }}">{{ i18n "home" }}</a>
|
||||||
{{ range where .Site.Pages "Type" "!=" "post" }}
|
{{ if .Site.Params.custom_navbar }}
|
||||||
<a class="nav-link" href="{{ .Permalink }}">{{ .Title }}</a>
|
{{ range .Site.Menus.navbar }}
|
||||||
|
<a class="nav-link" href="{{.URL | absURL }}">{{ .Name }}</a>
|
||||||
|
{{ end }}
|
||||||
|
{{ else }}
|
||||||
|
{{ range where .Site.Pages "Type" "!=" "post" }}
|
||||||
|
<a class="nav-link" href="{{ .Permalink }}">{{ .Title }}</a>
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user