summaryrefslogtreecommitdiff
path: root/astro.config.ts
diff options
context:
space:
mode:
authorDawid Rycerz <dawid@rycerz.xyz>2025-07-21 21:56:55 +0300
committerDawid Rycerz <dawid@rycerz.xyz>2025-07-21 21:56:55 +0300
commitc735556726e75428550a3d28a2cf58e2c8490b7d (patch)
treefd0ae29d1636b825abeedff6b99d3376bb383135 /astro.config.ts
Initial template
Diffstat (limited to 'astro.config.ts')
-rw-r--r--astro.config.ts90
1 files changed, 90 insertions, 0 deletions
diff --git a/astro.config.ts b/astro.config.ts
new file mode 100644
index 0000000..462563a
--- /dev/null
+++ b/astro.config.ts
@@ -0,0 +1,90 @@
+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',
+
+ 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'),
+ },
+ },
+ },
+});