Skip to content

Commit f0b644d

Browse files
authored
feat!: AstroPaper v6 (#631)
* feat: add initial configuration and social icons for AstroPaper theme * feat: add theme styles and design tokens * chore: configure Astro with sitemap, i18n, fonts, and tooling - Set site URL, i18n (single locale, no prefix), sitemap integration - Add Google Sans Code font via stable fonts API - Configure Shiki dual-theme markdown (min-light / night-owl) - Fix astro-paper.config.ts to use relative import (alias not available when Vite loads root-level config files) - Add @astrojs/sitemap and @typescript-eslint/parser dependencies - Wire @typescript-eslint/parser into ESLint so TypeScript syntax in Astro frontmatter (type Props, etc.) parses correctly * feat: add base styles, dark variant, and typography - global.css: dark variant via [data-theme], base layer for * / a / button selectors, scrollbar tokens, layout utilities (max-w-app, app-layout), active-nav as @Utility for Tailwind variant support - html and body classes moved directly onto elements in BaseLayout (Tailwind-native approach) so only truly global selectors remain here - typography.css: prose overrides, Shiki light/dark code block switching, diff/highlight/word-highlight transformer styles * feat: add i18n types, English strings, and useTranslations helper Plain typed object approach — no third-party i18n library needed. Paraglide.js was considered but requires SSR output (hard blocker for a static Astro site). - UIStrings interface with nav, post, pagination, and a11y groups - en.ts with `satisfies UIStrings` for literal-type preservation - useTranslations(locale) helper falls back to English automatically Adding a new language is a one-file addition; full routing stays as a registry add-on. * feat: add client-side theme toggle script - Reads window.__theme.value set by the inline FOUC-prevention script to avoid re-detecting the theme on first load - Toggles data-theme on <html> and persists to localStorage - Fills <meta name="theme-color"> with the computed background colour so Android's browser chrome matches the page - Re-runs setup on astro:after-swap for View Transitions navigation - Carries theme-color across astro:before-swap to prevent navbar flicker on Android during page transitions - Syncs with OS prefers-color-scheme changes at runtime * feat: add BaseLayout and PostLayout BaseLayout (replaces scaffold Layout.astro): - Font, canonical URL via Astro.site, RSS autodiscovery - FOUC-prevention inline script sets data-theme before first paint and exposes window.__theme.value for theme.ts to reuse - html/body classes on elements directly (Tailwind-native) - <slot name="head"> for child layout injection - ClientRouter for View Transitions (respects lightAndDarkMode flag) - googleVerification rendered from config instead of .env — it is a public string, not a secret, and not environment-specific PostLayout (new): - Wraps BaseLayout; injects article-specific head content via slot - Overrides og:type to "article" - Adds article:published_time / article:modified_time conditionally - JSON-LD BlogPosting with conditional datePublished/dateModified (fixes old bug where absent dates produced "undefined" string) - Structured data only on actual post pages (not home/archives/tags) SiteConfig: add optional googleVerification field * chore: replace scaffold index page with BaseLayout placeholder * feat: add Header component * feat: add Footer and Socials component * chore: install dayjs, slugify, zod, @astrojs/mdx and add MDX integration * feat: add resolved config that applies defaults in one place Defaults for posts, features, socials, and shareLinks are merged in src/config.ts so all consuming code gets non-optional types with no scattered ?? fallbacks. * feat: add content schema, blog path, and post utilities Renames collection blog→posts, moves content to src/content/posts/, adds .mdx support, and adds a typed pages collection. Includes getSortedPosts, postFilter, getPath, and slugify utilities. * feat: add Datetime and Card components * refactor: switch layouts and components to resolved config Replaces @/astro-paper.config imports with @/config and removes optional chaining on feature flags now that the resolved config guarantees non-optional values. * feat: add home and footer i18n strings * feat: implement home page with hero, featured, and recent posts Replaces the BaseLayout placeholder with the full index page: hero section with RSS link and social links, featured posts section, recent posts capped at posts.perIndex, and an All Posts link. All section labels come from i18n. * feat: add pagination component * feat: add Breadcrumb component with locale support * feat: add Main component * refactor: update code formatting in Card.astro * feat: add posts page * fix: add missing @astrojs/mdx dependency * refactor: rename meta to pages in i18n * refactor: improve code formatting in Breadcrumb * refactor: destructure props in Main component for clarity * feat: add tag pages * feat: add About page * chore: update i18n configuration to use site language from config * feat: add Archives page * feat: integrate Pagefind search functionality * feat: add dynamic Open Graph image generation for posts * feat: add post detail page * feat: add Shiki transformers * chore: remove unused edit link text * chore: update .gitignore to include generated Pagefind directory * chore: update site URL in configuration to production link * chore: replace favicon and remove unused SVG assets, add new Open Graph image * feat: update site config with default values * feat: add default OG image path resolution * fix: ensure edit post feature checks for enabled status correctly * feat: implement dynamic Open Graph image generation * feat: add RSS feed generation functionality * feat: add 404 Not Found page * feat: add robots.txt generation for SEO optimization * refactor: change getSortedPosts to a named export * refactor: change postFilter to a named export * refactor: rename BaseLayout to Layout * refactor: standardize locale handling across components * refactor: update getPostsByGroupCondition location * chore: remove unused Welcome component * refactor(i18n): update links using getRelativeLocaleUrl * refactor(i18n): add dynamic locale loading * fix: update language attribute to use current locale * fix: correct wording for updatedAt in post translations * fix: update layout titles to use correct translation keys for tags pages * chore: use new colors for better DX and a11y * feat: add underline icon for active icon nav * feat: add toc for markdown contents * refactor: remove unused feature flags in config * refactor(i18n): enhance locale handling and path management * fix: ts unused variable hint * refactor: extract locale stripping logic into a util func * refactor(i18n): improve locale handling in tag pages * refactor: update post URL helper functions * refactor(i18n): replace pathWithBase with getRelativeLocaleUrl for locale handling * refactor: rename fileWithBase to getAssetPath * refactor: use runtime agnostic APIs for file paths * refactor: use transition directive for heading transition * refactor: remove unused title element from tag page * fix: decouple ClientRouter from lightAndDarkMode flag * refactor: rename `postPaths.ts` to `getPostPaths.ts` * refactor: remove unused `minutesRead` string from post translations * refactor: simplify AdjacentPostNav component by passing prevPost and nextPost directly * refactor: remove unused code declaration * docs: add existing blog posts * chore: update astro and @astrojs/check dependencies to latest versions * build: use experimental svg optimizer * chore(repo): restore project meta files and Docker configs * refactor: update code formatting with Prettier * docs: update README and docs * docs: add JSDoc comments to utility functions * docs: add JSDoc comments to resolved config file * fix(og): avoid double slashes when appending index.png * chore(ci): update Node.js version to 22.12.0 in CI workflow * feat: improve og image generation with Astro's getFontFileURL API (#632) * feat: improve og image generation with Astro's getFontFileURL API - remove @resvg/resvg-js and use sharp to convert SVG to PNG - update og image generation to use Astro's getFontFileURL API for better font handling * docs: update README and dynamic OG images documentation - remove outdated content and clarify dynamic OG image generation process in README. - add new image example and update instructions for handling non-Latin characters in dynamic OG images. - adjust copyright year in README to 2026. * fix(header): adjust icon button alignment in mobile * feat(docs): add ResponsiveTable to use it in MDX posts (#634) * feat(docs): add ResponsiveTable to use it in MDX posts Introduce ResponsiveTable with variant-based styling. Rename docs posts to .mdx, wrap tables in the component, and remove redundant table `code` rules from prose typography. * chore(prettier): ignore .mdx files when checking format * chore(ci): update Node.js version to 24 in CI workflow * bump: upgrade Astro and dependencies * fix: remove redundant backUrl script bug * fix(header): adjust button and icon alignment * fix(a11y): improve muted-foreground color contrast * docs: update predefined color schemes * chore: support site verification env as fallback for googleVerification * docs: add astro paper v6 updates in docs * docs: add AstroPaper-v6.png in astro-paper-6 blog post * fix: update back-to-top button DOM placement (#641) Closes #626, #131, #493
1 parent f300532 commit f0b644d

122 files changed

Lines changed: 5353 additions & 4527 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
strategy:
2222
matrix:
23-
node-version: [20]
23+
node-version: ["24"]
2424

2525
steps:
2626
- name: "☁️ Checkout repository"

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,4 @@ pnpm-debug.log*
2424
.idea/
2525

2626
# pagefind
27-
2827
public/pagefind

.prettierignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
!/.github
88
!tsconfig.json
99
!astro.config.ts
10-
!.prettierrc.mjs
1110
!package.json
1211
!.prettierrc
1312
!eslint.config.js
14-
!README.md
13+
!README.md
14+
15+
# Ignore MDX files
16+
*.mdx

.prettierrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"arrowParens": "avoid",
3+
"semi": true,
4+
"tabWidth": 2,
5+
"printWidth": 80,
6+
"singleQuote": false,
7+
"jsxSingleQuote": false,
8+
"trailingComma": "es5",
9+
"bracketSpacing": true,
10+
"endOfLine": "lf",
11+
"plugins": ["prettier-plugin-astro", "prettier-plugin-tailwindcss"],
12+
"overrides": [
13+
{
14+
"files": "*.astro",
15+
"options": {
16+
"parser": "astro"
17+
}
18+
}
19+
]
20+
}

.prettierrc.mjs

Lines changed: 0 additions & 22 deletions
This file was deleted.

README.md

Lines changed: 44 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AstroPaper 📄
22

3-
![AstroPaper](public/astropaper-og.jpg)
3+
![AstroPaper](public/default-og.jpg)
44
[![Figma](https://img.shields.io/badge/Figma-F24E1E?style=for-the-badge&logo=figma&logoColor=white)](https://www.figma.com/community/file/1356898632249991861)
55
![Typescript](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white)
66
![GitHub](https://img.shields.io/github/license/satnaing/astro-paper?color=%232F3741&style=for-the-badge)
@@ -19,12 +19,15 @@ Read [the blog posts](https://astro-paper.pages.dev/posts/) or check [the README
1919
- [x] responsive (mobile ~ desktops)
2020
- [x] SEO-friendly
2121
- [x] light & dark mode
22-
- [x] fuzzy search
22+
- [x] static search ([Pagefind](https://pagefind.app/))
2323
- [x] draft posts & pagination
2424
- [x] sitemap & rss feed
25+
- [x] MDX support
26+
- [x] collapsible table of contents
2527
- [x] followed best practices
2628
- [x] highly customizable
27-
- [x] dynamic OG image generation for blog posts [#15](https://github.com/satnaing/astro-paper/pull/15) ([Blog Post](https://astro-paper.pages.dev/posts/dynamic-og-image-generation-in-astropaper-blog-posts/))
29+
- [x] dynamic OG image generation for blog posts ([Blog Post](https://astro-paper.pages.dev/posts/dynamic-og-image-generation-in-astropaper-blog-posts/))
30+
- [x] i18n ready
2831

2932
_Note: I've tested screen-reader accessibility of AstroPaper using **VoiceOver** on Mac and **TalkBack** on Android. I couldn't test all other screen-readers out there. However, accessibility enhancements in AstroPaper should be working fine on others as well._
3033

@@ -43,57 +46,55 @@ Inside of AstroPaper, you'll see the following folders and files:
4346
```bash
4447
/
4548
├── public/
46-
│ ├── pagefind/ # auto-generated when build
49+
│ ├── pagefind/ # auto-generated on build
4750
│ ├── favicon.svg
48-
│ └── astropaper-og.jpg
51+
│ └── default-og.jpg
4952
├── src/
5053
│ ├── assets/
5154
│ │ ├── icons/
5255
│ │ └── images/
5356
│ ├── components/
54-
│ ├── data/
55-
│ │ └── blog/
57+
│ ├── content/
58+
│ │ ├── pages/
59+
│ │ │ └── about.md
60+
│ │ └── posts/
5661
│ │ └── some-blog-posts.md
62+
│ ├── i18n/
5763
│ ├── layouts/
5864
│ ├── pages/
5965
│ ├── scripts/
6066
│ ├── styles/
67+
│ ├── types/
6168
│ ├── utils/
6269
│ ├── config.ts
63-
│ ├── constants.ts
64-
│ ├── content.config.ts
65-
│ ├── env.d.ts
66-
│ └── remark-collapse.d.ts
70+
│ └── content.config.ts
71+
├── astro-paper.config.ts # user-defined configurations
6772
└── astro.config.ts
6873
```
6974

70-
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
71-
72-
Any static assets, like images, can be placed in the `public/` directory.
73-
74-
All blog posts are stored in `src/data/blog` directory.
75+
All blog posts are stored in the `src/content/posts/` directory. You can organise posts into subdirectories — the subdirectory name becomes part of the post URL.
7576

7677
## 📖 Documentation
7778

7879
Documentation can be read in two formats\_ _markdown_ & _blog post_.
7980

80-
- Configuration - [markdown](src/data/blog/how-to-configure-astropaper-theme.md) | [blog post](https://astro-paper.pages.dev/posts/how-to-configure-astropaper-theme/)
81-
- Add Posts - [markdown](src/data/blog/adding-new-post.md) | [blog post](https://astro-paper.pages.dev/posts/adding-new-posts-in-astropaper-theme/)
82-
- Customize Color Schemes - [markdown](src/data/blog/customizing-astropaper-theme-color-schemes.md) | [blog post](https://astro-paper.pages.dev/posts/customizing-astropaper-theme-color-schemes/)
83-
- Predefined Color Schemes - [markdown](src/data/blog/predefined-color-schemes.md) | [blog post](https://astro-paper.pages.dev/posts/predefined-color-schemes/)
81+
- Configuration - [markdown](src/content/posts/how-to-configure-astropaper-theme.md) | [blog post](https://astro-paper.pages.dev/posts/how-to-configure-astropaper-theme/)
82+
- Add Posts - [markdown](src/content/posts/adding-new-post.md) | [blog post](https://astro-paper.pages.dev/posts/adding-new-posts-in-astropaper-theme/)
83+
- Customize Color Schemes - [markdown](src/content/posts/customizing-astropaper-theme-color-schemes.md) | [blog post](https://astro-paper.pages.dev/posts/customizing-astropaper-theme-color-schemes/)
84+
- Predefined Color Schemes - [markdown](src/content/posts/predefined-color-schemes.md) | [blog post](https://astro-paper.pages.dev/posts/predefined-color-schemes/)
8485

8586
## 💻 Tech Stack
8687

8788
**Main Framework** - [Astro](https://astro.build/)
8889
**Type Checking** - [TypeScript](https://www.typescriptlang.org/)
8990
**Styling** - [TailwindCSS](https://tailwindcss.com/)
9091
**UI/UX** - [Figma Design File](https://www.figma.com/community/file/1356898632249991861)
91-
**Static Search** - [FuseJS](https://pagefind.app/)
92+
**Static Search** - [Pagefind](https://pagefind.app/)
9293
**Icons** - [Tablers](https://tabler-icons.io/)
9394
**Code Formatting** - [Prettier](https://prettier.io/)
9495
**Deployment** - [Cloudflare Pages](https://pages.cloudflare.com/)
95-
**Illustration in About Page** - [https://freesvgillustration.com](https://freesvgillustration.com/)
96-
**Linting** - [ESLint](https://eslint.org)
96+
**Linting** - [ESLint](https://eslint.org)
97+
**Dynamic OG images** - [Satori](https://github.com/vercel/satori) + [Sharp](https://sharp.pixelplumbing.com/) + [Astro Fonts](https://docs.astro.build/en/guides/fonts/)
9798

9899
## 👨🏻‍💻 Running Locally
99100

@@ -120,26 +121,21 @@ Then start the project by running the following commands:
120121
pnpm install
121122

122123
# start running the project
123-
pnpm run dev
124-
```
125-
126-
As an alternative approach, if you have Docker installed, you can use Docker to run this project locally. Here's how:
127-
128-
```bash
129-
# Build the Docker image
130-
docker build -t astropaper .
131-
132-
# Run the Docker container
133-
docker run -p 4321:80 astropaper
124+
pnpm dev
134125
```
135126

136127
## Google Site Verification (optional)
137128

138-
You can easily add your [Google Site Verification HTML tag](https://support.google.com/webmasters/answer/9008080#meta_tag_verification&zippy=%2Chtml-tag) in AstroPaper using an environment variable. This step is optional. If you don't add the following environment variable, the google-site-verification tag won't appear in the HTML `<head>` section.
129+
You can add your [Google Site Verification HTML tag](https://support.google.com/webmasters/answer/9008080#meta_tag_verification&zippy=%2Chtml-tag) by setting `site.googleVerification` in `astro-paper.config.ts`:
139130

140-
```bash
141-
# in your environment variable file (.env)
142-
PUBLIC_GOOGLE_SITE_VERIFICATION=your-google-site-verification-value
131+
```ts file="astro-paper.config.ts"
132+
export default defineAstroPaperConfig({
133+
site: {
134+
// ...
135+
googleVerification: "your-google-site-verification-value",
136+
},
137+
// ...
138+
});
143139
```
144140

145141
> See [this discussion](https://github.com/satnaing/astro-paper/discussions/334#discussioncomment-10139247) for adding AstroPaper to the Google Search Console.
@@ -148,32 +144,22 @@ PUBLIC_GOOGLE_SITE_VERIFICATION=your-google-site-verification-value
148144

149145
All commands are run from the root of the project, from a terminal:
150146

151-
> **_Note!_** For `Docker` commands we must have it [installed](https://docs.docker.com/engine/install/) in your machine.
152-
153-
| Command | Action |
154-
| :----------------------------------- | :------------------------------------------------------------------------------------------------------------------------------- |
155-
| `pnpm install` | Installs dependencies |
156-
| `pnpm run dev` | Starts local dev server at `localhost:4321` |
157-
| `pnpm run build` | Build your production site to `./dist/` |
158-
| `pnpm run preview` | Preview your build locally, before deploying |
159-
| `pnpm run format:check` | Check code format with Prettier |
160-
| `pnpm run format` | Format codes with Prettier |
161-
| `pnpm run sync` | Generates TypeScript types for all Astro modules. [Learn more](https://docs.astro.build/en/reference/cli-reference/#astro-sync). |
162-
| `pnpm run lint` | Lint with ESLint |
163-
| `docker compose up -d` | Run AstroPaper on docker, You can access with the same hostname and port informed on `dev` command. |
164-
| `docker compose run app npm install` | You can run any command above into the docker container. |
165-
| `docker build -t astropaper .` | Build Docker image for AstroPaper. |
166-
| `docker run -p 4321:80 astropaper` | Run AstroPaper on Docker. The website will be accessible at `http://localhost:4321`. |
167-
168-
> **_Warning!_** Windows PowerShell users may need to install the [concurrently package](https://www.npmjs.com/package/concurrently) if they want to [run diagnostics](https://docs.astro.build/en/reference/cli-reference/#astro-check) during development (`astro check --watch & astro dev`). For more info, see [this issue](https://github.com/satnaing/astro-paper/issues/113).
147+
| Command | Action |
148+
| :--------------- | :------------------------------------------------------------------------------------------------------------------------------- |
149+
| `pnpm install` | Installs dependencies |
150+
| `pnpm dev` | Starts local dev server at `localhost:4321` |
151+
| `pnpm build` | Type-checks, builds the site, runs Pagefind indexing, and copies the index to `public/pagefind/` |
152+
| `pnpm preview` | Preview your build locally, before deploying |
153+
| `pnpm sync` | Generates TypeScript types for all Astro modules. [Learn more](https://docs.astro.build/en/reference/cli-reference/#astro-sync). |
154+
| `pnpm astro ...` | Run CLI commands like `astro add`, `astro check` |
169155

170156
## ✨ Feedback & Suggestions
171157

172-
If you have any suggestions/feedback, you can contact me via [my email](mailto:contact@satnaing.dev). Alternatively, feel free to open an issue if you find bugs or want to request new features.
158+
If you have any suggestions/feedback, you can contact me via [my email](mailto:satnaingdev+astropaper@gmail.com). Alternatively, feel free to open an issue if you find bugs or want to request new features.
173159

174160
## 📜 License
175161

176-
Licensed under the MIT License, Copyright © 2025
162+
Licensed under the MIT License, Copyright © 2026
177163

178164
---
179165

astro-paper.config.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { defineAstroPaperConfig } from "./src/types/config";
2+
3+
export default defineAstroPaperConfig({
4+
site: {
5+
url: "https://astro-paper.pages.dev/",
6+
title: "AstroPaper",
7+
description: "A minimal, responsive and SEO-friendly Astro blog theme.",
8+
author: "Sat Naing",
9+
profile: "https://satna.ing",
10+
ogImage: "default-og.jpg",
11+
lang: "en",
12+
timezone: "Asia/Bangkok",
13+
dir: "ltr",
14+
},
15+
posts: {
16+
perPage: 4,
17+
perIndex: 4,
18+
scheduledPostMargin: 15 * 60 * 1000,
19+
},
20+
features: {
21+
lightAndDarkMode: true,
22+
dynamicOgImage: true,
23+
showArchives: true,
24+
showBackButton: true,
25+
editPost: {
26+
enabled: true,
27+
url: "https://github.com/satnaing/astro-paper/edit/main/",
28+
},
29+
search: "pagefind",
30+
},
31+
socials: [
32+
{ name: "github", url: "https://github.com/satnaing/astro-paper" },
33+
{ name: "x", url: "https://x.com/username" },
34+
{ name: "linkedin", url: "https://www.linkedin.com/in/username/" },
35+
{ name: "mail", url: "mailto:yourmail@gmail.com" },
36+
],
37+
shareLinks: [
38+
{ name: "whatsapp", url: "https://wa.me/?text=" },
39+
{ name: "facebook", url: "https://www.facebook.com/sharer.php?u=" },
40+
{ name: "x", url: "https://x.com/intent/post?url=" },
41+
{ name: "telegram", url: "https://t.me/share/url?url=" },
42+
{ name: "pinterest", url: "https://pinterest.com/pin/create/button/?url=" },
43+
{ name: "mail", url: "mailto:?subject=See%20this%20post&body=" },
44+
],
45+
});

astro.config.ts

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
import { defineConfig, envField, fontProviders } from "astro/config";
1+
import {
2+
defineConfig,
3+
envField,
4+
fontProviders,
5+
svgoOptimizer,
6+
} from "astro/config";
27
import tailwindcss from "@tailwindcss/vite";
8+
import mdx from "@astrojs/mdx";
39
import sitemap from "@astrojs/sitemap";
410
import remarkToc from "remark-toc";
511
import remarkCollapse from "remark-collapse";
@@ -9,20 +15,27 @@ import {
915
transformerNotationWordHighlight,
1016
} from "@shikijs/transformers";
1117
import { transformerFileName } from "./src/utils/transformers/fileName";
12-
import { SITE } from "./src/config";
18+
import config from "./astro-paper.config";
1319

14-
// https://astro.build/config
1520
export default defineConfig({
16-
site: SITE.website,
21+
site: config.site.url,
1722
integrations: [
23+
mdx(),
1824
sitemap({
19-
filter: page => SITE.showArchives || !page.endsWith("/archives"),
25+
filter: page =>
26+
config.features?.showArchives !== false || !page.endsWith("/archives/"),
2027
}),
2128
],
29+
i18n: {
30+
locales: ["en"],
31+
defaultLocale: "en",
32+
routing: {
33+
prefixDefaultLocale: false,
34+
},
35+
},
2236
markdown: {
2337
remarkPlugins: [remarkToc, [remarkCollapse, { test: "Table of contents" }]],
2438
shikiConfig: {
25-
// For more themes, visit https://shiki.style/themes
2639
themes: { light: "min-light", dark: "night-owl" },
2740
defaultColor: false,
2841
wrap: false,
@@ -35,19 +48,19 @@ export default defineConfig({
3548
},
3649
},
3750
vite: {
38-
// eslint-disable-next-line
39-
// @ts-ignore
40-
// This will be fixed in Astro 6 with Vite 7 support
41-
// See: https://github.com/withastro/astro/issues/14030
4251
plugins: [tailwindcss()],
43-
optimizeDeps: {
44-
exclude: ["@resvg/resvg-js"],
45-
},
46-
},
47-
image: {
48-
responsiveStyles: true,
49-
layout: "constrained",
5052
},
53+
fonts: [
54+
{
55+
name: "Google Sans Code",
56+
cssVariable: "--font-google-sans-code",
57+
provider: fontProviders.google(),
58+
fallbacks: ["monospace"],
59+
weights: [300, 400, 500, 600, 700],
60+
styles: ["normal", "italic"],
61+
formats: ["woff", "ttf"],
62+
},
63+
],
5164
env: {
5265
schema: {
5366
PUBLIC_GOOGLE_SITE_VERIFICATION: envField.string({
@@ -58,16 +71,6 @@ export default defineConfig({
5871
},
5972
},
6073
experimental: {
61-
preserveScriptOrder: true,
62-
fonts: [
63-
{
64-
name: "Google Sans Code",
65-
cssVariable: "--font-google-sans-code",
66-
provider: fontProviders.google(),
67-
fallbacks: ["monospace"],
68-
weights: [300, 400, 500, 600, 700],
69-
styles: ["normal", "italic"],
70-
},
71-
],
74+
svgOptimizer: svgoOptimizer(),
7275
},
7376
});

0 commit comments

Comments
 (0)