Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dataCobra/hugo-vitae.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHollander, Nicholas Hackett <nhhollander@wpi.edu>2021-10-06 18:23:33 +0300
committerHollander, Nicholas Hackett <nhhollander@wpi.edu>2021-10-06 18:23:33 +0300
commit630554a04f801c2907660fd935900b32656133e9 (patch)
tree91211dfcd6eb17bbc085baa884e527658db0adcf
parentda071e7d6fefc0f6a8c46c2a1019e47bd84cb473 (diff)
Added post labeling partial.
This partial provides a consistent draft and future status indicator throughout the site.
-rw-r--r--layouts/_default/list.html2
-rw-r--r--layouts/_default/single.html2
-rw-r--r--layouts/index.html2
-rw-r--r--layouts/partials/post_label.html1
4 files changed, 4 insertions, 3 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 78ae272..38cc95f 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -19,7 +19,7 @@
</div>
<div class="matter">
<article>
-<h3 class="title small"><a href="{{ .RelPermalink }}">{{.Title}}{{ if .Draft }}<sup class="draft-label">DRAFT</sup>{{ end }}</a></h3>
+<h3 class="title small"><a href="{{ .RelPermalink }}">{{.Title}}{{ partial "post_label.html" (dict "post" .)}}</a></h3>
{{- if not .Params.hidemeta }}
<p class="post-meta">
{{ partial "post_meta.html" . }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index b2d6300..be46668 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -18,7 +18,7 @@
</div>
{{- end }}
<div class="matter">
-<h1 class="title">{{ .Title }}</h1>
+<h1 class="title">{{ .Title }}{{ partial "post_label.html" (dict "post" .) }}</h1>
{{- if not .Params.hidemeta }}
<p class="post-meta">
{{ partial "post_meta.html" . }}
diff --git a/layouts/index.html b/layouts/index.html
index cb1ee48..66e5ae8 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -64,7 +64,7 @@
</div>
<div class="matter">
<article>
-<h3 class="title small"><a href="{{ .RelPermalink }}">{{.Title}}{{ if .Draft }}<sup class="draft-label">DRAFT</sup>{{ end }}</a></h3>
+<h3 class="title small"><a href="{{ .RelPermalink }}">{{.Title}}{{partial "post_label.html" (dict "post" .)}}</a></h3>
{{- if not .Params.hidemeta }}
<p class="post-meta">
{{ partial "post_meta.html" . }}
diff --git a/layouts/partials/post_label.html b/layouts/partials/post_label.html
new file mode 100644
index 0000000..cbc14a0
--- /dev/null
+++ b/layouts/partials/post_label.html
@@ -0,0 +1 @@
+{{ if .post.Draft }}<sup class="draft-label">DRAFT</sup>{{ end }}{{ if gt .post.Date now }}<sup class="draft-label">FUTURE</sup>{{ end }} \ No newline at end of file