A more generic tag/value component

Write styles and templates for a more generic tag/value component. Use this component
for the taxonomy lists, draft tag, and page dates in the summary template.
This commit is contained in:
Eryn Wells 2024-10-12 10:45:52 -07:00
parent b51aca950c
commit edd6eb996b
11 changed files with 123 additions and 58 deletions

View file

@ -0,0 +1,13 @@
{{- /*
Outputs a DRAFT tag for the page.
@context {Page} .page The current page
@context {String} .class A list of additional classes to apply to the top-level element
*/ -}}
{{- $page := .page -}}
<div class="{{ with .class }}{{ . }} {{ end }}tag tag--draft" data-name="draft">
<span class="tag__name">{{ T "draft" }}</span>
<span class="tag__value">{{ T (cond $page.Draft "draftYes" "draftNo") }}</li>
</div>