From 8f1fe6115f88bd8df287c52e82f623e2b0c0e599 Mon Sep 17 00:00:00 2001 From: "Z. Charles Dziura" Date: Wed, 23 Apr 2025 00:34:39 -0400 Subject: [PATCH] Create a layout for individual thoughts --- src/_includes/thought.njk | 21 +++++++++++++++++++++ src/index.njk | 4 ++-- src/styles.css | 5 +++++ src/thoughts.njk | 0 src/thoughts/thoughts.11tydata.js | 1 + 5 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 src/_includes/thought.njk delete mode 100644 src/thoughts.njk diff --git a/src/_includes/thought.njk b/src/_includes/thought.njk new file mode 100644 index 0000000..8b04949 --- /dev/null +++ b/src/_includes/thought.njk @@ -0,0 +1,21 @@ +{% extends "base.njk" %} + +{%- block title -%} +Z. Charles Dziura | Thought +{%- endblock -%} + +{%- block body -%} + +{%- import "header.njk" as header -%} +{{ header.header(page='') }} +
+
+
+ {{ page.rawInput | safe }} +
+
+ Posted on {{ page.date | formatDate }} +
+
+
+{%- endblock -%} diff --git a/src/index.njk b/src/index.njk index fec9e4d..5763262 100644 --- a/src/index.njk +++ b/src/index.njk @@ -14,10 +14,10 @@ {%- if post.data.type == "thought" -%}
- + An errant thought... - +
diff --git a/src/styles.css b/src/styles.css index 5bbf58e..f495531 100644 --- a/src/styles.css +++ b/src/styles.css @@ -107,6 +107,11 @@ main > .thought > .content { padding: var(--size-xl) var(--size-2x); } +main > article.thought > .content { + border-top: unset; + margin-top: unset; +} + main > .thought > .content > p:first-of-type { margin: 0; } diff --git a/src/thoughts.njk b/src/thoughts.njk deleted file mode 100644 index e69de29..0000000 diff --git a/src/thoughts/thoughts.11tydata.js b/src/thoughts/thoughts.11tydata.js index ff7d854..9b2a2d4 100644 --- a/src/thoughts/thoughts.11tydata.js +++ b/src/thoughts/thoughts.11tydata.js @@ -3,6 +3,7 @@ import { DateTime } from 'luxon'; export default { date: 'git Created', type: 'thought', + layout: 'thought.njk', permalink: function ({ page }) { const { date, fileSlug, outputFileExtension } = page; const today = DateTime.fromJSDate(date).toUTC();