Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .vitepress/config/inlined-scripts/banner.js

This file was deleted.

20 changes: 11 additions & 9 deletions .vitepress/config/shared.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import { readFileSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { defineConfig, HeadConfig } from "vitepress";
import { groupIconMdPlugin, groupIconVitePlugin } from "vitepress-plugin-group-icons";
import llmstxt from "vitepress-plugin-llms";
import BLOG_SIDEBAR from "../sidebar.blog.json" with { type: "json" };

function inlineScript(file: string): HeadConfig {
return ["script", {}, readFileSync(resolve(__dirname, `./inlined-scripts/${file}`), "utf-8")];
}
const latestBlog = BLOG_SIDEBAR[0];
const bannerScript = `(() => {
const saved = localStorage.getItem("oxc-banner-dismissed-${latestBlog.link}");
if (saved === "true") {
document.documentElement.classList.add("banner-dismissed");
}
})();`;

const head: HeadConfig[] = [
[
Expand Down Expand Up @@ -39,7 +42,7 @@ const head: HeadConfig[] = [
},
],
// banner
inlineScript("banner.js"),
["script", {}, bannerScript],
// Fathom Analytics
[
"script",
Expand Down Expand Up @@ -113,11 +116,10 @@ export const sharedConfig = defineConfig({
themeConfig: {
variant: "oxc",

// NOTE: Also update banner.js when changing this
banner: {
id: "type-aware-alpha",
text: "Announcing Type-Aware Linting Alpha",
url: "https://oxc.rs/blog/2025-12-08-type-aware-alpha",
id: latestBlog.link,
text: `Announcing ${latestBlog.text}`,
url: latestBlog.link,
},

siteTitle: "Oxc",
Expand Down