@s-blog/core
v0.3.8
Published
The pre-built App Shell and UI framework for [S-Blog](https://s-blog.me).
Readme
@s-blog/core
The pre-built App Shell and UI framework for S-Blog.
What This Package Provides
- Pre-built App Shell — Production-ready
index.html+ hashed JS/CSS assets (React SPA) - UI Components — Post list, post detail with Markdown rendering, photo albums, search overlay, language switcher, etc.
- Routing — Pre-configured React Router with code-splitting (lazy-loaded routes)
- i18n — Built-in internationalization (English, Chinese, Japanese)
- JSON Schemas — Validation schemas for
config.jsonandalbum.config.json - Type Definitions — TypeScript types for blog metadata, album data, and site config
How It Works
@s-blog/core is the frontend half of S-Blog. It pairs with @s-blog/engine (the build engine) to form the complete system:
@s-blog/enginebuilds your content (Markdown → manifest, photos → thumbnails, SEO pages)@s-blog/coreprovides the App Shell that loads and renders that content at runtime
Users interact with both through simple npm scripts:
npm run dev # Start dev server (powered by @s-blog/engine)
npm run build # Full production build (engine copies shell from core, then processes content)Installation
Recommended: Use
npm create s-blog@latestto scaffold a new project. It sets up both@s-blog/coreand@s-blog/engineautomatically.
For manual setup or upgrading:
npm install @s-blog/core @s-blog/engineProject Structure (User's Project)
After scaffolding, a user's project contains only content:
my-blog/
├── posts/ # Markdown posts
├── albums/ # Photo albums (optional)
├── public/ # Static assets (logo, favicon)
├── config.json # Site configuration
├── album.config.json # Album configuration
└── package.json # scripts: { dev, build }All framework code is inside node_modules/@s-blog/core and node_modules/@s-blog/engine.
Updating
npm update @s-blog/core @s-blog/engineAdvanced: Legacy Scripts (Deprecated)
The underlying TypeScript scripts from earlier versions are still present inside this package but are deprecated and will be removed in a future release. The Rust build engine (@s-blog/engine) has fully replaced their functionality.
node_modules/@s-blog/core/scripts/
├── copy-shell.ts
├── generate-posts-data.ts
├── generate-albums-data.ts
├── generate-seo.ts
├── generate-sitemap.ts
├── generate-rss.ts
├── generate-robots.ts
└── copy-public.ts⚠️ Do not rely on these scripts in new projects. Use
npm run build/npm run devinstead.
License
MIT © Suzichen
