@xingwangzhe/stalux 1.29.0 → 1.29.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xingwangzhe/stalux",
3
- "version": "1.29.0",
3
+ "version": "1.29.1",
4
4
  "description": "A powerful, modern Astro blog theme — use as template or install as plugin",
5
5
  "keywords": [
6
6
  "astro",
@@ -3,7 +3,7 @@ const ACCENT_COLOR_PATTERN = /^#[\da-fA-F]{6}$/;
3
3
  const ACCENT_OPACITIES = [90, 85, 80, 70, 60, 50, 40, 30, 20] as const;
4
4
 
5
5
  /** Build the CSS custom properties shared by Stalux and its comment styles. */
6
- export function getAccentColorStyle(accentColor: string): string {
6
+ export function getAccentColorStyle(accentColor = "#EAB308"): string {
7
7
  if (!ACCENT_COLOR_PATTERN.test(accentColor)) {
8
8
  throw new Error(`Invalid Stalux accent color "${accentColor}". Expected #RRGGBB.`);
9
9
  }
@@ -39,7 +39,9 @@ function findConfig<Id extends ConfigId>(
39
39
  export function getSiteData(entries: CollectionEntry<"config">[]): SiteData {
40
40
  const site = findConfig(entries, "site");
41
41
  if (!site) throw new Error("Missing site config");
42
- return site;
42
+ // Content collection loaders may omit Zod defaults from parsed YAML data.
43
+ // Keep the public default stable for older consumer configs that lack this key.
44
+ return { ...site, accentColor: site.accentColor ?? "#EAB308" };
43
45
  }
44
46
 
45
47
  export function getAuthorData(entries: CollectionEntry<"config">[]): AuthorData {