Files
ta1sph.info/astro.config.mjs
T
suphicakir 7d8fcce2e1 feat: add OG images, favicon set, manifest and performance tuning
- Build-time Open Graph cards per post and a default card (Satori + Sharp)
- Favicon/ICO/apple-touch/manifest icons generated from one SVG (npm run icons)
- robots.txt and web manifest generated from site.json
- Subset self-hosted fonts to Latin + Turkish (188 KB -> 66 KB) with preload
- Inline the stylesheet to remove the render-blocking request
- Post-build site audit (npm run check:site): h1, alt, SEO tags, links
- Omit canonical on noindex pages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 02:36:56 +03:00

49 lines
1.6 KiB
JavaScript

// @ts-check
import { defineConfig } from 'astro/config';
import tailwindcss from '@tailwindcss/vite';
import mdx from '@astrojs/mdx';
import sitemap from '@astrojs/sitemap';
import node from '@astrojs/node';
import icon from 'astro-icon';
import { satteri } from '@astrojs/markdown-satteri';
import { externalLinksPlugin, figurePlugin } from './src/lib/markdown-plugins.mjs';
/**
* Dev-only routes (style preview); never part of a production build.
* @type {import('astro').AstroIntegration}
*/
const devRoutes = {
name: 'dev-routes',
hooks: {
'astro:config:setup': ({ command, injectRoute }) => {
if (command !== 'dev') return;
injectRoute({ pattern: '/styleguide', entrypoint: './src/dev/Styleguide.astro' });
},
},
};
// https://astro.build/config
export default defineConfig({
site: 'https://ta1sph.info',
trailingSlash: 'always',
// Static by default; only routes with `export const prerender = false` (view counter API) run on the server.
output: 'static',
adapter: node({ mode: 'standalone' }),
// One small stylesheet: inlining it removes a render-blocking request on every page.
build: { inlineStylesheets: 'always' },
integrations: [mdx(), sitemap(), icon({ include: { tabler: ['*'] } }), devRoutes],
markdown: {
processor: satteri({ hastPlugins: [figurePlugin, externalLinksPlugin] }),
// Dual themes; colours switch with [data-theme] in global.css.
shikiConfig: {
themes: { light: 'github-light-high-contrast', dark: 'github-dark-high-contrast' },
defaultColor: false,
wrap: false,
},
},
vite: {
plugins: [tailwindcss()],
},
});