--- /dev/null
+<aside class="m" th:insert="${marginalcontent}?:~{}">
+<!--/* the following is only visible during natural templating -->
+ <h1>Other nasty but marginal stuff</h1>
+ <p>
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
+ eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
+ ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
+ aliquip ex ea commodo consequat. Duis aute irure dolor in
+ reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
+ pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
+ culpa qui officia deserunt mollit anim id est laborum.
+ </p>
+</aside>
+<aside class="m">
+ <h1>More nasty stuff</h1>
+ <p>
+ This one is really short!
+ </p>
+<!--*/-->
+</aside>
-{{- /*
-Renders a menu for the given menu ID.
-
-@context {page} page The current page.
-@context {string} menuID The menu ID.
-
-@example: {{ partial "menu.html" (dict "menuID" "main" "page" .) }}
-*/}}
-
{{- $page := .page }}
{{- $menuID := .menuID }}
-{{- with index site.Menus $menuID }}
- <nav>
- <ul>
- {{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
- </ul>
- </nav>
-{{- end }}
-
-{{- define "_partials/inline/menu/walk.html" }}
- {{- $page := .page }}
- {{- range .menuEntries }}
- {{- $attrs := dict "href" .URL }}
- {{- if $page.IsMenuCurrent .Menu . }}
- {{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }}
- {{- else if $page.HasMenuCurrent .Menu .}}
- {{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
- {{- end }}
- {{- $name := .Name }}
- {{- with .Identifier }}
- {{- with T . }}
- {{- $name = . }}
- {{- end }}
+<nav id="nav">
+ <hr class="n"/>
+ <a class="hide" href="#top" title="Show Content">Jump back to the top of the page</a>
+ <h1 class="nav">Navigation</h1>
+ <h2 class="nav menu">Section-Menu</h2>
+ <ul id="menu" class="cf">
+ {{- range $page.Site.MainSections }}
+ {{- $section := site.GetPage "section" . }}
+ <li class="m {{ . }}">
+ <a href="{{ $section.RelPermalink }}" class="{{ cond (eq $page.Section .) "m selected" "m" }}">{{ $section.LinkTitle }}</a>
+ </li>
{{- end }}
- <li>
- <a
- {{- range $k, $v := $attrs }}
- {{- with $v }}
- {{- printf " %s=%q" $k $v | safeHTMLAttr }}
- {{- end }}
- {{- end -}}
- >{{ $name }}</a>
- {{- with .Children }}
- <ul>
- {{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
- </ul>
+ </ul>
+ <h2 class="nav submenu">
+ <a class="s selected" href="{{ site.Home.RelPermalink }}">Home</a>
+ </h2>
+ <ul id="submenu" class="submenu selected">
+ {{- partial "inline/menu/tree.html" (dict "pages" $page.Site.Sections "page" $page) }}
+ {{- define "_partials/inline/menu/tree.html" }}
+ {{- $page := .page -}}
+ {{- range .pages -}}
+ {{- $parent := index .Ancestors 0 -}}
+ {{- $isCurrent := eq . $page -}}
+ {{- $isAncestor := $page.IsDescendant . -}}
+ {{- $isChild := $parent.Eq $page }}
+ {{- $isSibling := $parent.Eq (index $page.Ancestors 0) }}
+ <li class="s{{ if or .Pages .Sections}} sub{{ end }}{{ if not (or $isCurrent $isAncestor (and $isSibling (not $page.IsNode)) $isChild) }} off{{ end }}">
+ <!--
+ th:with="
+ child=${pos == len},
+ hidden=${!child && _canonical.get(crumbs.get(pos)) == entry},
+ entry=${hidden?crumbs.get(pos):entry},
+ selected=${(child and crumbs.get(pos-1) + '?about' == entry) or (!child and (crumbs.get(pos) == entry or hidden))},
+ leaf=${pos >= (len - 1) and not selected},
+ sibling=${pos + 1 == len and (_childs.get(uri) == null or uri == parent)},
+ childs=${entry == parent ? null : _childs.get(entry)}
+ "
+ class="s sub"
+ th:class="'s' + (${childs} ? ' sub' : '') + (${selected or sibling or child} ? '' : ' off')"
+ -->
+ <a href="{{ .RelPermalink }}"
+ class="s {{ if (or $isCurrent $isAncestor) }} selected{{ end }}"
+ >{{ .LinkTitle }}</a>
+ <!--
+ <ul>
+ <li>.: {{ .Path }}</li>
+ <li>$parent: {{ $parent.Path }}</li>
+ <li>$page: {{ $page.Path }}</li>
+ <li>$page.IsNode: {{ $page.IsNode }}</li>
+ <li>$isCurrent: {{ $isCurrent }}</li>
+ <li>$isAncestor: {{ $isAncestor }}</li>
+ <li>$isSibling: {{ $isSibling }}</li>
+ <li>$isChild: {{ $isChild }}</li>
+ <li>.Eq $page: {{ .Eq $page }}</li>
+ <li>.IsAncestor $page: {{ .IsAncestor $page }}</li>
+ <li>.IsDescendant $page: {{ .IsDescendant $page }}</li>
+ </ul>
+ -->
+ {{ if or .Pages .Sections }}
+ <ul class="s{{ if (or $isCurrent $isAncestor) }} active{{ end }}">
+ {{- if .Pages }}
+ {{- partial "inline/menu/tree.html" (dict
+ "pages" .Pages
+ "page" $page
+ ) }}
+ {{- end }}
+ </ul>
{{- end }}
</li>
+ {{- end }}
{{- end }}
-{{- end }}
+ </ul>
+ <hr class="n"/>
+</nav>
<head>
{{ partial "head.html" . }}
</head>
-<body>
- <header>
- {{ partial "header.html" . }}
- </header>
- <main>
- {{ block "main" . }}{{ end }}
- </main>
- <footer>
- {{ partial "footer.html" . }}
- </footer>
+<body id="top" class="menu" onload="prettyPrint()">
+ <div id="page" class="cf">
+ {{- partial "header.html" . }}
+ {{- partial "breadcrumb.html" . }}
+ <main class="content cf">
+ <article id="content" class="main">
+ <header><h1>{{ .Title }}</h1></header>
+ {{- block "main" . }}{{ end }}
+ </article>
+ <div class="marginal">
+ {{- partial "menu.html" (dict "menuID" "main" "page" .) }}
+ {{- partial "marginalcontent.html" . }}
+ </div>
+ </main>
+ {{- partial "footer.html" . }}
+ </div>
</body>
</html>