From 549248a50e72c226874322e1fb26b7ae2aca4e50 Mon Sep 17 00:00:00 2001 From: Carter McBride <18412686+carterworks@users.noreply.github.com> Date: Thu, 4 Jul 2024 15:21:27 -0600 Subject: [PATCH] Fix yazzy integration (maybe) (#13) * Remove yazzy url from renderer * Print yazzy url during build * Add yazzy url to action definition --- .github/workflows/build.yml | 3 +++ src/index.ts | 4 +++- src/renderer.ts | 2 -- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7699780..9391080 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,9 @@ on: schedule: - cron: "0 */6 * * *" # At minute 0 past every 6th hour. +env: + YAZZY_URL: ${{ env.YAZZY_URL }} + permissions: pages: write id-token: write diff --git a/src/index.ts b/src/index.ts index 7b454f9..6b21808 100644 --- a/src/index.ts +++ b/src/index.ts @@ -83,12 +83,14 @@ const finishBuild: () => void = async () => { ); } + const yazzyUrl = process.env.YAZZY_URL; + process.stdout.write(`\nUsing yazzy url: "${yazzyUrl}"\n`); // generate the static HTML output from our template renderer const output = render({ data: sortedFeeds, errors: errors, info: buboInfo, - yazzyUrl: process.env.YAZZY_URL, + yazzyUrl }); // write the output to public/index.html diff --git a/src/renderer.ts b/src/renderer.ts index 46dcf02..082279e 100644 --- a/src/renderer.ts +++ b/src/renderer.ts @@ -10,8 +10,6 @@ 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 */