From bb9e38bb3b43bed8ee772e015c94e11b2d141d26 Mon Sep 17 00:00:00 2001
From: Carter McBride <18412686+carterworks@users.noreply.github.com>
Date: Thu, 4 Jul 2024 14:51:42 -0600
Subject: [PATCH] Add yazzy link to each article
---
config/template.html | 5 +++++
public/style.css | 3 ++-
src/index.ts | 1 +
src/renderer.ts | 5 +++++
4 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/config/template.html b/config/template.html
index 63c5ea6..29d6f9e 100644
--- a/config/template.html
+++ b/config/template.html
@@ -122,6 +122,11 @@
{{ item.timestamp | relative}}
+ {% if yazzyUrl %}
+
+ {% endif %}
{% endfor %}
diff --git a/public/style.css b/public/style.css
index 5092d7c..e4d8707 100644
--- a/public/style.css
+++ b/public/style.css
@@ -69,7 +69,8 @@ details:has(li.has-recent) {
}
.article-timestamp,
-.feed-url {
+.feed-url,
+.article-links {
font-size: 0.75em;
}
diff --git a/src/index.ts b/src/index.ts
index 736f230..7b454f9 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -88,6 +88,7 @@ const finishBuild: () => void = async () => {
data: sortedFeeds,
errors: errors,
info: buboInfo,
+ yazzyUrl: process.env.YAZZY_URL,
});
// write the output to public/index.html
diff --git a/src/renderer.ts b/src/renderer.ts
index ce31f38..46dcf02 100644
--- a/src/renderer.ts
+++ b/src/renderer.ts
@@ -10,6 +10,8 @@ import { readFile } from "node:fs/promises";
import { getRelativeTime } from "@feelinglovelynow/get-relative-time";
import type { Feeds, JSONValue } from "./@types/bubo";
+const yazzyUrl = process.env.YAZZY_URL;
+
/**
* Global filters for my Nunjucks templates
*/
@@ -35,15 +37,18 @@ const render = ({
data,
errors,
info,
+ yazzyUrl,
}: {
data: Feeds;
errors: unknown[];
info?: JSONValue;
+ yazzyUrl?: string;
}) => {
return env.renderString(template, {
data,
errors,
info,
+ yazzyUrl,
});
};