Mirror of
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add last built time

+32 -17
+1 -1
.github/workflows/netlify-daily-build.yaml
··· 2 2 3 3 on: 4 4 schedule: 5 - - cron: "0 2 * * *" # Runs daily at 2:00 AM UTC 5 + - cron: "0 0 * * *" # Runs daily at 0:00 AM UTC 6 6 workflow_dispatch: 7 7 8 8 jobs:
+31 -16
src/pages/index.astro
··· 3 3 import { processPlugins } from "../utils"; 4 4 5 5 const pluginsData = await processPlugins(); 6 + const buildTimeISO = new Date().toISOString(); // Build timestamp 7 + const scheduledTimeUTC = "00:00"; // Static, from GitHub Actions cron 6 8 --- 7 9 8 10 <LunariaLayout title="Starlight Plugins Translation Tracker" {pluginsData}> ··· 14 16 to the plugin author. 15 17 </p> 16 18 <p slot="description"> 17 - In order to translate a missing key into your language, you need to create a 18 - new section in the translation file (if you click on the link you get linked 19 - to this file) with your language and all the keys strings translated from 20 - the <code>"en"</code> section. 21 - </p> 22 - <p slot="description"> 23 - If you are a plugin author that wants to add their plugin to this website, 24 - be sure to follow the convention described in <a 25 - href="https://github.com/HiDeoo/">@HiDeoo</a 26 - >'s <a 27 - href="https://hideoo.dev/notes/starlight-plugin-use-custom-translation-strings" 28 - >blog about translations in Starlight plugins</a 29 - > and then you can add your plugin to <a 30 - href="https://github.com/trueberryless-org/starlight-plugin-translations/blob/main/src%2Fdata.ts" 31 - >this list</a 32 - >. 19 + This website is automatically updated every day at 20 + <span id="local-schedule-time" data-time="00:00">0:00 AM UTC</span>. The 21 + current version was last built on 22 + <span id="build-time" data-iso={buildTimeISO}>loading…</span>. Please check 23 + the plugin repository for the most up-to-date information. 33 24 </p> 34 25 </LunariaLayout> 26 + 27 + <script> 28 + // Format the last build time for the user's locale 29 + const buildTimeEl = document.getElementById("build-time"); 30 + const buildTime = new Date(buildTimeEl.dataset.iso); 31 + buildTimeEl.textContent = buildTime.toLocaleString(undefined, { 32 + dateStyle: "medium", 33 + timeStyle: "short", 34 + }); 35 + 36 + // Convert 02:00 UTC to local time 37 + const scheduleEl = document.getElementById("local-schedule-time"); 38 + const utcTime = scheduleEl.dataset.time; 39 + const [h, m] = utcTime.split(":").map(Number); 40 + const now = new Date(); 41 + const localScheduled = new Date( 42 + Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), h, m) 43 + ); 44 + scheduleEl.textContent = localScheduled.toLocaleTimeString(undefined, { 45 + hour: "2-digit", 46 + minute: "2-digit", 47 + timeZoneName: "short", 48 + }); 49 + </script>