@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.
- package/README.md +68 -146
- 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
|
|
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
|
-
|
|
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
|
-
## 🚀
|
|
15
|
+
## 🚀 Quick Start
|
|
22
16
|
|
|
23
|
-
###
|
|
24
|
-
|
|
25
|
-
Get the full source — modify anything, customize everything:
|
|
17
|
+
### Plugin Mode (recommended)
|
|
26
18
|
|
|
27
19
|
```bash
|
|
28
|
-
|
|
29
|
-
cd
|
|
30
|
-
bun
|
|
31
|
-
|
|
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
|
-
|
|
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
|
-
|
|
65
|
+
### Template Mode
|
|
119
66
|
|
|
120
|
-
```
|
|
121
|
-
stalux
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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**
|
|
144
|
-
- 🔤 **Per-route font subsetting** —
|
|
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
|
|
149
|
-
- 📐 **KaTeX / MathML
|
|
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
|
-
-
|
|
86
|
+
- 🤖 **LLM discovery files** (llms.txt / llms-full.txt)
|
|
153
87
|
- ⚡ **View transitions** for smooth navigation
|
|
154
|
-
-
|
|
155
|
-
-
|
|
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)
|
|
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
|
-
|
|
164
|
-
|
|
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
|
-
|
|
104
|
+
Every page loads `common.css` + `subset-{route}.css`. All route types are covered: `/`, `/about`, `/words`, `/posts/*`, `/archives`, `/tags`, `/categories`, `/links`.
|
|
167
105
|
|
|
168
|
-
|
|
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
|
-
##
|
|
110
|
+
## 🎨 Component Override
|
|
187
111
|
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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
|
-
|
|
206
|
-
|
|
207
|
-
Stalux supports component overrides (like Starlight):
|
|
123
|
+
---
|
|
208
124
|
|
|
209
|
-
|
|
210
|
-
import { defineConfig } from "astro/config";
|
|
211
|
-
import stalux from "@xingwangzhe/stalux";
|
|
125
|
+
## 📝 Content Structure
|
|
212
126
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
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
|
-
|
|
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.
|
|
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.
|
|
82
|
-
"@xingwangzhe/satteri-photoswipe": "^0.2.
|
|
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.
|
|
105
|
+
"astro": "^7.1.6"
|
|
106
106
|
}
|
|
107
107
|
}
|