@xingwangzhe/stalux 1.46.1 → 1.46.5
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 +3 -2
- package/src/components/stalux/archives/archivesList.astro +1 -1
- package/src/components/stalux/categories/categoriesList.astro +6 -1
- package/src/components/stalux/common/Weather.astro +1 -1
- package/src/components/stalux/common/date.astro +1 -1
- package/src/components/stalux/footer/FooterBeian.astro +2 -0
- package/src/components/stalux/layout/head.astro +1 -1
- package/src/components/stalux/links/linkList.astro +1 -1
- package/src/components/stalux/posts/postContent.astro +5 -1
- package/src/components/stalux/posts/postList.astro +6 -1
- package/src/components/stalux/posts/postRight.astro +11 -4
- package/src/components/stalux/words/wordList.astro +11 -8
- package/src/index.ts +1 -1
- package/src/internal/compact-styles.ts +1 -1
- package/src/internal/font-slices.ts +3 -3
- package/src/internal/page-output-cache.ts +6 -7
- package/src/internal/social-card-renderer.ts +3 -5
- package/src/pages/og/[image].[format].ts +1 -1
- package/src/schemas/config.ts +5 -5
- package/src/scripts/analytics-runtime.ts +1 -1
- package/src/scripts/archive-descriptions.ts +1 -1
- package/src/scripts/back-to-top.ts +7 -6
- package/src/scripts/background.ts +2 -2
- package/src/scripts/countdown.ts +1 -1
- package/src/scripts/date-time.ts +1 -1
- package/src/scripts/list-reveal.ts +214 -40
- package/src/scripts/module-motion.ts +5 -3
- package/src/scripts/navigation-font.ts +4 -1
- package/src/scripts/navigation.ts +1 -1
- package/src/scripts/page-runtime.ts +6 -4
- package/src/scripts/random-posts.ts +2 -2
- package/src/scripts/route-motion.ts +67 -56
- package/src/scripts/route-out.ts +12 -14
- package/src/scripts/runtime-counter.ts +1 -1
- package/src/scripts/shell-hydration.ts +60 -0
- package/src/scripts/smooth-scroll.ts +4 -4
- package/src/scripts/swup-internals.d.ts +31 -0
- package/src/scripts/swup-router.ts +53 -11
- package/src/scripts/waline.ts +1 -1
- package/src/scripts/weather.ts +148 -82
- package/src/scripts/webmcp.ts +24 -20
- package/src/utils/ai-discovery.ts +1 -1
- package/src/utils/cc.ts +2 -2
- package/src/utils/collections-stats.ts +4 -2
- package/src/utils/dayjs.ts +2 -2
- package/src/utils/i18n.ts +2 -2
- package/src/utils/seo-document.ts +4 -4
- package/src/utils/taxonomy.ts +10 -12
|
@@ -6,8 +6,10 @@ function countUncategorized(posts: PostEntry[]): number {
|
|
|
6
6
|
let count = 0;
|
|
7
7
|
for (const post of posts) {
|
|
8
8
|
const names = post.data.categories ?? [];
|
|
9
|
-
if (
|
|
10
|
-
|
|
9
|
+
if (names.length)
|
|
10
|
+
for (const name of names)
|
|
11
|
+
if (name === "uncategorized") count++;
|
|
12
|
+
else count++;
|
|
11
13
|
}
|
|
12
14
|
return count;
|
|
13
15
|
}
|
package/src/utils/dayjs.ts
CHANGED
|
@@ -138,7 +138,7 @@ export function format(date: Date | string | number, formatStr: string): string
|
|
|
138
138
|
export function formatInTimeZone(
|
|
139
139
|
date: Date | string | number,
|
|
140
140
|
timeZone: string,
|
|
141
|
-
formatStr
|
|
141
|
+
formatStr = "yyyy-MM-dd'T'HH:mm:ssXXX",
|
|
142
142
|
): string {
|
|
143
143
|
const d = date instanceof Date ? date : new Date(date);
|
|
144
144
|
if (Number.isNaN(d.getTime())) return "";
|
|
@@ -160,7 +160,7 @@ export function formatInTimeZone(
|
|
|
160
160
|
offset = "+00:00";
|
|
161
161
|
} else {
|
|
162
162
|
offset = offset.replace(/^GMT/, "").replace(/^UTC/, "");
|
|
163
|
-
if (!offset.startsWith("+")
|
|
163
|
+
if (!(offset.startsWith("+") || offset.startsWith("-"))) {
|
|
164
164
|
offset = `+${offset}`;
|
|
165
165
|
}
|
|
166
166
|
const m = offset.match(/^([+-])(\d{1,2})(?::?(\d{2}))?$/);
|
package/src/utils/i18n.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import en from "@i18n/en.json";
|
|
2
|
-
import zhCN from "@i18n/zh-CN.json";
|
|
1
|
+
import en from "@i18n/en.json" with { type: "json" };
|
|
2
|
+
import zhCN from "@i18n/zh-CN.json" with { type: "json" };
|
|
3
3
|
|
|
4
4
|
const dicts: Record<string, Record<string, unknown>> = {
|
|
5
5
|
"zh-CN": zhCN as Record<string, unknown>,
|
|
@@ -145,14 +145,14 @@ export function buildSeoDocument(input: SeoDocumentInput): SeoDocument {
|
|
|
145
145
|
{ name: "generator", content: "Stalux" },
|
|
146
146
|
{ name: "theme", content: "Stalux" },
|
|
147
147
|
{ name: "stalux-version", content: version },
|
|
148
|
-
...(
|
|
149
|
-
? [
|
|
148
|
+
...(noindex
|
|
149
|
+
? []
|
|
150
|
+
: [
|
|
150
151
|
{
|
|
151
152
|
name: "googlebot",
|
|
152
153
|
content: "max-image-preview:large, max-snippet:-1, max-video-preview:-1",
|
|
153
154
|
},
|
|
154
|
-
]
|
|
155
|
-
: []),
|
|
155
|
+
]),
|
|
156
156
|
];
|
|
157
157
|
|
|
158
158
|
const sameAs = input.mediaLinks.filter((link) => /^https?:\/\//i.test(link));
|
package/src/utils/taxonomy.ts
CHANGED
|
@@ -15,16 +15,14 @@ export async function buildTaxonomyStaticPaths(key: TaxonomyKey): Promise<GetSta
|
|
|
15
15
|
const paramName = key === "tags" ? "tag" : "category";
|
|
16
16
|
const taxonomy = index[key];
|
|
17
17
|
|
|
18
|
-
return [...taxonomy].map(([name, entry]) => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
});
|
|
18
|
+
return [...taxonomy].map(([name, entry]) => ({
|
|
19
|
+
params: { [paramName]: name },
|
|
20
|
+
cacheKey: `${entry.cacheKey}|${getRuntimeCacheKey()}`,
|
|
21
|
+
props: {
|
|
22
|
+
[paramName]: name,
|
|
23
|
+
count: entry.posts.length,
|
|
24
|
+
posts: entry.posts,
|
|
25
|
+
lastUpdateDate: entry.latestTime,
|
|
26
|
+
},
|
|
27
|
+
}));
|
|
30
28
|
}
|