diff options
| author | Dawid Rycerz <dawid@rycerz.xyz> | 2025-07-22 15:08:37 +0300 |
|---|---|---|
| committer | Dawid Rycerz <dawid@rycerz.xyz> | 2025-07-22 15:08:37 +0300 |
| commit | fcc2f4704e39b0e69b377cc138f75027721dac22 (patch) | |
| tree | 732fc94b354a26c08fba9cc9059f9c6c900182be /astro.config.ts | |
Initial template
Diffstat (limited to 'astro.config.ts')
| -rw-r--r-- | astro.config.ts | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/astro.config.ts b/astro.config.ts new file mode 100644 index 0000000..7afa4c9 --- /dev/null +++ b/astro.config.ts @@ -0,0 +1,94 @@ +import path from 'path'; +import { fileURLToPath } from 'url'; + +import { defineConfig } from 'astro/config'; + +import sitemap from '@astrojs/sitemap'; +import tailwind from '@astrojs/tailwind'; +import mdx from '@astrojs/mdx'; +import partytown from '@astrojs/partytown'; +import icon from 'astro-icon'; +import compress from 'astro-compress'; +import type { AstroIntegration } from 'astro'; + +import astrowind from './vendor/integration'; + +import { readingTimeRemarkPlugin, responsiveTablesRehypePlugin, lazyImagesRehypePlugin } from './src/utils/frontmatter'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); + +const hasExternalScripts = false; +const whenExternalScripts = (items: (() => AstroIntegration) | (() => AstroIntegration)[] = []) => + hasExternalScripts ? (Array.isArray(items) ? items.map((item) => item()) : [items()]) : []; + +export default defineConfig({ + output: 'static', + + devToolbar: { + enabled: false, + }, + + integrations: [ + tailwind({ + applyBaseStyles: false, + }), + sitemap(), + mdx(), + icon({ + include: { + tabler: ['*'], + 'flat-color-icons': [ + 'template', + 'gallery', + 'approval', + 'document', + 'advertising', + 'currency-exchange', + 'voice-presentation', + 'business-contact', + 'database', + ], + }, + }), + + ...whenExternalScripts(() => + partytown({ + config: { forward: ['dataLayer.push'] }, + }) + ), + + compress({ + CSS: true, + HTML: { + 'html-minifier-terser': { + removeAttributeQuotes: false, + }, + }, + Image: false, + JavaScript: true, + SVG: false, + Logger: 1, + }), + + astrowind({ + config: './src/config.yaml', + }), + ], + + image: { + domains: ['cdn.pixabay.com'], + }, + + markdown: { + remarkPlugins: [readingTimeRemarkPlugin], + rehypePlugins: [responsiveTablesRehypePlugin, lazyImagesRehypePlugin], + }, + + vite: { + resolve: { + alias: { + '~': path.resolve(__dirname, './src'), + }, + }, + }, +}); |
