diff --git a/assets/css/050_tags.css b/assets/css/050_tags.css new file mode 100644 index 0000000..7b24637 --- /dev/null +++ b/assets/css/050_tags.css @@ -0,0 +1,50 @@ + + + + + +/***************** + * COMPONENT: TAG + *****************/ + +.tag { + display: flex; + gap: 1ch; + font-family: var(--font-family-monospace); + + .tag__name { + color: var(--text-color-secondary); + text-transform: uppercase; + white-space: nowrap; + + &::after { + content: " ="; + } + } + + .tag__value { + color: var(--text-color-primary); + } + + .tag__value--list { + --spacing: 1ch; + + display: flex; + flex-wrap: wrap; + gap: 0 var(--spacing); + list-style-type: none; + margin-block: 0; + padding-inline-start: 0; + } + + .tag__value__list-item { + padding-inline-start: 0; + white-space: nowrap; + } + + .tag__value__list-item:not(:first-child)::before { + color: var(--text-color-secondary); + content: ":"; + margin-inline-end: var(--spacing); + } +} diff --git a/assets/css/099_page_footer.css b/assets/css/099_page_footer.css index a75d3e0..b7973d3 100644 --- a/assets/css/099_page_footer.css +++ b/assets/css/099_page_footer.css @@ -8,6 +8,7 @@ .page-footer { margin-block-start: var(--space-xl); + font-size: var(--text-s); :last-child { margin-bottom: 0; diff --git a/assets/css/099_page_summary.css b/assets/css/099_page_summary.css index 04a675c..db0a92b 100644 --- a/assets/css/099_page_summary.css +++ b/assets/css/099_page_summary.css @@ -1,3 +1,8 @@ + + + + + /************************** # COMPONENT: PAGE SUMMARY **************************/ @@ -16,8 +21,6 @@ .page-summary__date { color: var(--text-color-secondary); display: block; - font-size: var(--text-s); - line-height: 1; } .page-summary__title { @@ -40,6 +43,11 @@ font-weight: normal; } + .page-summary__date, + .page-summary__draft { + font-size: var(--text-s); + } + :is( .page-summary__heading, .page-summary__subtitle, diff --git a/assets/css/099_taxonomy_list.css b/assets/css/099_taxonomy_list.css deleted file mode 100644 index b6f6a82..0000000 --- a/assets/css/099_taxonomy_list.css +++ /dev/null @@ -1,46 +0,0 @@ - - - - - -/*************************** - * COMPONENT: TAXONOMY LIST - ***************************/ - -.taxonomy-list { - display: flex; - gap: 1ch; - font-family: var(--font-family-monospace); - - .taxonomy-list__name { - color: var(--text-color-secondary); - text-transform: uppercase; - white-space: nowrap; - - &::after { - content: " ="; - } - } - - .taxonomy-list__terms { - --spacing: 1ch; - - display: flex; - flex-wrap: wrap; - gap: 0 var(--spacing); - list-style-type: none; - margin-block: 0; - padding-inline-start: 0; - - li { - padding-inline-start: 0; - white-space: nowrap; - } - - li:not(:first-child)::before { - color: var(--text-color-secondary); - content: ":"; - margin-inline-end: var(--spacing); - } - } -} diff --git a/i18n/en.yaml b/i18n/en.yaml index 6af7897..5f80eef 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -1,2 +1,8 @@ +datePublishedName: Published + +draft: Draft +draftYes: "YES" +draftNo: "NO" + home: Home tableOfContents: Table of Contents diff --git a/layouts/_default/page_summary.html b/layouts/_default/page_summary.html index a7e2076..7a12d9e 100644 --- a/layouts/_default/page_summary.html +++ b/layouts/_default/page_summary.html @@ -7,7 +7,10 @@
{{ . | markdownify }}
{{ end }} {{- end }} - {{ with .Date }} - - {{ end }} + {{- if ne hugo.Environment "production" -}} + {{ partial "page/taxonomy_draft.html" (dict "page" . "class" "page-summary__draft") }} + {{- end -}} + {{- if .Date -}} + {{- partial "page/date.html" (dict "page" . "class" "page-summary__date") -}} + {{- end }} diff --git a/layouts/blog/list.html b/layouts/blog/list.html index 24452d9..818b0c5 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -9,9 +9,11 @@ {{ end -}}
- {{ range .Pages.ByDate.Reverse }} - {{ .Render "page_summary" }} - {{ end }} + {{ range .Pages.ByDate.Reverse -}} + {{ if or (not .Draft) hugo.IsDevelopment }} + {{ .Render "page_summary" }} + {{ end }} + {{- end }}
{{ end }} diff --git a/layouts/partials/page/date.html b/layouts/partials/page/date.html new file mode 100644 index 0000000..c305e53 --- /dev/null +++ b/layouts/partials/page/date.html @@ -0,0 +1,25 @@ +{{/* + + Outputs a date tag for a page. + + @context {Page} .page The current page + @context {String} .date The date, one of "published", or "updated". + @context {String} .class Additional classes to apply to the rendered content. + +*/}} + +{{- $page := .page -}} +{{- $dateName := .date -}} + +{{- $name := "" -}} +{{- $date := $page.Date -}} + +{{- if or (not $dateName) (eq $dateName "date") }} + {{- $name = T "datePublishedName" -}} +{{- else -}} +{{ end -}} + +
+ {{ $name }} + {{ $date | time.Format "2006-01-02" }} +
diff --git a/layouts/partials/page/footer.html b/layouts/partials/page/footer.html index 39f3af7..0c5e840 100644 --- a/layouts/partials/page/footer.html +++ b/layouts/partials/page/footer.html @@ -1,2 +1,5 @@ +{{ if or hugo.IsDevelopment .Draft }} + {{ partial "page/taxonomy_draft.html" (dict "page" .) }} +{{ end }} {{ partial "page/taxonomy_list.html" (dict "page" . "taxonomy" "categories") }} {{ partial "page/taxonomy_list.html" (dict "page" . "taxonomy" "tags") }} diff --git a/layouts/partials/page/taxonomy_draft.html b/layouts/partials/page/taxonomy_draft.html new file mode 100644 index 0000000..ba0d2c5 --- /dev/null +++ b/layouts/partials/page/taxonomy_draft.html @@ -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 -}} +
+ {{ T "draft" }} + {{ T (cond $page.Draft "draftYes" "draftNo") }} +
diff --git a/layouts/partials/page/taxonomy_list.html b/layouts/partials/page/taxonomy_list.html index f684799..677d7c1 100644 --- a/layouts/partials/page/taxonomy_list.html +++ b/layouts/partials/page/taxonomy_list.html @@ -13,10 +13,10 @@ {{- with T $taxonomy (len .) }} {{ $name = . }} {{ end -}} -
- {{ $name }} -