Permalink
Browse files

Merge pull request #41 from cfrome77/add-submenus

Add dropdown/submenu functionality
  • Loading branch information...
LordMathis committed May 26, 2018
2 parents e14891a + 5a33fd6 commit d5e6286f906fb57ab518270c0582faab46aec234
Showing with 41 additions and 4 deletions.
  1. +23 −0 README.md
  2. +15 −4 layouts/partials/header.html
  3. +3 −0 static/css/nix.css
@@ -60,6 +60,29 @@ To add a menu item add `[[menu.header]]` item to `config.toml`. For example:
url = "/posts"
```
To add a submenu item add `[[menu.header]]` item with a parent parameter to `config.toml`. For example:
```
[menu]
[[menu.header]]
identifier = "post"
name = "posts"
weight = 0
url = "/post"
[[menu.header]]
parent = "post"
name = "All Posts"
url = "/post"
[[menu.header]]
parent = "post"
name = "categories"
url = "/categories"
[[menu.header]]
parent = "post"
name = "tags"
url = "/tags"
```
To enable disqus comments add `disqusShortname` to your `config.toml`.
You can turn off disqus comments per page by adding `nocomments = true` to the front matter.
@@ -19,10 +19,21 @@
</li>
{{ range .Site.Menus.header }}
{{ $name := lower .Name }}
<li >
<a href="{{ .URL }}">~/{{ lower .Name }}</a>
</li>
{{end}}
<li class="dropdown">
{{ if .HasChildren }}
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{ .Name }} <span class="caret"></span></a>
<ul class="dropdown-menu">
{{ range .Children }}
<li>
<a href="{{ .URL }}">~/{{ lower .Name }}</a>
</li>
{{ end }}
</ul>
{{ else }}
<a href="{{ .URL }}">~/{{ lower .Name }}</a>
{{ end }}
</li>
{{ end }}
</ul>
</div><!-- /.navbar-collapse -->
@@ -35,6 +35,9 @@ nav {
font-size: 1.5em;
}
.dropdown-menu li {
font-size: 1.5em;
}
h1,h2,h3,h4,h5,h6 {
font-family: 'Concert One', cursive;

0 comments on commit d5e6286

Please sign in to comment.