A dark, gothic-inspired Astro journal with an immersive reading room and an optional local Tauri editor.
简体中文 · Feature showcase · Quick start · Editor · Contributing
NarCard3 is a reusable template with neutral example content. It does not include personal articles, private media, credentials, or machine-specific development files.
NarCard3 combines a theatrical visual system with a practical static publishing workflow. The main site provides archives, tags, gallery, search, article routes, RSS, sitemap, and metadata, while the reading room turns the same Markdown collection into a focused book-like experience.
The website stays statically generated with Astro. Authors can work directly in Markdown, use the standalone browser editor, or experiment with the optional Tauri desktop editor without changing the site's content source.
This section is intentionally organized as a sequence of small demonstrations. GIFs can be added one feature at a time under the matching heading without restructuring the rest of the README.
- Dark gothic art direction with a switchable Blood Moon theme
- Orb-based navigation, curtain transitions, ambient motion, and keyboard interactions
- Home, archive, tags, gallery, search, about, and article views
- Book-opening animation and high-clarity flattened reading layout
- Main-site Markdown articles and tags rendered into the same reading interface
- Article search, tag filtering, in-page text highlights, and latest-highlight navigation
- Resizable reading index with its dimensions saved locally
- Curtain transitions when entering or leaving reading mode
- Markdown content collection with generated home-page metadata
- Article routes, RSS, sitemap, robots.txt, canonical URLs, Open Graph, Twitter Cards, and JSON-LD
- KaTeX rendering and shared Markdown presentation styles
- Standalone Markdown/LaTeX browser editor
- Formula templates, matrices, colors, fonts, environments, and favorites
- Optional Tauri v2 + Rust desktop editor with project validation, backups, image processing, and Git publishing
When adding a GIF, store it in docs/media/ and replace the corresponding hidden comment with:
<p align="center">
<img src="./docs/media/showcase-example.gif" alt="Short description of the demonstrated feature" width="100%" />
</p>Keep GIFs focused, cropped, and reasonably compressed so the repository page remains quick to load.
- Node.js 22.23.4+ or 24.12+; use the version in
.nvmrcfor CI parity - npm
- A modern JavaScript-enabled browser
git clone https://github.com/NostalgiaIm/NarCard3.git
cd NarCard3
npm ci
npm run devUseful local routes:
| Route | Purpose |
|---|---|
http://localhost:4321/ |
Main website |
http://localhost:4321/read-mode/ |
Immersive reading room |
http://localhost:4321/editor.html |
Standalone browser editor |
npm run check:docs
npm run check
npm run build
npm run previewThe production output is written to dist/ and is intentionally excluded from Git.
Markdown is the single source of truth for articles.
src/content/blog/*.md
│
├── Astro content collection ──> standard article pages
├── reading mode rendering ────> /read-mode/
└── scripts/generate-posts.mjs ─> src/data/posts.ts
Create an article in src/content/blog/:
---
title: A New Example Entry
description: A short description for this article.
pubDate: 2025-04-01
tags: [Example, Notes]
category: Notes
draft: false
---
Write your article here.src/data/posts.ts is generated before each production build. Do not edit it manually. The generator reads title, description, pubDate (or date), tags, category, cover, coverAlt, coverPosition, variant, and draft. Draft articles are excluded.
Run the generator manually when needed:
npm run generate:postsOpen /read-mode/ directly or use the open-book button in the main site's right orb menu.
- Article metadata is read from the generated main-site data.
- Article bodies are rendered from
src/content/blog/*.mdduring the Astro build. - Selecting a tag lists every matching article.
- Selecting an article loads it into the current book without leaving reading mode.
- Left and right orb menus retain access to site sections and reading controls.
- Explicit exit controls return to the main site through the shared curtain transition.
- Text highlighting, latest-highlight navigation, theme switching, scrolling, background music, and reading-index resizing remain available.
Do not maintain a second copy of article content for reading mode. Updating Markdown and rebuilding updates both article presentations.
Open /editor.html. It supports:
- Live Markdown preview
- Article metadata editing and switching
- Draft persistence
- Markdown import and export
- LaTeX source and visual editing
- Formula templates, matrices, favorites, colors, fonts, and environments
- Image/document formula import entry points
- Main-site code copying and directory-based import entry points
The File System Access API always requires explicit directory selection and browser permission. NarCard3 does not bypass these permissions or upload local files in the background.
The independent narcard-editor/ project adds native project access while keeping the website and browser editor usable on their own.
Desktop editor capabilities and setup
The prototype supports project validation, safe slug and date checks, duplicate detection, external-change detection, Markdown file creation and replacement, .bak backups, temporary-file replacement, basic Markdown preview, WebP cover compression, and Git commit/push workflows.
Install and run:
cd narcard-editor
npm ci
npm run tauri:devRecommended Windows setup:
cd narcard-editor
.\setup-windows.cmd
.\start-editor-windows.cmdWindows development requires Rust/Cargo, Microsoft C++ Build Tools, and WebView2. Test write operations against a disposable project copy first.
Documentation:
src/
├── components/ # Global, blog, and UI components
├── content/blog/ # Markdown articles
├── data/posts.ts # Generated article metadata
├── layouts/ # Astro layouts and SEO metadata
├── pages/ # Main site, reading mode, blog, and utility routes
└── styles/ # SCSS tokens, mixins, and enhancements
public/
└── editor.html # Standalone Markdown/LaTeX editor
docs/media/ # README hero image and future showcase GIFs
narcard-editor/
├── src/ # Desktop editor frontend
├── src-tauri/ # Rust commands, permissions, and Tauri config
├── scripts/ # Windows setup implementation
└── docs/ # Desktop setup documentation
Responsibilities:
- Astro owns routes, build-time data, SEO, RSS, and content collections.
/read-mode/renders the same content collection into the book interface.src/styles/owns shared design tokens and Markdown enhancements.public/editor.htmlremains the browser editor.narcard-editor/remains an independent Tauri/Rust project.
Before deployment, replace the placeholder in astro.config.mjs:
site: 'https://your-domain.example'It controls canonical URLs, RSS links, sitemap entries, robots.txt, JSON-LD, and Open Graph URLs.
The incremental Sass layer lives in:
src/styles/_tokens.scss
src/styles/_mixins.scss
src/styles/scss-enhancements.scss
Prefer shared SCSS for reusable styles and keep page-specific behavior close to its Astro page or component.
Only commit images, audio, and fonts that you own or are licensed to distribute. Remove sensitive EXIF metadata when appropriate. Runtime media belongs under public/images/ or public/audio/; README demonstrations belong under docs/media/.
GitHub Actions always validates the Astro site. Pull requests run the editor frontend or Tauri/Rust jobs only when their related paths change; pushes to feature branches are not checked a second time when an open pull request already covers the same commit. A merge to main and a manual workflow dispatch still run the complete suite.
This keeps website and documentation pull requests fast while preserving full verification on the protected branch. A skipped editor or Rust job means that its project was not affected, not that CI failed. Before opening a pull request, run the checks relevant to your changes:
npm run check:docs
npm run check
npm run buildFor Tauri changes, also run the Rust formatting, linting, and test commands described in the desktop editor guide.
Publishing checklist
- Confirm
git statusdoes not includenode_modules,dist,.astro,target, backups, logs, private articles, or unlicensed media. - Confirm generated
src/data/posts.tsmatches the Markdown frontmatter. - Review the configured site URL and public metadata.
- Keep build products out of commits.
- Test file-writing editor changes against a project copy.
NarCard3 is maintained by one person in their available time and has no guaranteed response SLA. Well-formed issues and pull requests are normally triaged within seven days when possible. English is the canonical documentation language; designated Chinese documents are maintained alongside user-facing guides.
- Pagefind: the template keeps its existing search entry point and does not force a Pagefind dependency.
- Giscus: comments are not connected to a repository or Discussion category by default.
Configure these integrations for your own deployment before enabling them.
NarCard3 is released under the MIT License. Third-party dependencies, fonts, images, audio, and services may use separate licenses; review their terms before distribution.
