Skip to content

AstroPaper v6#631

Merged
satnaing merged 102 commits into
mainfrom
astro-paper-v6
May 17, 2026
Merged

AstroPaper v6#631
satnaing merged 102 commits into
mainfrom
astro-paper-v6

Conversation

@satnaing

@satnaing satnaing commented May 4, 2026

Copy link
Copy Markdown
Owner

Description

Summary

  • Rework the entire config structure and code organization.
  • Migrates AstroPaper to the new v6 structure (content collections under src/content/, new layout/component organization).
  • Introduces a typed user config entrypoint in astro-paper.config.ts and keeps src/config.ts as the internal resolved defaults layer.
  • Adds a lightweight i18n layer (English strings + helpers) and updates pages/components to use it.

Notable changes

  • Content: moves blog posts/pages into src/content/* and updates src/content.config.ts.
  • Routing/UI: updates pages (posts, tags, archives, search, about) + nav/breadcrumb handling with base/locale awareness.

Types of changes

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Documentation Update (if none of the other choices apply)
  • Release

Checklist

  • I have read the Contributing Guide
  • I have added the necessary documentation (if appropriate)
  • Breaking Change (fix or feature that would cause existing functionality to not work as expected)

Related Issue

Closes #626 - Astro v6
Closes #131 - Support MDX
Closes #493 - Support base path

satnaing added 30 commits April 25, 2026 20:57
- 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
- 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
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.
- 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
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
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.
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.
Replaces @/astro-paper.config imports with @/config and removes
optional chaining on feature flags now that the resolved config
guarantees non-optional values.
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.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 4, 2026

Copy link
Copy Markdown

Deploying astro-paper with  Cloudflare Pages  Cloudflare Pages

Latest commit: d564fd8
Status: ✅  Deploy successful!
Preview URL: https://ce6c683d.astro-paper.pages.dev
Branch Preview URL: https://astro-paper-v6.astro-paper.pages.dev

View logs

satnaing added 3 commits May 4, 2026 23:27
* 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.
* 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
@eerison

eerison commented May 14, 2026

Copy link
Copy Markdown
Contributor

tiny upgrade 😄
preparing myself to solve conflicts for the next release 😄

Comment thread src/types/config.ts
Comment thread .github/workflows/ci.yml Outdated
Comment thread src/components/Header.astro
@satnaing
satnaing merged commit f0b644d into main May 17, 2026
5 checks passed
@satnaing
satnaing deleted the astro-paper-v6 branch May 17, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Upgrade Astro to v6.1.2 [Feature Request]: Github Pages support via base property. please add mdx support

2 participants