Add yazzy link to each article
This commit is contained in:
parent
bcfd79f6a5
commit
bb9e38bb3b
4 changed files with 13 additions and 1 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -69,7 +69,8 @@ details:has(li.has-recent) {
|
|||
}
|
||||
|
||||
.article-timestamp,
|
||||
.feed-url {
|
||||
.feed-url,
|
||||
.article-links {
|
||||
font-size: 0.75em;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue