$ show satnaing/astro-paper
AstroPaper is a minimal, responsive, accessible and SEO-friendly Astro blog theme/template. It provides a complete blogging platform with features like light/dark mode toggle, dynamic OG image generation, static search with Pagefind, RSS/sitemap generation, tag and archive pages, and internationalization support. Built with Astro v6, Tailwind CSS v4, and TypeScript, it follows modern web development practices with a component-based architecture. The theme separates concerns effectively: configurations in astro-paper.config.ts, resolved settings in src/config.ts, UI components in src/components/, layouts in src/layouts/, pages in src/pages/, and content in src/content/. It handles complex edge cases like Unicode slugification, timezone-aware date formatting, and view transition compatibility with thoughtful, reusable utilities.
The LLM identified 3 files worth highlighting for reuse:
A smart slugification utility that handles both Latin and non-Latin characters appropriately. For Latin strings it uses slugify() (e.g., 'E2E Testing' → 'e2e-testing'), while preserving non-Latin characters using lodash.kebabcase. This solves a common problem in web applications where proper Unicode handling in URLs/slugs is often overlooked. The function is self-contained, has zero dependencies beyond lodash.kebabcase and slugify, and could be extracted to any project with minimal modification.
Creates valid CSS identifiers for Astro's View Transitions API by properly encoding non-ASCII characters (as Unicode hex sequences) and replacing invalid ASCII special characters with hyphens. It ensures the resulting string is a valid CSS <custom-ident> by handling edge cases like leading digits and empty strings. This demonstrates non-obvious skill in navigating CSS identifier specifications and provides a reusable solution for any project using view transitions that needs to generate safe identifiers from arbitrary strings.
A comprehensive theme management system that handles theme persistence (localStorage), OS preference synchronization, accessibility updates (aria-label), Android browser chrome synchronization via theme-color meta tag, and View Transition compatibility to prevent flashes during navigation. It encapsulates all the complex logic needed for a robust dark/light mode implementation in a single, self-contained module that could be dropped into any web application with minimal adaptation (mainly adjusting the theme selector and storage key).