Add yazzy link to each article

This commit is contained in:
Carter McBride 2024-07-04 14:51:42 -06:00
parent bcfd79f6a5
commit bb9e38bb3b
4 changed files with 13 additions and 1 deletions

View file

@ -122,6 +122,11 @@
<div class="article-timestamp">
<relative-time data-time="{{item.timestamp}}">{{ item.timestamp | relative}}</relative-time>
</div>
{% if yazzyUrl %}
<div class="article-links">
<a href="{{ yazzyUrl }}/{{ item.link }}" target="_blank" rel="noreferrer noopener">yazzy</a>
</div>
{% endif %}
</li>
{% endfor %}
</ul>

View file

@ -69,7 +69,8 @@ details:has(li.has-recent) {
}
.article-timestamp,
.feed-url {
.feed-url,
.article-links {
font-size: 0.75em;
}

View file

@ -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

View file

@ -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,
});
};