Site Basic Information & Content Collections
In this article
Site identity configuration (site.yml, author.yml), content collection structure, frontmatter field references, and writing notes.
site.yml — Site Identity
File: stalux/config/site.yml
id: sitelang: en # Language: "en" | "zh-CN"title: Stalux Blog Theme # Site titleurl: https://stalux.needhelp.icu # Site URL (used for canonical, RSS, OpenGraph)description: "Blog theme Stalux ..." # Site description (SEO, OpenGraph)accentColor: "#EAB308" # Optional shared theme and Waline accent; six-digit HEXtimezone: "Asia/Shanghai" # IANA timezone for date formattingfavicon: "/stalux.ico" # Favicon pathcanonical: "https://stalux.needhelp.icu" # Canonical URL (optional, falls back to url)# twitterSite: # Twitter/X site handle (optional)# noindex: false # Global noindex (optional, default false)# nofollow: false # Global nofollow (optional, default false)accentColor defaults to #EAB308 and accepts #RRGGBB. Stalux derives the theme’s translucent accent tokens and Waline color from it. Choose a color with sufficient contrast against the site’s background.
This setting is optional: leave it out to keep the default, and existing site.yml files do not need to be edited. Stalux applies the default while reading site configuration as well as when generating color tokens, because Astro’s YAML content collection may omit Zod defaults from runtime data. This compatibility fix is included in Stalux v1.29.1. In v1.29.0, a consumer build with accentColor omitted could fail while rendering /404 with an undefined accent color.
author.yml — Author Information
File: stalux/config/author.yml
id: authorname: xingwangzhe # Display nameavatar: /avatar.png # Avatar pathbio: Blog Theme Stalux # Short biojobTitle: Software Engineer # Optional public role, emitted in JSON-LD PersonRendered on: post sidebars, homepage author card, and SEO JSON-LD. jobTitle is optional and is emitted only in the JSON-LD Person entity; it does not change the visual author card.
Content Collections
Content is managed through Astro’s astro:content system under the stalux/ directory:
stalux/├── posts/ # Blog posts (.md / .mdx)├── about/ # About pages (.md / .mdx)├── words/ # Quotes & snippets (.md)└── config/ # Theme configuration (.yml)Posts (stalux/posts/*.md)
Required frontmatter:
| Field | Type | Description |
|---|---|---|
title |
string | Post title |
abbrlink |
string|number | Permanent link ID, generates /posts/{abbrlink} route |
date |
string | Publish time, ISO 8601 or YYYY-MM-DD HH:mm:ss |
desc |
string | Post description for SEO/OG. Must be manually written, 50–160 chars recommended |
Optional frontmatter:
| Field | Type | Default | Description |
|---|---|---|---|
updated |
string | — | Update time |
draft |
boolean | false |
Hide from published lists |
tags |
string[] | — | Tag array (single string auto-converted) |
categories |
string[] | — | Category array |
cc |
string | CC-BY-NC-SA-4.0 |
License |
cover |
string | — | Post cover image URL/path |
Example:
---title: Sample Postabbrlink: sample-postdate: 2025-05-10T12:00:00+08:00desc: A short description for SEO and preview cards.updated: 2025-05-12T09:00:00+08:00tags: [Tech, Essay]categories: [Frontend]cc: CC-BY-NC-SA-4.0draft: falsecover: /images/cover.jpg---
Post body...About (stalux/about/*.md)
Required: title (page title), description (page description).
Words (stalux/words/*.md)
Optional frontmatter: source, link, sourceDate, date, updated, draft.
Writing Notes
| Guideline | Detail |
|---|---|
| Delimiter | Wrap frontmatter between --- |
| Date format | ISO 8601 with timezone offset recommended |
| Permalinks | Choose stable custom abbrlink values (independent of title changes) |
| Descriptions | Must be meaningful for SEO and social share cards |
Visitor weather is optional: set weather: { enabled: true } in stalux/config/site.yml to show it as plain text in the footer (with visitor IP and approximate location) and below the desktop article clock. Omitted or false disables it. It automatically requests an approximate city from IP.SB (with IPinfo as fallback) and weather from Open-Meteo, only while visible; no browser GPS permission is requested. These external services receive the visitor IP, and Open-Meteo receives rounded coordinates. A 20-minute session cache stores the city, visitor IP and weather, without coordinates. Visitors behind VPNs may see the exit city. Hidden tabs, offscreen cards and Astro navigation stop work; unavailable services show a retry action and retain previous weather. Open-Meteo’s free endpoint is for non-commercial use subject to its limits; the card links to its attribution licence. No server endpoint or extra package is needed.
Site Basic Information & Content Collections
Author: xingwangzhe
Article link: https://stalux.needhelp.icu/posts/ad81245d/
This article is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.