···2233on:
44 schedule:
55- - cron: "0 2 * * *" # Runs daily at 2:00 AM UTC
55+ - cron: "0 0 * * *" # Runs daily at 0:00 AM UTC
66 workflow_dispatch:
7788jobs:
+31-16
src/pages/index.astro
···33import { processPlugins } from "../utils";
4455const pluginsData = await processPlugins();
66+const buildTimeISO = new Date().toISOString(); // Build timestamp
77+const scheduledTimeUTC = "00:00"; // Static, from GitHub Actions cron
68---
79810<LunariaLayout title="Starlight Plugins Translation Tracker" {pluginsData}>
···1416 to the plugin author.
1517 </p>
1618 <p slot="description">
1717- In order to translate a missing key into your language, you need to create a
1818- new section in the translation file (if you click on the link you get linked
1919- to this file) with your language and all the keys strings translated from
2020- the <code>"en"</code> section.
2121- </p>
2222- <p slot="description">
2323- If you are a plugin author that wants to add their plugin to this website,
2424- be sure to follow the convention described in <a
2525- href="https://github.com/HiDeoo/">@HiDeoo</a
2626- >'s <a
2727- href="https://hideoo.dev/notes/starlight-plugin-use-custom-translation-strings"
2828- >blog about translations in Starlight plugins</a
2929- > and then you can add your plugin to <a
3030- href="https://github.com/trueberryless-org/starlight-plugin-translations/blob/main/src%2Fdata.ts"
3131- >this list</a
3232- >.
1919+ This website is automatically updated every day at
2020+ <span id="local-schedule-time" data-time="00:00">0:00 AM UTC</span>. The
2121+ current version was last built on
2222+ <span id="build-time" data-iso={buildTimeISO}>loading…</span>. Please check
2323+ the plugin repository for the most up-to-date information.
3324 </p>
3425</LunariaLayout>
2626+2727+<script>
2828+ // Format the last build time for the user's locale
2929+ const buildTimeEl = document.getElementById("build-time");
3030+ const buildTime = new Date(buildTimeEl.dataset.iso);
3131+ buildTimeEl.textContent = buildTime.toLocaleString(undefined, {
3232+ dateStyle: "medium",
3333+ timeStyle: "short",
3434+ });
3535+3636+ // Convert 02:00 UTC to local time
3737+ const scheduleEl = document.getElementById("local-schedule-time");
3838+ const utcTime = scheduleEl.dataset.time;
3939+ const [h, m] = utcTime.split(":").map(Number);
4040+ const now = new Date();
4141+ const localScheduled = new Date(
4242+ Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), h, m)
4343+ );
4444+ scheduleEl.textContent = localScheduled.toLocaleTimeString(undefined, {
4545+ hour: "2-digit",
4646+ minute: "2-digit",
4747+ timeZoneName: "short",
4848+ });
4949+</script>