From cacf9defc5611db26a14769586780cfdd3ef6fef Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 12 Apr 2021 22:07:52 -0400 Subject: [PATCH] Add post preambles that only show on the post page and not on index pages --- lib/metadata.ts | 1 + site/layouts/article.html.ejs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lib/metadata.ts b/lib/metadata.ts index 272ec25..8ae31d2 100644 --- a/lib/metadata.ts +++ b/lib/metadata.ts @@ -23,6 +23,7 @@ export interface PostMetadata extends Metadata { wordCount?: number; excerpt?: string; uuid: string; + preamble?: string; } export async function get(path: string): Promise { diff --git a/site/layouts/article.html.ejs b/site/layouts/article.html.ejs index 018c24b..cc9951e 100644 --- a/site/layouts/article.html.ejs +++ b/site/layouts/article.html.ejs @@ -9,6 +9,9 @@ metadata.layout = "default.html.ejs" <%- include("../includes/article-meta.html.ejs", { metadata }) %>
+ <% if (metadata.preamble) { %> + <%- metadata.preamble %> + <% } %> <%- content %>