blob: 5a2c91fdedd51fcf08b000e2aaafecd050b19b3e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
{{- $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 }}
{{- if .Params.nonpage }}
<li>{{.Name }}
{{- else if .Params.placeholder }}
<li class="placeholder">{{.Name }}
{{- else}}
<li><b><a href="{{ .URL }}">{{ .Name }}</a></b>
{{- partial "inline/menu/new-or-up.html" (dict "page" ($page.GetPage .URL)) }}
{{- end}}
{{- if .Params.inlineChildren}}
{{- with .Children }}
- {{- partial "inline/menu/inline.html" (dict "page" $page "menuEntries" .) }}
{{- end}}
{{- else}}
{{- with .Children }}
<ul>{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}</ul>
{{- end }}
</li>
{{- end}}
{{- end }}
{{- end }}
{{- define "partials/inline/menu/inline.html" }}
{{- $page := .page }}
{{- range .menuEntries }}
<a href="{{ .URL }}"> {{ .Name }}</a>{{- partial "inline/menu/new-or-up.html" (dict "page" ($page.GetPage .URL)) }}
{{- end }}
{{- end }}
{{- define "partials/inline/menu/new-or-up.html" }}
{{- if lt (div (now.Sub .page.PublishDate).Hours 24) 15}}
<span class="new">(new)</span>
{{- else}}
{{if lt (div (now.Sub .page.Lastmod).Hours 24) 15}}
<!-- <span class="new">(updated)</span> -->
{{- end}}
{{- end}}
{{- end }}
|