@xingwangzhe/stalux 1.7.0 → 1.7.2

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.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "A powerful, modern Astro blog theme — use as template or install as plugin",
5
5
  "keywords": [
6
6
  "astro",
package/scripts/cli.mjs CHANGED
@@ -184,7 +184,7 @@ function getWordsTemplate() {
184
184
  const date = new Date().toISOString().replace("T", " ").slice(0, 19);
185
185
  return `---
186
186
  source: "Author Name"
187
- link: ""
187
+ link: "https://example.com"
188
188
  sourceDate: ""
189
189
  date: "${date}"
190
190
  ---
@@ -197,7 +197,7 @@ function getWordsExample() {
197
197
  const date = new Date().toISOString().replace("T", " ").slice(0, 19);
198
198
  return `---
199
199
  source: "Albert Einstein"
200
- link: ""
200
+ link: "https://example.com"
201
201
  sourceDate: ""
202
202
  date: "${date}"
203
203
  ---
@@ -1,12 +1,18 @@
1
1
  ---
2
2
  import type { BadgeItem } from "@utils/badge-generator";
3
3
  import { generateBadge, svgToDataUrl, isBadgeGroup } from "@utils/badge-generator";
4
+ import { createTranslator } from "@utils/i18n";
5
+ import { getCollection } from "astro:content";
6
+ import { getSiteData } from "@utils/config-utils";
4
7
 
5
8
  interface Props {
6
9
  badges?: BadgeItem[];
7
10
  }
8
11
 
9
12
  const { badges } = Astro.props;
13
+ const configEntries = await getCollection("config");
14
+ const siteConfig = getSiteData(configEntries);
15
+ const { t } = createTranslator(siteConfig.lang || "zh-CN");
10
16
 
11
17
  function badgeImg(opts: Record<string, any>) {
12
18
  const src = svgToDataUrl(generateBadge(opts));
@@ -29,8 +35,8 @@ function badgeImg(opts: Record<string, any>) {
29
35
  <summary class="badge-group-summary">
30
36
  <span class="badge-group-arrow">&#9654;</span>
31
37
  <span class="badge-group-title">{item.title}</span>
32
- <span class="badge-group-hint" data-hint="expanded">收起</span>
33
- <span class="badge-group-hint" data-hint="collapsed">展开</span>
38
+ <span class="badge-group-hint" data-hint="expanded">{t("footer.collapse")}</span>
39
+ <span class="badge-group-hint" data-hint="collapsed">{t("footer.expand")}</span>
34
40
  </summary>
35
41
  <div class="badge-group-items badges">
36
42
  {item.items.map((b: any) => (
package/src/i18n/en.json CHANGED
@@ -72,7 +72,9 @@
72
72
  "runningTime": "Site running for",
73
73
  "runtimeFormat": "{days}d {hours}h {minutes}m {seconds}s",
74
74
  "rightsReserved": "All rights reserved.",
75
- "securityIcon": "Public security filing icon"
75
+ "securityIcon": "Public security filing icon",
76
+ "collapse": "Collapse",
77
+ "expand": "Expand"
76
78
  },
77
79
  "comment": {
78
80
  "title": "Comments",
@@ -72,7 +72,9 @@
72
72
  "runningTime": "本站已正常运行",
73
73
  "runtimeFormat": "{days}天{hours}时{minutes}分{seconds}秒",
74
74
  "rightsReserved": "保留权利.",
75
- "securityIcon": "公安备案图标"
75
+ "securityIcon": "公网安备图标",
76
+ "collapse": "收起",
77
+ "expand": "展开"
76
78
  },
77
79
  "comment": {
78
80
  "title": "留言评论",