Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/vtbag/website. The @vtbag website. ⭐️ Please star to support this work! ⭐️
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340import { defineConfig } from "astro/config";import starlight from "@astrojs/starlight";import { createExternalLinksPlugin,} from "./src/markdown/satteri-hast-plugins";
import { satteri } from '@astrojs/markdown-satteri';import { viewTransitions, hastMarkEndOfMarkdown } from "astro-vtbot/starlight-view-transitions";
import vtbot from "astro-vtbot";import d2 from "astro-d2";import inoxToolsPortalGun from "@inox-tools/portal-gun";import type { Badge } from "./node_modules/@astrojs/starlight/schemas/badge";//import sitemap from '@astrojs/sitemap';
export default defineConfig({ image: { remotePatterns: [{ protocol: "https" }] }, devToolbar: { enabled: false }, site: "https://vtbag.dev", compressHTML: false,
prefetch: false,
markdown: { shikiConfig: { themes: { light: "github-light", dark: "github-dark", }, }, processor: satteri({ hastPlugins: [ hastMarkEndOfMarkdown("hurz"), createExternalLinksPlugin({ target: "_blank", marker: "↗", }), ], }), },
trailingSlash: "always",
integrations: [ starlight({ title: "@vtbag", routeMiddleware: ["./src/middleware/overview-link.ts"], plugins: [ viewTransitions({ declarativeNames: ":is(h2, h3):not(.no-vtbag-decl *) = vtbag-h-; :is(starlight-toc span):not(.no-vtbag-decl *) = vtbag-toc~; :root:not(:has(.hero)) .site-title img, :root:has(.hero) .hero img = site-logo", }) ], components: { Head: "./src/components/NHead.astro", PageTitle: "./src/components/PageTitle.astro", Sidebar: "./src/components/Sidebar.astro", }, tableOfContents: { minHeadingLevel: 2, maxHeadingLevel: 4, }, head: [ { tag: "meta", attrs: { property: "og:image", content: "https://vtbag.dev/social.png", } }, { tag: "meta", attrs: { property: "article:publisher", content: "https://bsky.app/profile/vtbag.dev" } }, { tag: "meta", attrs: { property: "article:author", content: "https://bsky.app/profile/martr.app" } }, { tag: "meta", attrs: { property: "article:tag", content: "view transitions" } }, { tag: "meta", attrs: { property: "article:section", content: "Articles" } }, { tag: "meta", attrs: { name: "robots", content: "index, follow", }, }, { tag: "script", attrs: { type: "module" }, content: ` document.addEventListener('starlight:theme-change', (e) => { e.preventDefault(); const { theme, resolvedTheme, source } = e.detail; if (source !== 'initial') { document.startViewTransition({types: ['light-dark'], update: () => (document.documentElement.dataset.theme = resolvedTheme)}); } else { document.documentElement.dataset.theme = resolvedTheme; } });`, }, { tag: "meta", attrs: { name: "googlebot", content: "index, follow, max-video-preview:-1, max-image-preview:large, max-snippet:-1", }, }, { tag: "link", attrs: { rel: "me", href: "https://mastodon.social/@martrapp", }, }, { tag: "meta", attrs: { name: "viewport", content: "width=device-width, initial-scale=1.0, minimum-scale=1.0", }, }, ],
customCss: [ "./src/styles/custom.css", "./src/styles/sidebar.css", "./src/styles/view-transitions.css", "./src/styles/vtbag-bar.css", ], lastUpdated: true, pagination: true, favicon: "/bag4.ico", logo: { src: "./src/assets/mini-bag.webp", alt: "vtbag logo", },
social: [ { icon: "rss", label: "RSS", href: "/rss.xml", }, { icon: "github", label: "GitHub", href: "https://github.com/vtbag/website", }, { icon: "blueSky", label: "Bluesky", href: "https://bsky.app/profile/vtbag.dev", }, ], editLink: { baseUrl: "https://github.com/vtbag/website/edit/main/", },
sidebar: sidebar(), }), d2({ skipGeneration: process.env.GITHUB_ACTIONS === "true", theme: { default: "0", }, }), vtbot({ autoLint: false, loadingIndicator: false }), inoxToolsPortalGun(), /*sitemap({ filter: (page) => !page.startsWith('https://vtbag.dev/auto/') && !page.startsWith('https://vtbag.dev/backdrop-demo/') && !page.startsWith('https://vtbag.dev/cards/') && !page.includes('-demo/') && !page.includes('-demo2/') && !page.startsWith('https://vtbag.dev/demo/') && !page.startsWith('https://vtbag.dev/demo-explainer/') && !page.startsWith('https://vtbag.dev/forge/') && !page.startsWith('https://vtbag.dev/basics/hide-and-seek/list-') && !page.startsWith('https://vtbag.dev/basics/hide-and-seek/list/') && !page.startsWith('https://vtbag.dev/basics/hide-and-seek/problem/') && !page.startsWith('https://vtbag.dev/basics/hide-and-seek/solution/') && !page.startsWith('https://vtbag.dev/basics/pseudos-') && !page.startsWith('https://vtbag.dev/crossing/') && !page.startsWith('https://vtbag.dev/tests/') && !page.startsWith('https://vtbag.dev/navigation-types/') && !page.startsWith('https://vtbag.dev/tmp/'), }), */ ],
vite: { build: { // assetsInlineLimit: 4096, minify: false, cssMinify: false, }, server: { fs: { allow: [".."], }, allowedHosts: [".trycloudflare.com"], }, optimizeDeps: {
include: [ 'unified', 'remark-parse', 'remark-rehype', 'rehype-stringify', 'rehype-expressive-code', '@expressive-code/core' // Covers Shiki/plugin deps ] } /* plugins: [visualizer({ brotliSize: true })]*/, },});
function sidebar() { return [ { label: "@vtbag", link: "/vtbag/", }, { label: "Basic Information", items: [ { label: "Test Your Browser", link: "/basics/test-page/" }, { label: "View Transition API", link: "/basics/api/" }, { label: "View Transition Examples", link: "/basics/examples/", }, { label: "Names and Pseudo-Elements", link: "/basics/pseudos/", badge: { text: "Updated!", variant: "success" } as Badge }, { label: "Mechanics of Default Animations", link: "/basics/default-animations/", }, { label: "Styling View Transitions", link: "/basics/styling/", badge: { text: "Updated!", variant: "success" } as Badge }, { label: "JavaScript API", link: "/basics/javascript/" }, { label: "Playing Hide & Seek", link: "/basics/hide-and-seek/", }, { label: "API Levels and Implications", link: "/basics/levels/" }, { label: "Web Framework Support", link: "/basics/frameworks/" }, ], }, { label: "Tools & Libraries", items: [ { label: "Inspection Chamber", link: "/tools/inspection-chamber/" }, { label: "Element Crossing", link: "/tools/element-crossing/" }, { label: "Turn Signal", link: "/tools/turn-signal/" }, { label: "Cam-Shaft", link: "/tools/cam-shaft/" }, { label: "Utensil Drawer", link: "/tools/utensil-drawer/", }, ], }, { label: "Fun with View Transitions", items: [ { label: "Overview", link: "/fwvt/welcome/" }, { label: "Enabling", link: "/fwvt/enabling/" }, { label: "Customizing", link: "/fwvt/customizing/" }, { label: "Morphing", link: "/fwvt/morphing/" }, { label: "Healing", link: "/fwvt/healing/" }, { label: "Twinkling", link: "/fwvt/twinkling/" }, { label: "Uncovering", link: "/fwvt/uncovering/" }, { label: "Playing", link: "/fwvt/playing/", }, ], }, { label: "Tips & Tricks", items: [ { label: "Where to Place the CSS", link: "/tips/css/" }, { label: "Flickering During Fade Animations?", link: "/tips/over-exposure/", }, { label: "Avoid Pointer Flickering", link: "/tips/pointer/" }, { label: "Pseudo-Smooth-Scrolling?", link: "/tips/pseudo-smooth-scrolling/", }, { label: "Automatic Names", link: "/tips/auto-names/" }, { label: "Retaining Interactivity", link: "/tips/interactivity/", }, { label: "Why View Transitions Might Fail", link: "tips/view-transition-fails-and-fixes/", }, ], }, { label: "BagLog", link: "/baglog" }, { label: "All Tech Demos", collapsed: false, items: [ { label: "Inspection Chamber in Action", link: "/inspection-chamber-demo/first-page/", }, { label: "State Loss on Navigation", link: "/crossing/plain/1/" }, { label: "Preserved State", link: "/crossing/vanilla/1/" }, { label: "Preserved State (exp.)", link: "/crossing/over-the-top/1/" }, { label: "Google Demo, but with link-types plumbing", link: "/navigation-types/" }, { label: "Rocket Demo (at vtbot's website)", link: "https://events-3bg.pages.dev/jotter/styling/#outlines-for-testing" }, { label: "Turn Signal Directions", link: "/signal-demo/bag/" }, { label: "Image Viewer Demo", link: "/viewer-demo/" }, { label: "🌟 Fishpond Demo", link: "/link-demo/" }, { label: "Pseudo-Smooth-Scrolling", link: "/shaft-demo/1/" }, { label: "Instant scrolling with Cam-Shaft", link: "/shaft-demo2/1/" }, { label: "Can't confine List Elements", link: "/basics/hide-and-seek/problem/", }, { label: "Simulated Nested View Transition Groups", link: "/basics/hide-and-seek/solution/", }, { label: "🌟 Swirling Image Gallery 🦊", link: "/tips/auto-names/" }, { label: "🌟 Derived Trajectories 🦊", link: "/vector-demo/" }, { label: "🌟 Game of Life 🦊", link: "/chaining-demo/" }, { label: "🌟Tower of Hanoi 🦊", link: "https://fun-with-view-transitions.pages.dev/episode/7/page", }, ], }, ];}