-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Features
An overview of all built-in features in AstroPaper.
- Light and dark mode
- Static search
- SEO
- Dynamic OG images
- RSS feed
- Sitemap
- Reading time
- Tag system
- Archives page
- Pagination
- Table of contents
- Callouts
- Image lightbox
- Draft posts
- Scheduled posts
- Share links
- Edit page link
- Breadcrumbs
- View transitions
- Accessibility
- robots.txt
AstroPaper ships with both light and dark color schemes. The active theme is determined by:
- The user's last-saved preference (stored in
localStorage) - The system preference (
prefers-color-schememedia query) if no saved preference exists
A toggle button in the header lets users switch between themes. The switch is animated and ARIA-labelled for screen readers.
To disable the toggle and force the light theme only, set features.lightAndDarkMode: false in astro-paper.config.ts.
Full-text search is powered by Pagefind, a fully static search library with no server required.
- The search index is built during
pnpm buildand placed inpublic/pagefind/ - The search UI is accessible at
/search - The search bar in the header navigates to the search page
- Results include post titles, descriptions, and content excerpts
Search is automatically focused when the search page loads. To disable search entirely, set features.search: false.
AstroPaper is optimized for search engines out of the box:
-
Title tags —
<title>usespost.title | site.titleformat -
Meta description — from
post.descriptionorsite.description -
Canonical URLs — auto-generated from
site.url+ path; can be overridden per post viacanonicalURLfrontmatter -
Open Graph —
og:title,og:description,og:image,og:url,og:type -
Twitter cards —
twitter:card,twitter:title,twitter:description,twitter:image - JSON-LD structured data — BlogPosting schema on post pages
-
Sitemap — auto-generated at
/sitemap-index.xml -
robots.txt — permissive by default, auto-generated at
/robots.txt
When features.dynamicOgImage is enabled, AstroPaper generates a unique OG image for each published post that has no ogImage in frontmatter.
The generated image includes:
- Post title
- Author name (from
site.author) - Site title (from
site.title)
Images are generated at build time using Satori + Sharp. The font is sourced from Astro's Fonts configuration, matching the site's typeface.
Caveats:
- Build time increases with content volume (one PNG per eligible post)
- RTL languages are not yet supported in generated images
- Non-Latin characters require a Google Font with coverage for those scripts
See Customization → OG images for full details.
An RSS feed is auto-generated at /rss.xml. It includes all published, non-draft posts sorted by publication date descending.
The feed uses site.title, site.description, and site.url from astro-paper.config.ts. No additional configuration is required.
A sitemap is auto-generated at build time via @astrojs/sitemap. It is available at /sitemap-index.xml.
The archives page is excluded from the sitemap when features.showArchives is false.
AstroPaper does not include a built-in reading time display. The theme focuses on clean, minimal output and omits it by default. You can add reading time estimation via a remark plugin if desired.
Each post can have one or more tags defined in the tags frontmatter array. Tags are used to:
- Display tag badges on post cards and post headers
- Generate a tags index page at
/tags/ - Generate individual tag pages at
/tags/[tag]/with paginated post listings
If a post has no tags field, it is assigned the default tag "others". The default tag name can be changed in src/content.config.ts.
An archives page at /archives/ lists all posts grouped by year. It can be enabled or disabled via features.showArchives in astro-paper.config.ts. The archives link also appears in the site navigation when enabled.
Post listing pages use pagination controlled by posts.perPage in astro-paper.config.ts (default: 4 posts per page). The home page uses posts.perIndex for the Recent Posts section.
Paginated pages include accessible Previous / Next navigation with proper ARIA labels.
Posts can include a collapsible table of contents. To add one, include a level-2 heading ## Table of contents in the post body:
## Table of contents
## Section One
Content...The TOC is generated from all headings in the post and rendered as a collapsible section above the content where the heading is placed.
AstroPaper v6.1+ supports callouts using blockquote syntax (Obsidian-style via rehype-callouts):
> [!NOTE]
> Supplementary information.
> [!TIP]+ Expandable tip
> Starts open but can be collapsed.Supported types: NOTE, TIP, INFO, WARNING, DANGER, SUCCESS, BUG, EXAMPLE, QUOTE, and more. See Writing Posts → Callouts for full details.
AstroPaper v6.1+ includes an accessible image lightbox for post images. Clicking any image in a post opens it in a full-screen overlay with keyboard navigation support (Escape to close, arrow keys if applicable).
The lightbox is implemented without any third-party JavaScript library.
Set draft: true in a post's frontmatter to exclude it from the build. Draft posts are not rendered, not indexed by Pagefind, and not included in the RSS feed or sitemap.
Draft posts are visible in development (pnpm dev) so you can preview them locally.
Posts with a pubDatetime in the future are treated as unpublished and excluded from listings and feeds. However, posts with a pubDatetime within the posts.scheduledPostMargin window (default: 15 minutes before pubDatetime) are shown as published.
This helps with deployments triggered slightly before a post's intended publish time.
Post detail pages include share buttons configured via the shareLinks array in astro-paper.config.ts. The post URL is appended to each share URL.
Built-in share targets: X (Twitter), Facebook, WhatsApp, Telegram, Pinterest, email. Custom targets can be added by placing an SVG in src/assets/icons/socials/.
An "Edit page" link can be shown below the post title, linking to the post's source file in your repository. Configure it in astro-paper.config.ts:
features: {
editPost: {
enabled: true,
url: "https://github.com/your-username/your-repo/edit/main/",
},
},Individual posts can hide the link by setting hideEditPost: true in frontmatter.
Post pages show a breadcrumb trail (e.g. Home > Posts > Post Title) for orientation and navigation. This is rendered automatically and requires no configuration.
AstroPaper uses Astro's <ClientRouter /> for page transitions. Navigation between pages is animated smoothly. Post cards have view transition names tied to the post slug for a coordinated transition effect.
AstroPaper follows WCAG guidelines:
- Semantic HTML throughout
- Skip-to-content link for keyboard users
- ARIA labels on all interactive elements (theme toggle, search, menu, pagination, share buttons)
- Keyboard-navigable mobile menu
- Sufficient color contrast in both light and dark themes
- Screen reader support tested with VoiceOver (macOS) and TalkBack (Android)
A robots.txt is auto-generated at build time. The default allows all crawlers on all pages. It is defined in src/pages/robots.txt.ts and can be customized there.
Getting Started
Writing Content
Features & Reference
Deployment
Links