@xingwangzhe/stalux 1.7.6 → 1.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +68 -146
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -4,54 +4,26 @@
4
4
 
5
5
  # Stalux — Modern Astro Blog Theme
6
6
 
7
- **Dual-mode: Use as a template 📦 or install as a plugin 🔌**
7
+ **Dual-mode: Use as a source template 📦 or install as an npm plugin 🔌**
8
8
 
9
9
  **[stalux.needhelp.icu](https://stalux.needhelp.icu)**
10
10
 
11
- Elegant, high-performance, easily configurable Astro static blog theme.
12
-
13
- In terms of design, Stalux draws on minimalism and moderate decoration: it maintains an overall dark tone with subtle glassmorphism textures, and the background uses tiled decorative patterns to enhance visual depth without being distracting.
14
-
15
- In terms of experience, Stalux balances SSG's high performance with the smooth feel of page transitions without full reloads. Through view transitions and handling of `astro:page-load` events, the theme keeps the header, footer, and other common components stable during navigation or main content switching.
16
-
17
- Content-first is one of the theme's core principles: writing and presentation are considered top priority. The theme supports CommonMark, code highlighting, Mermaid flowcharts, and KaTeX math formulas out of the box.
11
+ A dark-themed, high-performance Astro blog theme with elegant glassmorphism design, per-route font subsetting, and a focus on content-first reading experience.
18
12
 
19
13
  ---
20
14
 
21
- ## 🚀 Two Ways to Use
15
+ ## 🚀 Quick Start
22
16
 
23
- ### Option A: Clone Source Code (Template Mode)
24
-
25
- Get the full source — modify anything, customize everything:
17
+ ### Plugin Mode (recommended)
26
18
 
27
19
  ```bash
28
- git clone https://github.com/xingwangzhe/stalux.git my-blog
29
- cd my-blog
30
- bun install # or npm install
31
- bun run dev # or npm run dev
20
+ bun create astro # Choose "minimal" template
21
+ cd myblog
22
+ bun add @xingwangzhe/stalux # Install theme (all dependencies included)
23
+ bunx stalux init # Generate stalux/ content directory
32
24
  ```
33
25
 
34
- ### Option B: Install as Astro Integration (Plugin Mode)
35
-
36
- Keep your project clean — install stalux as a dependency in a new or existing Astro project.
37
-
38
- **Step-by-step from scratch:**
39
-
40
- ```bash
41
- # 1. Create a new Astro project (choose "minimal" template)
42
- bun create astro
43
-
44
- # 2. Enter your project directory
45
- cd ./myblog
46
-
47
- # 3. Install the stalux theme package
48
- bun add @xingwangzhe/stalux
49
-
50
- # 4. Initialize content template (creates stalux/ dir with configs & sample posts)
51
- bunx stalux init
52
- ```
53
-
54
- **5. Configure `astro.config.mjs`:**
26
+ Then configure `astro.config.mjs`:
55
27
 
56
28
  ```ts
57
29
  import { defineConfig } from "astro/config";
@@ -86,150 +58,100 @@ import { defineCollections } from "@xingwangzhe/stalux/schemas";
86
58
  export const collections = defineCollections({ contentDir: "stalux" });
87
59
  ```
88
60
 
89
- **6. Start writing and developing:**
90
-
91
61
  ```bash
92
- bun run dev
93
- ```
94
-
95
- Your blog is now running at `http://localhost:4321/` with all theme pages, search, RSS, and more ready to go.
96
-
97
- > 💡 `bunx stalux init` creates the `stalux/` directory structure with example content.
98
- > Run it any time to see what a valid config looks like — it won't overwrite existing files.
99
-
100
- ---
101
-
102
- ## 📝 Quick Start: Writing Content
103
-
104
- Create a markdown file under `stalux/posts/`:
105
-
106
- ```yaml
107
- ---
108
- title: Hello World
109
- abbrlink: hello-world
110
- date: 2026-07-27 10:00:00
111
- tags: [Stalux, Getting Started]
112
- categories: [Blog]
113
- desc: A brief description of your post.
114
- ---
115
- Your content here...
62
+ bun run dev # Start writing!
116
63
  ```
117
64
 
118
- **Content Directory Structure:**
65
+ ### Template Mode
119
66
 
120
- ```
121
- stalux/
122
- ├── config/ # YAML configuration files
123
- │ ├── site.yml # Site metadata
124
- │ ├── author.yml # Author info
125
- │ ├── navs.yml # Navigation menu
126
- │ ├── footer.yml # Footer badges & copyright
127
- │ ├── links.yml # Friend links
128
- │ ├── comment.yml # Waline comment config
129
- │ ├── head.yml # Analytics & custom head
130
- │ ├── media-links.yml # Social media links
131
- │ ├── promote.yml # LLM promotion & export
132
- │ ├── ai-discovery.yml # AI discovery file config
133
- │ └── typetexts.yml # Typewriter text snippets
134
- ├── posts/ # Blog posts (Markdown)
135
- ├── about/index.md # About page
136
- └── words/ # Quotes / short notes (Markdown)
67
+ ```bash
68
+ git clone https://github.com/xingwangzhe/stalux.git my-blog
69
+ cd my-blog
70
+ bun install
71
+ bun run dev
137
72
  ```
138
73
 
139
74
  ---
140
75
 
141
76
  ## ✨ Features
142
77
 
143
- - 🌙 **Dark mode** as default, with elegant glassmorphism design
144
- - 🔤 **Per-route font subsetting** — each page loads only its needed characters (25 MB full font → ~1 KB per route)
78
+ - 🌙 **Dark mode** with elegant glassmorphism design
79
+ - 🔤 **Per-route font subsetting** — 25 MB font → ~350 KB shared + ~1 KB per page
145
80
  - 🔍 **Full-text search** via Pagefind (auto-indexed on build)
146
81
  - 📡 **RSS & Atom feeds**
147
82
  - 🖼️ **PhotoSwipe** image lightbox
148
- - 📊 **Mermaid** diagrams & flowcharts
149
- - 📐 **KaTeX / MathML** math rendering
150
- - 🤖 **LLM discovery files** (llms.txt / llms-full.txt)
83
+ - 📊 **Mermaid** diagrams and flowcharts
84
+ - 📐 **Math formula rendering** (KaTeX / MathML)
151
85
  - 💬 **Waline** comment system
152
- - 📱 **Fully responsive**
86
+ - 🤖 **LLM discovery files** (llms.txt / llms-full.txt)
153
87
  - ⚡ **View transitions** for smooth navigation
154
- - 🏷️ **Tags, categories, archives**
155
- - 🌐 **i18n** (zh-CN / en)
88
+ - 🌐 **i18n** (English / Chinese)
89
+ - 🏷️ **Tags, categories, archives** pages
90
+ - 🎨 **Component override system** (Starlight-style)
91
+ - 🛠️ **Easy YAML configuration** — no coding required
156
92
 
157
93
  ---
158
94
 
159
95
  ## 🔤 Font Optimization
160
96
 
161
- Stalux ships with a 25 MB Chinese font (LXGW WenKai), but your visitors never download the full file. Instead, the build generates minimal font subsets per route:
97
+ Stalux ships with a 25 MB Chinese font (LXGW WenKai). Instead of loading the full file, the build generates minimal subsets per route:
162
98
 
163
- - **Common subset** (~350 KB) — UI text, navigation, i18n, shared characters from all posts
164
- - **Per-route subset** (~0.5–3 KB each) — unique characters for each individual page
99
+ | Subset | Size | Content |
100
+ | --------- | --------- | ------------------------------------------ |
101
+ | Common | ~350 KB | UI text, nav, i18n, shared post characters |
102
+ | Per-route | ~0.5–3 KB | Unique characters for each page |
165
103
 
166
- Each HTML page loads only `common.css` + `subset-{route}.css`, ensuring every page gets exactly the characters it needs — nothing more.
104
+ Every page loads `common.css` + `subset-{route}.css`. All route types are covered: `/`, `/about`, `/words`, `/posts/*`, `/archives`, `/tags`, `/categories`, `/links`.
167
105
 
168
- This covers **all route types**:
169
-
170
- | Route | Subset source |
171
- | ------------------------------------ | --------------------------------------------------------- |
172
- | `/` | Config YAML (site title, author, navs, typetexts, footer) |
173
- | `/about` | About markdown |
174
- | `/words` | All words content |
175
- | `/posts/{slug}` | Single post content |
176
- | `/archives` | All posts content |
177
- | `/tags` / `/tags/{name}` | Tag names + matching posts |
178
- | `/categories` / `/categories/{name}` | Category names + matching posts |
179
- | `/links` | Links config YAML |
180
- | `/404` | Covered by common subset |
181
-
182
- The subsetting engine (`subset-font`, Harfbuzz WASM) runs at build time (`astro:build:start`) and on-demand in dev mode.
106
+ Powered by `subset-font` (Harfbuzz WASM), running at build time and on-demand in dev mode.
183
107
 
184
108
  ---
185
109
 
186
- ## 🛠️ Development
110
+ ## 🎨 Component Override
187
111
 
188
- ```bash
189
- # Install dependencies
190
- bun install # recommended
191
- # npm install
192
-
193
- # Start dev server
194
- bun run dev
195
-
196
- # Build
197
- bun run build
198
-
199
- # Preview
200
- bun run preview
112
+ ```ts
113
+ stalux({
114
+ components: {
115
+ Navs: "./src/components/CustomNavs.astro",
116
+ Footer: "./src/components/CustomFooter.astro",
117
+ },
118
+ });
201
119
  ```
202
120
 
203
- ---
121
+ 30+ components are overridable. See `src/internal/override.ts` for the full list.
204
122
 
205
- ## 🎨 Customizing Components
206
-
207
- Stalux supports component overrides (like Starlight):
123
+ ---
208
124
 
209
- ```ts
210
- import { defineConfig } from "astro/config";
211
- import stalux from "@xingwangzhe/stalux";
125
+ ## 📝 Content Structure
212
126
 
213
- export default defineConfig({
214
- integrations: [
215
- stalux({
216
- components: {
217
- Navs: "./src/components/CustomNavs.astro",
218
- Footer: "./src/components/CustomFooter.astro",
219
- // ... see full list in src/internal/override.ts
220
- },
221
- }),
222
- ],
223
- });
127
+ ```
128
+ stalux/
129
+ ├── config/ # YAML configuration
130
+ │ ├── site.yml # Site metadata
131
+ │ ├── author.yml # Author info
132
+ │ ├── navs.yml # Navigation menu
133
+ │ ├── footer.yml # Footer badges & copyright
134
+ │ ├── links.yml # Friend links
135
+ │ ├── comment.yml # Waline comment config
136
+ │ ├── head.yml # Analytics & custom head
137
+ │ ├── media-links.yml # Social media links
138
+ │ ├── promote.yml # LLM promotion
139
+ │ ├── ai-discovery.yml # AI discovery files
140
+ │ └── typetexts.yml # Typewriter text
141
+ ├── posts/ # Blog posts (Markdown)
142
+ ├── about/index.md # About page
143
+ └── words/ # Quotes / short notes
224
144
  ```
225
145
 
226
- Use the `@stalux/component/*` import alias in your custom components:
227
-
228
- ```astro
229
- ---
230
- import Navs from "@stalux/component/Navs";
231
146
  ---
232
- <Navs />
147
+
148
+ ## 🛠️ Development Commands
149
+
150
+ ```bash
151
+ bun install # Install dependencies
152
+ bun run dev # Start dev server at localhost:4321
153
+ bun run build # Build to dist/
154
+ bun run preview # Preview production build
233
155
  ```
234
156
 
235
157
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xingwangzhe/stalux",
3
- "version": "1.7.6",
3
+ "version": "1.7.8",
4
4
  "description": "A powerful, modern Astro blog theme — use as template or install as plugin",
5
5
  "keywords": [
6
6
  "astro",
@@ -78,8 +78,8 @@
78
78
  "@lucide/astro": "^1.27.0",
79
79
  "@pagefind/component-ui": "^1.5.2",
80
80
  "@waline/client": "^3.15.2",
81
- "@xingwangzhe/satteri-mermaid": "0.7.1",
82
- "@xingwangzhe/satteri-photoswipe": "^0.2.0",
81
+ "@xingwangzhe/satteri-mermaid": "0.7.2",
82
+ "@xingwangzhe/satteri-photoswipe": "^0.2.1",
83
83
  "@xingwangzhe/tags-cloud": "^1.2.4",
84
84
  "animejs": "^4.5.0",
85
85
  "astro-expressive-code": "^0.44.1",
@@ -102,6 +102,6 @@
102
102
  "typescript": "^7.0.2"
103
103
  },
104
104
  "peerDependencies": {
105
- "astro": "^7.1.5"
105
+ "astro": "^7.1.6"
106
106
  }
107
107
  }