summaryrefslogtreecommitdiff
path: root/layouts/partials/menu
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/menu')
-rw-r--r--layouts/partials/menu/item.html31
-rw-r--r--layouts/partials/menu/new-or-up.html9
2 files changed, 40 insertions, 0 deletions
diff --git a/layouts/partials/menu/item.html b/layouts/partials/menu/item.html
new file mode 100644
index 00000000..599f2db9
--- /dev/null
+++ b/layouts/partials/menu/item.html
@@ -0,0 +1,31 @@
+{{- $page := .page }}
+{{- $item := .item }}
+{{- $pageItem := $page.GetPage $item.URL }}
+
+{{- if $pageItem.Params.menu_item_override }}
+
+ {{- if $pageItem.Params.menu_item_override_start_li }}
+ <li>
+ {{- end}}
+
+ {{$item.Pre}}<b><a href="{{ $item.URL }}">{{ $pageItem.Params.menu_item_override }}</a></b>{{- partial "menu/new-or-up.html" (dict "page" $pageItem) }}{{$item.Post}}
+ {{- if $pageItem.Params.menu_item_override_end_li }}
+ </li>
+ {{- end}}
+
+{{- else}}
+
+<li>
+ {{- if $item.Params.nonpage }}
+ {{$item.Name }}{{ $item.Post }}
+ {{- else if $item.Params.placeholder }}
+ <span class="placeholder">{{$item.Name }}{{ $item.Post }}</span>
+ {{- else}}
+ <b><a href="{{ $item.URL }}">{{ $item.Name }}</a></b>
+ {{- partial "menu/new-or-up.html" (dict "page" $pageItem) }}
+ {{ $item.Post }}
+ {{- end}}
+
+</li>
+
+{{- end}}
diff --git a/layouts/partials/menu/new-or-up.html b/layouts/partials/menu/new-or-up.html
new file mode 100644
index 00000000..9eb9a9f9
--- /dev/null
+++ b/layouts/partials/menu/new-or-up.html
@@ -0,0 +1,9 @@
+{{- 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) 10 }}
+ <span class="new">(updated)</span>
+ {{- end}}
+
+{{- end}}