chore: upgrade to nuxt 4

This commit is contained in:
eggy
2025-10-19 15:32:55 +08:00
parent e814c77333
commit 21c717ed79
50 changed files with 3353 additions and 4155 deletions

View File

@@ -1,3 +1,3 @@
Sitemap: https://eggworld.me/sitemap.xml
Sitemap: https://eggipelago.com/sitemap.xml
User-agent: *
Disallow:

View File

@@ -23,13 +23,13 @@ if (darkToggle) {
const FEED_URL = "https://api.github.com/users/potatoeggy/events";
const results = (await (await fetch(FEED_URL)).json());
const latestEvent = results.find((e) => e.type === "PushEvent");
const latestCommit = latestEvent.payload.commits[0];
const latestCommit = latestEvent.payload.head;
const commitImg = document.getElementById("github-commit-img");
const commitAnchor = document.getElementById("github-commit-a");
if (commitImg) {
commitImg.src = `https://opengraph.githubassets.com/hash/${latestEvent.repo.name}/commit/${latestCommit.sha}`;
commitImg.src = `https://opengraph.githubassets.com/hash/${latestEvent.repo.name}/commit/${latestCommitSha}`;
}
if (commitAnchor) {
commitAnchor.href = `https://github.com/${latestEvent.repo.name}/commit/${latestCommit.sha}`;
commitAnchor.href = `https://github.com/${latestEvent.repo.name}/commit/${latestCommitSha}`;
}
export {};

View File

@@ -2,7 +2,7 @@
// of all the nuxt bs while we wait for static generation
// to actually become a thing in nuxt 3
import type { GithubPushEvent } from "../shared/github";
import type { GithubPushEvent } from "../app/shared/github";
const html = document.getElementsByTagName("html")[0];
html.className = localStorage.theme ?? "light";
@@ -36,7 +36,7 @@ const results = (await (await fetch(FEED_URL)).json()) as GithubPushEvent[];
const latestEvent = results.find(
(e) => e.type === "PushEvent"
) as GithubPushEvent;
const latestCommit = latestEvent.payload.commits[0];
const latestCommitSha = latestEvent.payload.head;
const commitImg = document.getElementById(
"github-commit-img"
@@ -46,11 +46,11 @@ const commitAnchor = document.getElementById(
) as HTMLAnchorElement;
if (commitImg) {
commitImg.src = `https://opengraph.githubassets.com/hash/${latestEvent.repo.name}/commit/${latestCommit.sha}`;
commitImg.src = `https://opengraph.githubassets.com/hash/${latestEvent.repo.name}/commit/${latestCommitSha}`;
}
if (commitAnchor) {
commitAnchor.href = `https://github.com/${latestEvent.repo.name}/commit/${latestCommit.sha}`;
commitAnchor.href = `https://github.com/${latestEvent.repo.name}/commit/${latestCommitSha}`;
}
// to make this an esm module for top-level await