@xingwangzhe/stalux 1.29.8 → 1.30.0
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 +5 -1
- package/package.json +10 -6
- package/src/components/stalux/archives/archivesList.astro +19 -15
- package/src/components/stalux/archives/toArchive.astro +2 -2
- package/src/components/stalux/categories/categoriesCard.astro +8 -7
- package/src/components/stalux/categories/categoriesList.astro +3 -2
- package/src/components/stalux/common/author.astro +3 -3
- package/src/components/stalux/common/date.astro +3 -4
- package/src/components/stalux/common/textType.astro +2 -2
- package/src/components/stalux/footer/FooterBadges.astro +9 -97
- package/src/components/stalux/footer/FooterBeian.astro +2 -44
- package/src/components/stalux/footer/FooterCopyright.astro +1 -16
- package/src/components/stalux/footer/FooterStats.astro +4 -25
- package/src/components/stalux/footer/FooterThemeInfo.astro +1 -28
- package/src/components/stalux/layout/footer.astro +3 -3
- package/src/components/stalux/layout/listPage.astro +3 -3
- package/src/components/stalux/layout/navs.astro +13 -13
- package/src/components/stalux/links/linkCard.astro +7 -6
- package/src/components/stalux/links/linkList.astro +4 -3
- package/src/components/stalux/links/socialMedia.astro +2 -2
- package/src/components/stalux/posts/PostTaxonomy.astro +13 -8
- package/src/components/stalux/posts/postAuthor.astro +6 -5
- package/src/components/stalux/posts/postCC.astro +10 -9
- package/src/components/stalux/posts/postCard.astro +15 -15
- package/src/components/stalux/posts/postContent.astro +22 -14
- package/src/components/stalux/posts/postLeft.astro +5 -4
- package/src/components/stalux/posts/postList.astro +2 -3
- package/src/components/stalux/posts/postNavigation.astro +24 -23
- package/src/components/stalux/posts/postRight.astro +7 -6
- package/src/components/stalux/posts/postToc.astro +7 -19
- package/src/components/stalux/posts/randomPost.astro +8 -7
- package/src/components/stalux/tags/tagHeader.astro +10 -6
- package/src/components/stalux/tags/tagsCloud.astro +10 -9
- package/src/components/stalux/words/wordCard.astro +11 -10
- package/src/components/stalux/words/wordList.astro +4 -3
- package/src/index.ts +5 -4
- package/src/internal/runtime-cache-key.ts +13 -1
- package/src/layouts/PostLayout.astro +3 -4
- package/src/layouts/Stalux.astro +0 -17
- package/src/pages/404.astro +6 -77
- package/src/pages/archives.astro +3 -3
- package/src/pages/categories/index.astro +3 -3
- package/src/pages/index.astro +4 -18
- package/src/pages/tags/index.astro +3 -3
- package/src/pages/words.astro +3 -3
- package/src/scripts/waline-client.ts +1 -1
- package/src/styles/archives.css +2 -0
- package/src/styles/article.css +2 -0
- package/src/styles/categories.css +2 -0
- package/src/styles/components/posts/waline.css +19 -23
- package/src/styles/generated-archives.css +3 -0
- package/src/styles/generated-article.css +3 -0
- package/src/styles/generated-categories.css +3 -0
- package/src/styles/generated-links.css +3 -0
- package/src/styles/generated-prose.css +2 -0
- package/src/styles/generated-tags.css +3 -0
- package/src/styles/generated-waline.css +2 -0
- package/src/styles/generated-words.css +3 -0
- package/src/styles/generated.css +3 -0
- package/src/styles/links.css +2 -0
- package/src/styles/prose.css +3 -0
- package/src/styles/tags.css +2 -0
- package/src/styles/theme/archives.css +138 -0
- package/src/styles/theme/article.css +562 -0
- package/src/styles/theme/base.css +290 -0
- package/src/styles/theme/categories.css +54 -0
- package/src/styles/theme/common.css +79 -0
- package/src/styles/theme/footer.css +26 -0
- package/src/styles/theme/inline.css +153 -0
- package/src/styles/theme/layout.css +143 -0
- package/src/styles/theme/link-cards.css +114 -0
- package/src/styles/theme/links.css +69 -0
- package/src/styles/theme/pages.css +35 -0
- package/src/styles/theme/posts.css +79 -0
- package/src/styles/theme/prose.css +478 -0
- package/src/styles/theme/tags.css +130 -0
- package/src/styles/theme/words.css +84 -0
- package/src/styles/theme.css +12 -0
- package/src/styles/words.css +2 -0
- package/src/styles/base/init.css +0 -287
- package/src/styles/components/archives/archivesList.module.css +0 -203
- package/src/styles/components/archives/toArchive.module.css +0 -3
- package/src/styles/components/categories/categoriesCard.module.css +0 -88
- package/src/styles/components/categories/categoriesList.module.css +0 -23
- package/src/styles/components/common/author.module.css +0 -72
- package/src/styles/components/common/date.module.css +0 -15
- package/src/styles/components/common/textType.module.css +0 -10
- package/src/styles/components/footer/footer.module.css +0 -44
- package/src/styles/components/layout/navs.module.css +0 -261
- package/src/styles/components/links/linkCard.module.css +0 -116
- package/src/styles/components/links/linkList.module.css +0 -54
- package/src/styles/components/links/socialLinks.module.css +0 -80
- package/src/styles/components/markdown.css +0 -523
- package/src/styles/components/posts/postAuthor.module.css +0 -31
- package/src/styles/components/posts/postCC.module.css +0 -138
- package/src/styles/components/posts/postCard.module.css +0 -167
- package/src/styles/components/posts/postContent.module.css +0 -238
- package/src/styles/components/posts/postLayout.module.css +0 -138
- package/src/styles/components/posts/postList.module.css +0 -25
- package/src/styles/components/posts/postNavigation.module.css +0 -186
- package/src/styles/components/posts/postSidebar.module.css +0 -59
- package/src/styles/components/posts/postTaxonomy.module.css +0 -87
- package/src/styles/components/posts/postToc.module.css +0 -74
- package/src/styles/components/posts/randomPost.module.css +0 -131
- package/src/styles/components/tags/tagHeader.module.css +0 -44
- package/src/styles/components/tags/tagsCloud.module.css +0 -155
- package/src/styles/components/words/wordCard.module.css +0 -136
- package/src/styles/components/words/wordList.module.css +0 -26
- package/src/styles/pages/archives.module.css +0 -22
- package/src/styles/pages/categories.module.css +0 -17
- package/src/styles/pages/home.module.css +0 -61
- package/src/styles/pages/listPage.module.css +0 -16
- package/src/styles/pages/tags.module.css +0 -16
- package/src/styles/pages/words.module.css +0 -16
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
+
import "../../../styles/generated-article.css";
|
|
2
3
|
import { getCollection } from "astro:content";
|
|
3
|
-
|
|
4
|
+
|
|
4
5
|
import { getSiteData } from "@utils/config-utils";
|
|
5
6
|
import { createTranslator } from "@utils/i18n";
|
|
6
7
|
|
|
@@ -30,16 +31,16 @@ const tocItems = headings
|
|
|
30
31
|
|
|
31
32
|
<nav
|
|
32
33
|
transition:name="toc-container"
|
|
33
|
-
data-toc-active-class=
|
|
34
|
+
data-toc-active-class="stalux-toc-active"
|
|
34
35
|
aria-label={t("taxonomy.toc")}
|
|
35
36
|
>
|
|
36
|
-
<h3 class=
|
|
37
|
+
<h3 class="stalux-toc-title">{title}</h3>
|
|
37
38
|
{tocItems.length > 0 ? (
|
|
38
|
-
<ul class=
|
|
39
|
+
<ul class="stalux-toc-list" transition:name="toc-content">
|
|
39
40
|
{tocItems.map((heading) => (
|
|
40
41
|
<li>
|
|
41
42
|
<a
|
|
42
|
-
class={
|
|
43
|
+
class={`stalux-toc-item ${({ 1: "stalux-toc-depth-1", 2: "stalux-toc-depth-2", 3: "stalux-toc-depth-3", 4: "stalux-toc-depth-4", 5: "stalux-toc-depth-5", 6: "stalux-toc-depth-6" } as Record<number, string>)[heading.depth] || ""} a-none`}
|
|
43
44
|
href={`#${heading.slug}`}
|
|
44
45
|
data-toc-link
|
|
45
46
|
>
|
|
@@ -49,21 +50,8 @@ const tocItems = headings
|
|
|
49
50
|
))}
|
|
50
51
|
</ul>
|
|
51
52
|
) : (
|
|
52
|
-
<div class=
|
|
53
|
+
<div class="stalux-toc-empty">{t("taxonomy.noToc")}</div>
|
|
53
54
|
)}
|
|
54
55
|
</nav>
|
|
55
56
|
|
|
56
57
|
<script src="../../../scripts/toc-scrollspy.ts"></script>
|
|
57
|
-
|
|
58
|
-
<style is:global>
|
|
59
|
-
@keyframes fadeSlideDown {
|
|
60
|
-
from {
|
|
61
|
-
opacity: 0;
|
|
62
|
-
transform: translateY(-8px);
|
|
63
|
-
}
|
|
64
|
-
to {
|
|
65
|
-
opacity: 1;
|
|
66
|
-
transform: translateY(0);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
</style>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
+
import "../../../styles/generated-article.css";
|
|
2
3
|
import { getCollection } from "astro:content";
|
|
3
|
-
|
|
4
|
+
|
|
4
5
|
import { createTranslator } from "@utils/i18n";
|
|
5
6
|
|
|
6
7
|
interface Props {
|
|
@@ -17,7 +18,7 @@ const { count = 5, title = t("randomPost.title") } = Astro.props;
|
|
|
17
18
|
---
|
|
18
19
|
|
|
19
20
|
<aside
|
|
20
|
-
class=
|
|
21
|
+
class="stalux-random-container"
|
|
21
22
|
transition:persist-props
|
|
22
23
|
aria-label={t("randomPost.title")}
|
|
23
24
|
data-stalux-random-posts
|
|
@@ -26,12 +27,12 @@ const { count = 5, title = t("randomPost.title") } = Astro.props;
|
|
|
26
27
|
data-load-failed={t("randomPost.loadFailed")}
|
|
27
28
|
data-load-error={t("randomPost.loadError")}
|
|
28
29
|
>
|
|
29
|
-
<div class=
|
|
30
|
-
<h3 class=
|
|
30
|
+
<div class="stalux-random-header">
|
|
31
|
+
<h3 class="stalux-random-title">{title}</h3>
|
|
31
32
|
<button
|
|
32
33
|
type="button"
|
|
33
34
|
id="refresh-random-posts"
|
|
34
|
-
class=
|
|
35
|
+
class="stalux-random-refresh"
|
|
35
36
|
title={t("randomPost.refresh")}
|
|
36
37
|
aria-label={t("randomPost.refresh")}
|
|
37
38
|
>
|
|
@@ -53,8 +54,8 @@ const { count = 5, title = t("randomPost.title") } = Astro.props;
|
|
|
53
54
|
</svg>
|
|
54
55
|
</button>
|
|
55
56
|
</div>
|
|
56
|
-
<ul class=
|
|
57
|
-
<li class=
|
|
57
|
+
<ul class="stalux-random-list" id="random-posts-list">
|
|
58
|
+
<li class="stalux-random-loading">{t("randomPost.loading")}</li>
|
|
58
59
|
</ul>
|
|
59
60
|
</aside>
|
|
60
61
|
<script src="../../../scripts/random-posts.ts"></script>
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
+
import "../../../styles/generated-tags.css";
|
|
3
|
+
|
|
2
4
|
interface Props {
|
|
3
5
|
type: string;
|
|
4
6
|
typeKey?: string;
|
|
@@ -8,7 +10,7 @@ interface Props {
|
|
|
8
10
|
const props = Astro.props as Props;
|
|
9
11
|
|
|
10
12
|
import { getCollection } from "astro:content";
|
|
11
|
-
|
|
13
|
+
|
|
12
14
|
import { getSiteData } from "@utils/config-utils";
|
|
13
15
|
import { createTranslator } from "@utils/i18n";
|
|
14
16
|
|
|
@@ -25,9 +27,9 @@ if (typeKey === "category" || typeKey === "categories" || typeKey === "分类")
|
|
|
25
27
|
}
|
|
26
28
|
---
|
|
27
29
|
|
|
28
|
-
<header class=
|
|
29
|
-
<h1 class=
|
|
30
|
-
<span class=
|
|
30
|
+
<header class="stalux-tag-header">
|
|
31
|
+
<h1 class="stalux-tag-page-title">
|
|
32
|
+
<span class="stalux-tag-category-icon">
|
|
31
33
|
<svg
|
|
32
34
|
aria-hidden="true"
|
|
33
35
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -47,8 +49,10 @@ if (typeKey === "category" || typeKey === "categories" || typeKey === "分类")
|
|
|
47
49
|
</span>
|
|
48
50
|
{props.type}: {props.name}
|
|
49
51
|
</h1>
|
|
50
|
-
<p class=
|
|
51
|
-
|
|
52
|
+
<p class="stalux-tag-page-description">
|
|
53
|
+
{t("taxonomy.foundPosts", { count: props.count })}
|
|
54
|
+
</p>
|
|
55
|
+
<a href={typeUrl} class="stalux-tag-back-link" data-astro-prefetch
|
|
52
56
|
>{t("taxonomy.backToList", { type: props.type })}</a
|
|
53
57
|
>
|
|
54
58
|
</header>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
+
import "../../../styles/generated-tags.css";
|
|
2
3
|
import { getCollection } from "astro:content";
|
|
3
|
-
|
|
4
|
+
|
|
4
5
|
import { getTagCountList } from "@utils/collections-stats";
|
|
5
6
|
import { getSiteData } from "@utils/config-utils";
|
|
6
7
|
import { createTranslator } from "@utils/i18n";
|
|
@@ -21,32 +22,32 @@ const tagLinks = tagList.map((t) => ({
|
|
|
21
22
|
---
|
|
22
23
|
|
|
23
24
|
<!-- 移动端:SSR 卡片 -->
|
|
24
|
-
<div class=
|
|
25
|
+
<div class="stalux-cloud-cards" id="tags-cards">
|
|
25
26
|
{tagList.length > 0 ? (
|
|
26
27
|
tagGroups.map((group) => (
|
|
27
|
-
<div class=
|
|
28
|
+
<div class="stalux-cloud-tag-group">
|
|
28
29
|
{group.map(({ name, count }) => (
|
|
29
30
|
<a
|
|
30
31
|
href={`/tags/${name}/`}
|
|
31
|
-
class=
|
|
32
|
+
class="stalux-cloud-tag-card"
|
|
32
33
|
data-stalux-tag-card
|
|
33
34
|
data-count={count}
|
|
34
35
|
data-astro-prefetch
|
|
35
36
|
>
|
|
36
|
-
<span class=
|
|
37
|
-
<span class=
|
|
37
|
+
<span class="stalux-cloud-tag-name">{name}</span>
|
|
38
|
+
<span class="stalux-cloud-tag-count">{count}</span>
|
|
38
39
|
</a>
|
|
39
40
|
))}
|
|
40
41
|
</div>
|
|
41
42
|
))
|
|
42
43
|
) : (
|
|
43
|
-
<div class=
|
|
44
|
+
<div class="stalux-cloud-no-tags">{t("tags.noTags")}</div>
|
|
44
45
|
)}
|
|
45
46
|
</div>
|
|
46
47
|
|
|
47
48
|
<!-- 桌面端:Canvas 标签云 -->
|
|
48
|
-
<div class=
|
|
49
|
-
<div class=
|
|
49
|
+
<div class="stalux-cloud-canvas-frame" style={{ "--cloud-density": cloudDensity }}>
|
|
50
|
+
<div class="stalux-cloud-canvas" id="tags-canvas" data-tags={JSON.stringify(tagLinks)}></div>
|
|
50
51
|
</div>
|
|
51
52
|
|
|
52
53
|
<script>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
+
import "../../../styles/generated-prose.css";
|
|
3
|
+
import "../../../styles/generated-words.css";
|
|
2
4
|
import type { CollectionEntry } from "astro:content";
|
|
3
5
|
import { render } from "astro:content";
|
|
4
|
-
|
|
5
|
-
import "@styles/components/markdown.css";
|
|
6
|
+
|
|
6
7
|
import { toMachineDateTime } from "@utils/semantic-time";
|
|
7
8
|
|
|
8
9
|
interface Props {
|
|
@@ -17,34 +18,34 @@ const { source, link, sourceDate, date, abbrlink } = entry.data;
|
|
|
17
18
|
const machineDate = date && timezone ? toMachineDateTime(date, timezone) : date;
|
|
18
19
|
---
|
|
19
20
|
|
|
20
|
-
<article class=
|
|
21
|
-
<div class=
|
|
21
|
+
<article class="stalux-word-card" id={abbrlink ? `word-${abbrlink}` : undefined}>
|
|
22
|
+
<div class="stalux-word-body stalux-prose" data-pagefind-body>
|
|
22
23
|
<Content />
|
|
23
24
|
</div>
|
|
24
25
|
{(date || source || sourceDate) && (
|
|
25
|
-
<footer class=
|
|
26
|
+
<footer class="stalux-word-footer">
|
|
26
27
|
{date ? (
|
|
27
|
-
<time class=
|
|
28
|
+
<time class="stalux-word-date" datetime={machineDate}>
|
|
28
29
|
{date}
|
|
29
30
|
</time>
|
|
30
31
|
) : (
|
|
31
32
|
<span />
|
|
32
33
|
)}
|
|
33
34
|
{(source || sourceDate) && (
|
|
34
|
-
<div class=
|
|
35
|
-
{sourceDate && <span class=
|
|
35
|
+
<div class="stalux-word-source-meta">
|
|
36
|
+
{sourceDate && <span class="stalux-word-source-date">{sourceDate}</span>}
|
|
36
37
|
{source &&
|
|
37
38
|
(link ? (
|
|
38
39
|
<a
|
|
39
40
|
href={link}
|
|
40
41
|
target="_blank"
|
|
41
42
|
rel="noopener noreferrer"
|
|
42
|
-
class=
|
|
43
|
+
class="stalux-word-source-link"
|
|
43
44
|
>
|
|
44
45
|
— {source}
|
|
45
46
|
</a>
|
|
46
47
|
) : (
|
|
47
|
-
<span class=
|
|
48
|
+
<span class="stalux-word-source-text">— {source}</span>
|
|
48
49
|
))}
|
|
49
50
|
</div>
|
|
50
51
|
)}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
+
import "../../../styles/generated-words.css";
|
|
2
3
|
import type { CollectionEntry } from "astro:content";
|
|
3
4
|
import WordCard from "@components/stalux/words/wordCard.astro";
|
|
4
|
-
|
|
5
|
+
|
|
5
6
|
import { toTimestamp } from "@utils/dayjs";
|
|
6
7
|
|
|
7
8
|
interface Props {
|
|
@@ -18,11 +19,11 @@ const sorted = [...entries].sort((a, b) => {
|
|
|
18
19
|
});
|
|
19
20
|
---
|
|
20
21
|
|
|
21
|
-
<ul class=
|
|
22
|
+
<ul class="stalux-word-list-list">
|
|
22
23
|
{sorted.map((entry) => {
|
|
23
24
|
const hash = entry.data.abbrlink ? `#word-${entry.data.abbrlink}` : undefined;
|
|
24
25
|
return (
|
|
25
|
-
<li class=
|
|
26
|
+
<li class="stalux-word-list-item">
|
|
26
27
|
{hash ? (
|
|
27
28
|
<a
|
|
28
29
|
href={hash}
|
package/src/index.ts
CHANGED
|
@@ -175,15 +175,16 @@ export function stalux(options: StaluxOptions = {}): AstroIntegration[] {
|
|
|
175
175
|
const runtimeCacheKey = createRuntimeCacheKey(
|
|
176
176
|
path.join(srcDir, "scripts"),
|
|
177
177
|
path.resolve(srcDir, "../package.json"),
|
|
178
|
+
path.join(srcDir, "styles"),
|
|
178
179
|
);
|
|
179
180
|
|
|
180
181
|
// 1. 注入 Vite 别名 + 组件覆盖插件 + Vue 特性标记(Waline 依赖)
|
|
181
182
|
updateConfig({
|
|
182
|
-
//
|
|
183
|
-
//
|
|
183
|
+
// Reuse shared theme CSS across routes instead of embedding the full bundle.
|
|
184
|
+
// Respect callers that explicitly request inline styles.
|
|
184
185
|
build: {
|
|
185
186
|
inlineStylesheets:
|
|
186
|
-
config.build.inlineStylesheets === "
|
|
187
|
+
config.build.inlineStylesheets === "always" ? "always" : "never",
|
|
187
188
|
},
|
|
188
189
|
vite: {
|
|
189
190
|
build: { target: config.vite.build?.target ?? "esnext" },
|
|
@@ -207,7 +208,7 @@ export function stalux(options: StaluxOptions = {}): AstroIntegration[] {
|
|
|
207
208
|
});
|
|
208
209
|
|
|
209
210
|
// 2. 注入全局 CSS
|
|
210
|
-
injectScript("page-ssr", `import "${srcDir}/styles/
|
|
211
|
+
injectScript("page-ssr", `import "${srcDir}/styles/generated.css";`);
|
|
211
212
|
injectScript("page", `import "${srcDir}/scripts/core-runtime.ts";`);
|
|
212
213
|
|
|
213
214
|
// 2.5 同步背景 SVG 到用户项目 public/background/
|
|
@@ -25,9 +25,21 @@ function collectFiles(directory: string, root = directory): Array<readonly [stri
|
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
export function createRuntimeCacheKey(
|
|
28
|
+
export function createRuntimeCacheKey(
|
|
29
|
+
scriptsDirectory: string,
|
|
30
|
+
packageJson: string,
|
|
31
|
+
stylesDirectory?: string,
|
|
32
|
+
): string {
|
|
29
33
|
return hashRuntimeSources([
|
|
30
34
|
...collectFiles(scriptsDirectory),
|
|
35
|
+
...(stylesDirectory
|
|
36
|
+
? readdirSync(stylesDirectory)
|
|
37
|
+
.filter((name) => /^generated(?:-[a-z]+)?\.css$/u.test(name))
|
|
38
|
+
.map((name): readonly [string, string] => [
|
|
39
|
+
`styles/${name}`,
|
|
40
|
+
readFileSync(path.join(stylesDirectory, name), "utf8"),
|
|
41
|
+
])
|
|
42
|
+
: []),
|
|
31
43
|
["package.json", readFileSync(packageJson, "utf8")],
|
|
32
44
|
]);
|
|
33
45
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
import "../styles/generated-article.css";
|
|
2
3
|
import { getCollection } from "astro:content";
|
|
3
4
|
import PostCC from "@components/stalux/posts/postCC.astro";
|
|
4
5
|
import PostContent from "@components/stalux/posts/postContent.astro";
|
|
@@ -9,8 +10,6 @@ import WalineComment from "@components/stalux/posts/WalineComment.astro";
|
|
|
9
10
|
import { getCommentData } from "@utils/config-utils";
|
|
10
11
|
import { getPostTitleTransitionName } from "@utils/view-transitions";
|
|
11
12
|
import { buildWalineProps } from "@utils/waline";
|
|
12
|
-
import "@styles/base/math.css";
|
|
13
|
-
import layoutStyle from "@styles/components/posts/postLayout.module.css";
|
|
14
13
|
|
|
15
14
|
interface Props {
|
|
16
15
|
title: string;
|
|
@@ -51,8 +50,8 @@ const walineConfig = walineSection?.serverURL
|
|
|
51
50
|
: undefined;
|
|
52
51
|
---
|
|
53
52
|
|
|
54
|
-
<div class=
|
|
55
|
-
<div class=
|
|
53
|
+
<div class="stalux-post-page">
|
|
54
|
+
<div class="stalux-post-layout">
|
|
56
55
|
<!-- Left Sidebar -->
|
|
57
56
|
<PostLeft author={author} authorAvatar={props.authorAvatar} />
|
|
58
57
|
|
package/src/layouts/Stalux.astro
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { getCollection } from "astro:content";
|
|
3
3
|
import Footer from "@components/stalux/layout/footer.astro";
|
|
4
4
|
import Head from "@components/stalux/layout/head.astro";
|
|
5
|
-
import "@styles/shared/view-transitions.css";
|
|
6
5
|
import { getAccentColorStyle } from "@utils/accent-color";
|
|
7
6
|
import {
|
|
8
7
|
getAiDiscoveryData,
|
|
@@ -106,19 +105,3 @@ const routeAnimation = getRouteAnimation(routeKind);
|
|
|
106
105
|
<Footer />
|
|
107
106
|
</body>
|
|
108
107
|
</html>
|
|
109
|
-
|
|
110
|
-
<style></style>
|
|
111
|
-
|
|
112
|
-
<style>
|
|
113
|
-
.stalux-ai-prompt {
|
|
114
|
-
position: absolute;
|
|
115
|
-
width: 1px;
|
|
116
|
-
height: 1px;
|
|
117
|
-
padding: 0;
|
|
118
|
-
margin: -1px;
|
|
119
|
-
overflow: hidden;
|
|
120
|
-
clip: rect(0, 0, 0, 0);
|
|
121
|
-
white-space: pre-wrap;
|
|
122
|
-
border: 0;
|
|
123
|
-
}
|
|
124
|
-
</style>
|
package/src/pages/404.astro
CHANGED
|
@@ -16,8 +16,8 @@ const { t } = createTranslator(siteConfig.lang || "zh-CN");
|
|
|
16
16
|
>
|
|
17
17
|
<div style="height: 3em;"></div>
|
|
18
18
|
<Navs />
|
|
19
|
-
<div class="error-container" data-pagefind-ignore>
|
|
20
|
-
<div class="error-content">
|
|
19
|
+
<div class="stalux-404-error-container" data-pagefind-ignore>
|
|
20
|
+
<div class="stalux-404-error-content">
|
|
21
21
|
<h1>404</h1>
|
|
22
22
|
<p>{t("page404.pageNotFound")}</p>
|
|
23
23
|
<p class="agent-recovery">
|
|
@@ -29,87 +29,16 @@ const { t } = createTranslator(siteConfig.lang || "zh-CN");
|
|
|
29
29
|
</p>
|
|
30
30
|
<p
|
|
31
31
|
id="countdown"
|
|
32
|
-
class="countdown-text"
|
|
32
|
+
class="stalux-404-countdown-text"
|
|
33
33
|
data-countdown-template={t("page404.countdown", { n: "{n}" })}
|
|
34
34
|
>
|
|
35
35
|
{t("page404.countdown", { n: 5 })}
|
|
36
36
|
</p>
|
|
37
|
-
<a href="/" class="home-btn" data-astro-prefetch
|
|
37
|
+
<a href="/" class="stalux-404-home-btn home-btn" data-astro-prefetch
|
|
38
|
+
>{t("page404.backHome")}</a
|
|
39
|
+
>
|
|
38
40
|
</div>
|
|
39
41
|
</div>
|
|
40
42
|
|
|
41
43
|
<script src="../scripts/countdown.ts"></script>
|
|
42
44
|
</Stalux>
|
|
43
|
-
|
|
44
|
-
<style>
|
|
45
|
-
.error-container {
|
|
46
|
-
text-align: center;
|
|
47
|
-
padding: 2rem;
|
|
48
|
-
min-height: 60vh;
|
|
49
|
-
display: flex;
|
|
50
|
-
align-items: center;
|
|
51
|
-
justify-content: center;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.error-content h1 {
|
|
55
|
-
font-size: 6rem;
|
|
56
|
-
font-weight: bold;
|
|
57
|
-
margin: 0;
|
|
58
|
-
color: var(--white-90p);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.error-content p {
|
|
62
|
-
font-size: 1.5rem;
|
|
63
|
-
margin: 1rem 0 2rem 0;
|
|
64
|
-
color: var(--white-70p);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.countdown-text {
|
|
68
|
-
font-size: 0.95rem !important;
|
|
69
|
-
color: var(--white-50p) !important;
|
|
70
|
-
margin: -0.5rem 0 1.5rem 0 !important;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.agent-recovery {
|
|
74
|
-
max-width: 42rem;
|
|
75
|
-
margin: 0 auto 1.5rem !important;
|
|
76
|
-
font-size: 1rem !important;
|
|
77
|
-
line-height: 1.7;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.agent-recovery a {
|
|
81
|
-
color: inherit;
|
|
82
|
-
text-decoration: underline;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.home-btn {
|
|
86
|
-
display: inline-block;
|
|
87
|
-
padding: var(--space-md) var(--space-lg);
|
|
88
|
-
background: var(--black-20p);
|
|
89
|
-
color: var(--white-90p);
|
|
90
|
-
text-decoration: none;
|
|
91
|
-
border-radius: var(--radius-md);
|
|
92
|
-
border: var(--border-thin) solid var(--white-20p);
|
|
93
|
-
transition:
|
|
94
|
-
background-color var(--transition-normal),
|
|
95
|
-
transform var(--transition-normal),
|
|
96
|
-
box-shadow var(--transition-normal);
|
|
97
|
-
font-size: var(--font-size-base);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.home-btn:hover {
|
|
101
|
-
background: var(--accent-20p);
|
|
102
|
-
transform: translateY(-2px);
|
|
103
|
-
box-shadow: 0 4px 12px var(--shadow-dark);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
@media (max-width: 768px) {
|
|
107
|
-
.error-content h1 {
|
|
108
|
-
font-size: 4rem;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.error-content p {
|
|
112
|
-
font-size: 1.2rem;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
</style>
|
package/src/pages/archives.astro
CHANGED
|
@@ -3,7 +3,7 @@ import { getCollection } from "astro:content";
|
|
|
3
3
|
import ArchivesList from "@components/stalux/archives/archivesList.astro";
|
|
4
4
|
import Navs from "@components/stalux/layout/navs.astro";
|
|
5
5
|
import Stalux from "@layouts/Stalux.astro";
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
import { getSiteData } from "@utils/config-utils";
|
|
8
8
|
import { createTranslator } from "@utils/i18n";
|
|
9
9
|
|
|
@@ -19,8 +19,8 @@ const posts = await getCollection("posts", ({ data }) => !data.draft);
|
|
|
19
19
|
>
|
|
20
20
|
<div style="height: 3em;"></div>
|
|
21
21
|
<Navs />
|
|
22
|
-
<h1 class=
|
|
23
|
-
<div class=
|
|
22
|
+
<h1 class="stalux-page-title">{t("archives.heading")}</h1>
|
|
23
|
+
<div class="stalux-page-description">
|
|
24
24
|
{t("archives.desc", { n: posts.length })}
|
|
25
25
|
</div>
|
|
26
26
|
<ArchivesList posts={posts} />
|
|
@@ -3,7 +3,7 @@ import { getCollection } from "astro:content";
|
|
|
3
3
|
import CategoriesList from "@components/stalux/categories/categoriesList.astro";
|
|
4
4
|
import Navs from "@components/stalux/layout/navs.astro";
|
|
5
5
|
import Stalux from "@layouts/Stalux.astro";
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
import { getSiteData } from "@utils/config-utils";
|
|
8
8
|
import { createTranslator } from "@utils/i18n";
|
|
9
9
|
|
|
@@ -18,7 +18,7 @@ const { t } = createTranslator(siteConfig.lang || "zh-CN");
|
|
|
18
18
|
>
|
|
19
19
|
<div style="height: 3em;"></div>
|
|
20
20
|
<Navs />
|
|
21
|
-
<h1 class=
|
|
22
|
-
<div class=
|
|
21
|
+
<h1 class="stalux-page-title">{t("categories.heading")}</h1>
|
|
22
|
+
<div class="stalux-page-description">{t("categories.browseByTopic")}</div>
|
|
23
23
|
<CategoriesList />
|
|
24
24
|
</Stalux>
|
package/src/pages/index.astro
CHANGED
|
@@ -15,16 +15,16 @@ import TextType from "@components/stalux/common/textType.astro";
|
|
|
15
15
|
import Navs from "@components/stalux/layout/navs.astro";
|
|
16
16
|
import SocialMedia from "@components/stalux/links/socialMedia.astro";
|
|
17
17
|
import Stalux from "@layouts/Stalux.astro";
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
import { getSiteData } from "@utils/config-utils";
|
|
20
20
|
---
|
|
21
21
|
|
|
22
22
|
<Stalux title={siteTitle} description={siteDescription}>
|
|
23
|
-
<div class=
|
|
24
|
-
<div class=
|
|
23
|
+
<div class="stalux-home-body">
|
|
24
|
+
<div class="stalux-home-navs">
|
|
25
25
|
<Navs />
|
|
26
26
|
</div>
|
|
27
|
-
<h1 class=
|
|
27
|
+
<h1 class="stalux-home-title">{siteTitle}</h1>
|
|
28
28
|
<h2
|
|
29
29
|
class="sr-only"
|
|
30
30
|
style="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;"
|
|
@@ -54,17 +54,3 @@ import { getSiteData } from "@utils/config-utils";
|
|
|
54
54
|
<ToArchive />
|
|
55
55
|
</div>
|
|
56
56
|
</Stalux>
|
|
57
|
-
|
|
58
|
-
<style>
|
|
59
|
-
.agent-home-summary {
|
|
60
|
-
position: absolute;
|
|
61
|
-
width: 1px;
|
|
62
|
-
height: 1px;
|
|
63
|
-
padding: 0;
|
|
64
|
-
margin: -1px;
|
|
65
|
-
overflow: hidden;
|
|
66
|
-
clip: rect(0, 0, 0, 0);
|
|
67
|
-
white-space: normal;
|
|
68
|
-
border: 0;
|
|
69
|
-
}
|
|
70
|
-
</style>
|
|
@@ -3,7 +3,7 @@ import { getCollection } from "astro:content";
|
|
|
3
3
|
import Navs from "@components/stalux/layout/navs.astro";
|
|
4
4
|
import TagsCloud from "@components/stalux/tags/tagsCloud.astro";
|
|
5
5
|
import Stalux from "@layouts/Stalux.astro";
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
import { getSiteData } from "@utils/config-utils";
|
|
8
8
|
import { createTranslator } from "@utils/i18n";
|
|
9
9
|
|
|
@@ -18,7 +18,7 @@ const { t } = createTranslator(siteConfig.lang || "zh-CN");
|
|
|
18
18
|
>
|
|
19
19
|
<div style="height: 3em;"></div>
|
|
20
20
|
<Navs />
|
|
21
|
-
<h1 class=
|
|
22
|
-
<div class=
|
|
21
|
+
<h1 class="stalux-page-title">{t("tags.heading")}</h1>
|
|
22
|
+
<div class="stalux-page-description">{t("tags.explore")}</div>
|
|
23
23
|
<TagsCloud />
|
|
24
24
|
</Stalux>
|
package/src/pages/words.astro
CHANGED
|
@@ -3,7 +3,7 @@ import { getCollection } from "astro:content";
|
|
|
3
3
|
import Navs from "@components/stalux/layout/navs.astro";
|
|
4
4
|
import WordList from "@components/stalux/words/wordList.astro";
|
|
5
5
|
import Stalux from "@layouts/Stalux.astro";
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
import { getSiteData } from "@utils/config-utils";
|
|
8
8
|
import { createTranslator } from "@utils/i18n";
|
|
9
9
|
|
|
@@ -16,8 +16,8 @@ const entries = await getCollection("words", ({ data }) => !data.draft);
|
|
|
16
16
|
<Stalux title={`${t("words.title")} | ${siteConfig.title}`} description={t("words.description")}>
|
|
17
17
|
<div style="height: 3em;"></div>
|
|
18
18
|
<Navs />
|
|
19
|
-
<h1 class=
|
|
20
|
-
<div class=
|
|
19
|
+
<h1 class="stalux-page-title">{t("words.heading")}</h1>
|
|
20
|
+
<div class="stalux-page-description">
|
|
21
21
|
{t("words.desc", { n: entries.length })}
|
|
22
22
|
</div>
|
|
23
23
|
<WordList entries={entries} timezone={siteConfig.timezone} />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { init, type WalineInitOptions } from "@waline/client";
|
|
2
2
|
import walineCss from "@waline/client/style?inline";
|
|
3
|
-
import staluxWalineCss from "../styles/
|
|
3
|
+
import staluxWalineCss from "../styles/generated-waline.css?inline";
|
|
4
4
|
|
|
5
5
|
export function mountWaline(config: Record<string, unknown>, element: HTMLElement): () => void {
|
|
6
6
|
const style = document.createElement("style");
|