@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,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { getCollection } from "astro:content";
|
|
3
3
|
import Search from "@components/stalux/common/search.astro";
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
import { getNavsData, getSiteData } from "@utils/config-utils";
|
|
6
6
|
import { createTranslator } from "@utils/i18n";
|
|
7
7
|
import { getLucideIcon } from "@utils/lucide-icons";
|
|
@@ -20,21 +20,21 @@ const navs = navsConfig?.items ?? [];
|
|
|
20
20
|
<button
|
|
21
21
|
type="button"
|
|
22
22
|
data-ref="stalux-nav-toggle"
|
|
23
|
-
class=
|
|
23
|
+
class="stalux-nav-toggle"
|
|
24
24
|
aria-label={t("nav.menu")}
|
|
25
25
|
>
|
|
26
26
|
{MenuIcon && <MenuIcon size={20} stroke-width={2} class="nav-icon" />}
|
|
27
27
|
</button>
|
|
28
28
|
|
|
29
29
|
<!-- 侧边栏遮罩 -->
|
|
30
|
-
<div data-ref="stalux-nav-overlay" class=
|
|
30
|
+
<div data-ref="stalux-nav-overlay" class="stalux-nav-overlay"></div>
|
|
31
31
|
|
|
32
32
|
<!-- 导航列表 -->
|
|
33
|
-
<div class=
|
|
33
|
+
<div class="stalux-nav-container">
|
|
34
34
|
<button
|
|
35
35
|
type="button"
|
|
36
36
|
data-ref="stalux-nav-scroll-left"
|
|
37
|
-
class=
|
|
37
|
+
class="stalux-nav-scroll-btn"
|
|
38
38
|
data-side="left"
|
|
39
39
|
aria-label={t("nav.scrollLeft")}
|
|
40
40
|
>
|
|
@@ -43,32 +43,32 @@ const navs = navsConfig?.items ?? [];
|
|
|
43
43
|
</svg>
|
|
44
44
|
</button>
|
|
45
45
|
|
|
46
|
-
<ul data-ref="stalux-nav-list" class=
|
|
46
|
+
<ul data-ref="stalux-nav-list" class="stalux-nav-list">
|
|
47
47
|
{navs.map((item) => {
|
|
48
48
|
const NavIcon = item.icon ? getLucideIcon(item.icon, Astro.logger) : null;
|
|
49
49
|
return (
|
|
50
|
-
<li class=
|
|
50
|
+
<li class="stalux-nav-item">
|
|
51
51
|
<a
|
|
52
52
|
href={item.link}
|
|
53
|
-
class=
|
|
53
|
+
class="stalux-nav-link"
|
|
54
54
|
data-ref="stalux-nav-link"
|
|
55
55
|
data-astro-prefetch
|
|
56
56
|
>
|
|
57
57
|
{NavIcon && <NavIcon size={20} stroke-width={2} class="nav-icon" />}
|
|
58
|
-
<span class=
|
|
58
|
+
<span class="stalux-nav-text">{item.title}</span>
|
|
59
59
|
</a>
|
|
60
60
|
</li>
|
|
61
61
|
);
|
|
62
62
|
})}
|
|
63
|
-
<li class=
|
|
63
|
+
<li class="stalux-nav-item">
|
|
64
64
|
<a
|
|
65
65
|
href="#search"
|
|
66
|
-
class=
|
|
66
|
+
class="stalux-nav-link"
|
|
67
67
|
data-ref="stalux-search-btn"
|
|
68
68
|
aria-label={t("search.title")}
|
|
69
69
|
>
|
|
70
70
|
{SearchIcon && <SearchIcon size={20} stroke-width={2} class="nav-icon" />}
|
|
71
|
-
<span class=
|
|
71
|
+
<span class="stalux-nav-text">{t("nav.search")}</span>
|
|
72
72
|
</a>
|
|
73
73
|
</li>
|
|
74
74
|
</ul>
|
|
@@ -76,7 +76,7 @@ const navs = navsConfig?.items ?? [];
|
|
|
76
76
|
<button
|
|
77
77
|
type="button"
|
|
78
78
|
data-ref="stalux-nav-scroll-right"
|
|
79
|
-
class=
|
|
79
|
+
class="stalux-nav-scroll-btn"
|
|
80
80
|
data-side="right"
|
|
81
81
|
aria-label={t("nav.scrollRight")}
|
|
82
82
|
>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
+
import "../../../styles/generated-links.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
|
|
|
@@ -28,8 +29,8 @@ const desc = link.description ?? "";
|
|
|
28
29
|
const icon = link.icon ?? link.avatar ?? "/favicon.ico";
|
|
29
30
|
---
|
|
30
31
|
|
|
31
|
-
<a class=
|
|
32
|
-
<div class=
|
|
32
|
+
<a class="stalux-link-card" href={href} target="_blank" rel="noopener">
|
|
33
|
+
<div class="stalux-link-card-avatar">
|
|
33
34
|
<img
|
|
34
35
|
src={icon}
|
|
35
36
|
alt={t("links.iconAlt", { name: title })}
|
|
@@ -38,8 +39,8 @@ const icon = link.icon ?? link.avatar ?? "/favicon.ico";
|
|
|
38
39
|
height="80"
|
|
39
40
|
>
|
|
40
41
|
</div>
|
|
41
|
-
<div class=
|
|
42
|
-
<h2 class=
|
|
43
|
-
{desc && <p class=
|
|
42
|
+
<div class="stalux-link-card-content">
|
|
43
|
+
<h2 class="stalux-link-card-title">{title}</h2>
|
|
44
|
+
{desc && <p class="stalux-link-card-description">{desc}</p>}
|
|
44
45
|
</div>
|
|
45
46
|
</a>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
+
import "../../../styles/generated-links.css";
|
|
2
3
|
import { getCollection } from "astro:content";
|
|
3
4
|
import LinkCard from "@components/stalux/links/linkCard.astro";
|
|
4
|
-
|
|
5
|
+
|
|
5
6
|
import { getLinksData } from "@utils/config-utils";
|
|
6
7
|
|
|
7
8
|
const configEntries = await getCollection("config");
|
|
@@ -9,9 +10,9 @@ const linksConfig = getLinksData(configEntries);
|
|
|
9
10
|
const links = linksConfig?.sites ?? [];
|
|
10
11
|
---
|
|
11
12
|
|
|
12
|
-
<ul class=
|
|
13
|
+
<ul class="stalux-links">
|
|
13
14
|
{links.map((link) => (
|
|
14
|
-
<li class=
|
|
15
|
+
<li class="stalux-link-list-item">
|
|
15
16
|
<LinkCard link={link} />
|
|
16
17
|
</li>
|
|
17
18
|
))}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// 按需导入图标 — Vite tree-shake 只打包用到的图标
|
|
3
3
|
|
|
4
4
|
import { getCollection } from "astro:content";
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
import { getMediaLinksData } from "@utils/config-utils";
|
|
7
7
|
import {
|
|
8
8
|
type SimpleIcon,
|
|
@@ -35,7 +35,7 @@ function getIconByTitle(iconName: string): SimpleIcon | undefined {
|
|
|
35
35
|
---
|
|
36
36
|
|
|
37
37
|
<nav
|
|
38
|
-
class=
|
|
38
|
+
class="stalux-social"
|
|
39
39
|
transition:persist-props
|
|
40
40
|
aria-label="Social media"
|
|
41
41
|
data-stalux-social-animate={String(!isPostPage)}
|
|
@@ -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
|
|
|
@@ -27,8 +28,8 @@ const cfg = {
|
|
|
27
28
|
empty: t("taxonomy.noTags"),
|
|
28
29
|
containerName: "tags-container",
|
|
29
30
|
contentName: "tags-content",
|
|
30
|
-
listClass:
|
|
31
|
-
itemClass:
|
|
31
|
+
listClass: "stalux-post-taxonomy-list-wrap",
|
|
32
|
+
itemClass: "stalux-post-taxonomy-item-pill",
|
|
32
33
|
},
|
|
33
34
|
category: {
|
|
34
35
|
prefix: "/categories/",
|
|
@@ -36,14 +37,18 @@ const cfg = {
|
|
|
36
37
|
empty: t("taxonomy.noCategories"),
|
|
37
38
|
containerName: "categories-container",
|
|
38
39
|
contentName: "categories-content",
|
|
39
|
-
listClass:
|
|
40
|
-
itemClass:
|
|
40
|
+
listClass: "stalux-post-taxonomy-list-column",
|
|
41
|
+
itemClass: "stalux-post-taxonomy-item-column",
|
|
41
42
|
},
|
|
42
43
|
}[kind];
|
|
43
44
|
---
|
|
44
45
|
|
|
45
|
-
<nav
|
|
46
|
-
|
|
46
|
+
<nav
|
|
47
|
+
class="stalux-post-taxonomy-container"
|
|
48
|
+
transition:name={cfg.containerName}
|
|
49
|
+
aria-label={title ?? cfg.heading}
|
|
50
|
+
>
|
|
51
|
+
{items.length > 0 && <h3 class="stalux-post-taxonomy-title">{title ?? cfg.heading}</h3>}
|
|
47
52
|
{items.length > 0 ? (
|
|
48
53
|
<div class={cfg.listClass} transition:name={cfg.contentName}>
|
|
49
54
|
{items.map((item) => (
|
|
@@ -53,6 +58,6 @@ const cfg = {
|
|
|
53
58
|
))}
|
|
54
59
|
</div>
|
|
55
60
|
) : (
|
|
56
|
-
<div class=
|
|
61
|
+
<div class="stalux-post-taxonomy-empty">{cfg.empty}</div>
|
|
57
62
|
)}
|
|
58
63
|
</nav>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
+
import "../../../styles/generated-article.css";
|
|
2
3
|
import { getCollection } from "astro:content";
|
|
3
4
|
import Author from "@components/stalux/common/author.astro";
|
|
4
|
-
|
|
5
|
+
|
|
5
6
|
import { getAuthorData } from "@utils/config-utils";
|
|
6
7
|
|
|
7
8
|
const configEntries = await getCollection("config");
|
|
@@ -11,11 +12,11 @@ const authorConfig = getAuthorData(configEntries);
|
|
|
11
12
|
const isPostPage = Astro.url.pathname.includes("/posts/");
|
|
12
13
|
---
|
|
13
14
|
|
|
14
|
-
<aside class=
|
|
15
|
-
<div class=
|
|
16
|
-
<div class=
|
|
15
|
+
<aside class="stalux-byline-sidebar-container" style={isPostPage ? "margin-top: -3em;" : ""}>
|
|
16
|
+
<div class="stalux-byline-author-section">
|
|
17
|
+
<div class="stalux-byline-author-card">
|
|
17
18
|
<Author iscolum />
|
|
18
|
-
<p class=
|
|
19
|
+
<p class="stalux-byline-author-bio">{authorConfig.bio}</p>
|
|
19
20
|
</div>
|
|
20
21
|
</div>
|
|
21
22
|
</aside>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
+
import "../../../styles/generated-article.css";
|
|
2
3
|
import { getCollection } from "astro:content";
|
|
3
4
|
import ccIcon from "@assets/cc-icon.svg?raw";
|
|
4
|
-
|
|
5
|
+
|
|
5
6
|
import { buildCCLink, buildCCName } from "@utils/cc";
|
|
6
7
|
import { createTranslator } from "@utils/i18n";
|
|
7
8
|
|
|
@@ -24,19 +25,19 @@ const licenseLink = buildCCLink(cc);
|
|
|
24
25
|
const licenseName = buildCCName(cc, t);
|
|
25
26
|
---
|
|
26
27
|
|
|
27
|
-
<div class=
|
|
28
|
-
<div class=
|
|
29
|
-
<p class=
|
|
30
|
-
<p class=
|
|
28
|
+
<div class="stalux-license-box">
|
|
29
|
+
<div class="stalux-license-content">
|
|
30
|
+
<p class="stalux-license-title">{title}</p>
|
|
31
|
+
<p class="stalux-license-author">{t("post.author")}{author}</p>
|
|
31
32
|
{url && (
|
|
32
|
-
<p class=
|
|
33
|
+
<p class="stalux-license-url">
|
|
33
34
|
{t("post.articleLink")}
|
|
34
35
|
<a href={url} target="_blank" rel="noopener noreferrer">
|
|
35
36
|
{url}
|
|
36
37
|
</a>
|
|
37
38
|
</p>
|
|
38
39
|
)}
|
|
39
|
-
<p class=
|
|
40
|
+
<p class="stalux-license-license">
|
|
40
41
|
{t("post.licensedUnder")}
|
|
41
42
|
<a href={licenseLink} target="_blank" rel="noopener noreferrer">
|
|
42
43
|
{licenseName}
|
|
@@ -44,7 +45,7 @@ const licenseName = buildCCName(cc, t);
|
|
|
44
45
|
</p>
|
|
45
46
|
</div>
|
|
46
47
|
|
|
47
|
-
<div class=
|
|
48
|
-
<div class=
|
|
48
|
+
<div class="stalux-license-watermark">
|
|
49
|
+
<div class="stalux-license-icon" set:html={ccIcon} />
|
|
49
50
|
</div>
|
|
50
51
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { CollectionEntry } from "astro:content";
|
|
3
3
|
import { getCollection } from "astro:content";
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
import { getSiteData } from "@utils/config-utils";
|
|
6
6
|
import { toMachineDateTime } from "@utils/semantic-time";
|
|
7
7
|
import { getPostTitleTransitionName } from "@utils/view-transitions";
|
|
@@ -20,8 +20,8 @@ const timezone = siteConfig.timezone;
|
|
|
20
20
|
const description = post.data.desc || "";
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
-
<article class=
|
|
24
|
-
<div class=
|
|
23
|
+
<article class="block h-full text-inherit no-underline">
|
|
24
|
+
<div class="stalux-post-card">
|
|
25
25
|
{post.data.cover && (
|
|
26
26
|
<a
|
|
27
27
|
href={`/posts/${post.data.abbrlink}/`}
|
|
@@ -29,7 +29,7 @@ const description = post.data.desc || "";
|
|
|
29
29
|
data-astro-prefetch="viewport"
|
|
30
30
|
aria-label={post.data.title}
|
|
31
31
|
>
|
|
32
|
-
<div class=
|
|
32
|
+
<div class="stalux-card-post-cover">
|
|
33
33
|
<img
|
|
34
34
|
src={post.data.cover}
|
|
35
35
|
alt={post.data.title}
|
|
@@ -43,17 +43,17 @@ const description = post.data.desc || "";
|
|
|
43
43
|
</a>
|
|
44
44
|
)}
|
|
45
45
|
<h2
|
|
46
|
-
class=
|
|
46
|
+
class="stalux-card-post-title"
|
|
47
47
|
transition:name={priority ? getPostTitleTransitionName(post.data.abbrlink) : undefined}
|
|
48
48
|
>
|
|
49
49
|
<a href={`/posts/${post.data.abbrlink}/`} class="a-none" data-astro-prefetch="viewport">
|
|
50
50
|
{post.data.title}
|
|
51
51
|
</a>
|
|
52
52
|
</h2>
|
|
53
|
-
<div class=
|
|
53
|
+
<div class="stalux-card-time">
|
|
54
54
|
{post.data.date && (
|
|
55
55
|
<time
|
|
56
|
-
class=
|
|
56
|
+
class="stalux-card-post-date"
|
|
57
57
|
datetime={timezone ? toMachineDateTime(post.data.date, timezone) : post.data.date}
|
|
58
58
|
>
|
|
59
59
|
{post.data.date}
|
|
@@ -61,33 +61,33 @@ const description = post.data.desc || "";
|
|
|
61
61
|
)}
|
|
62
62
|
{post.data.updated && (
|
|
63
63
|
<time
|
|
64
|
-
class=
|
|
64
|
+
class="stalux-card-post-updated"
|
|
65
65
|
datetime={timezone ? toMachineDateTime(post.data.updated, timezone) : post.data.updated}
|
|
66
66
|
>
|
|
67
67
|
{post.data.updated}
|
|
68
68
|
</time>
|
|
69
69
|
)}
|
|
70
70
|
</div>
|
|
71
|
-
<div class=
|
|
72
|
-
<div class=
|
|
73
|
-
<div class=
|
|
71
|
+
<div class="stalux-card-post-description">{description}</div>
|
|
72
|
+
<div class="stalux-card-post-meta">
|
|
73
|
+
<div class="stalux-card-post-tags">
|
|
74
74
|
{post.data.tags?.map((tag) => (
|
|
75
75
|
<a class="a-none" href={`/tags/${tag}`} data-astro-prefetch>
|
|
76
|
-
<span class=
|
|
76
|
+
<span class="stalux-card-post-tag">{tag}</span>
|
|
77
77
|
</a>
|
|
78
78
|
))}
|
|
79
79
|
</div>
|
|
80
|
-
<div class=
|
|
80
|
+
<div class="stalux-card-post-categories">
|
|
81
81
|
{post.data.categories?.map((category) => (
|
|
82
82
|
<a class="a-none" href={`/categories/${category}`} data-astro-prefetch>
|
|
83
|
-
<span class=
|
|
83
|
+
<span class="stalux-card-post-category">{category}</span>
|
|
84
84
|
</a>
|
|
85
85
|
))}
|
|
86
86
|
</div>
|
|
87
87
|
</div>
|
|
88
88
|
<a
|
|
89
89
|
href={`/posts/${post.data.abbrlink}/`}
|
|
90
|
-
class=
|
|
90
|
+
class="stalux-card-read-more a-none"
|
|
91
91
|
data-astro-prefetch
|
|
92
92
|
>
|
|
93
93
|
Read More
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
+
import "../../../styles/generated-article.css";
|
|
3
|
+
import "../../../styles/generated-prose.css";
|
|
2
4
|
import "photoswipe/dist/photoswipe.css";
|
|
3
|
-
|
|
4
|
-
import "@styles/components/markdown.css";
|
|
5
|
+
|
|
5
6
|
import { getCollection } from "astro:content";
|
|
6
7
|
import { getPromoteData, getSiteData } from "@utils/config-utils";
|
|
7
8
|
import { createTranslator } from "@utils/i18n";
|
|
@@ -33,17 +34,19 @@ const mdSourceUrl = exportMd ? `${Astro.url.pathname.replace(/\/$/, "")}.md` : "
|
|
|
33
34
|
---
|
|
34
35
|
|
|
35
36
|
<article
|
|
36
|
-
class=
|
|
37
|
+
class="stalux-article"
|
|
37
38
|
data-stalux-gallery={props.hasImage ? "true" : undefined}
|
|
38
39
|
transition:name={props.transitionName}
|
|
39
40
|
>
|
|
40
41
|
<!-- Article Header -->
|
|
41
|
-
<header class=
|
|
42
|
-
<h1 class=
|
|
43
|
-
|
|
42
|
+
<header class="stalux-post-article-header">
|
|
43
|
+
<h1 class="stalux-post-title" transition:name={props.titleTransitionName}>
|
|
44
|
+
{props.title}
|
|
45
|
+
</h1>
|
|
46
|
+
<div class="stalux-post-metadata">
|
|
44
47
|
{props.date && (
|
|
45
48
|
<time
|
|
46
|
-
class=
|
|
49
|
+
class="stalux-post-meta-item"
|
|
47
50
|
datetime={timezone ? toMachineDateTime(props.date, timezone) : props.date}
|
|
48
51
|
>
|
|
49
52
|
{t("post.publishTime")}
|
|
@@ -53,7 +56,7 @@ const mdSourceUrl = exportMd ? `${Astro.url.pathname.replace(/\/$/, "")}.md` : "
|
|
|
53
56
|
|
|
54
57
|
{props.updated && (
|
|
55
58
|
<time
|
|
56
|
-
class=
|
|
59
|
+
class="stalux-post-meta-item"
|
|
57
60
|
datetime={timezone ? toMachineDateTime(props.updated, timezone) : props.updated}
|
|
58
61
|
>
|
|
59
62
|
{t("post.updateTime")}
|
|
@@ -62,9 +65,9 @@ const mdSourceUrl = exportMd ? `${Astro.url.pathname.replace(/\/$/, "")}.md` : "
|
|
|
62
65
|
)}
|
|
63
66
|
</div>
|
|
64
67
|
{(
|
|
65
|
-
<div class=
|
|
68
|
+
<div class="stalux-post-page-stats">
|
|
66
69
|
{(props.readingMinutes ?? 0) > 0 && (
|
|
67
|
-
<span class=
|
|
70
|
+
<span class="stalux-post-reading-time">
|
|
68
71
|
{t("post.readingTime")}
|
|
69
72
|
{props.readingMinutes && props.readingMinutes > 0
|
|
70
73
|
? props.readingMinutes < 1
|
|
@@ -74,7 +77,7 @@ const mdSourceUrl = exportMd ? `${Astro.url.pathname.replace(/\/$/, "")}.md` : "
|
|
|
74
77
|
</span>
|
|
75
78
|
)}
|
|
76
79
|
{(props.wordCount ?? 0) > 0 && (
|
|
77
|
-
<span class=
|
|
80
|
+
<span class="wordCount">
|
|
78
81
|
{t("post.wordCount")}
|
|
79
82
|
{props.wordCount}
|
|
80
83
|
</span>
|
|
@@ -86,8 +89,13 @@ const mdSourceUrl = exportMd ? `${Astro.url.pathname.replace(/\/$/, "")}.md` : "
|
|
|
86
89
|
</div>
|
|
87
90
|
)}
|
|
88
91
|
{exportMd && (
|
|
89
|
-
<div class=
|
|
90
|
-
<a
|
|
92
|
+
<div class="stalux-post-source-link-row">
|
|
93
|
+
<a
|
|
94
|
+
class="stalux-post-source-link"
|
|
95
|
+
href={mdSourceUrl}
|
|
96
|
+
target="_blank"
|
|
97
|
+
rel="noopener noreferrer"
|
|
98
|
+
>
|
|
91
99
|
{t("post.viewSource")}
|
|
92
100
|
</a>
|
|
93
101
|
</div>
|
|
@@ -95,7 +103,7 @@ const mdSourceUrl = exportMd ? `${Astro.url.pathname.replace(/\/$/, "")}.md` : "
|
|
|
95
103
|
</header>
|
|
96
104
|
|
|
97
105
|
<!-- Article Body -->
|
|
98
|
-
<section class=
|
|
106
|
+
<section class="stalux-post-body stalux-prose" data-pagefind-body>
|
|
99
107
|
<slot />
|
|
100
108
|
</section>
|
|
101
109
|
</article>
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
---
|
|
2
|
+
import "../../../styles/generated-article.css";
|
|
2
3
|
import SocialMedia from "@components/stalux/links/socialMedia.astro";
|
|
3
4
|
import PostAuthor from "@components/stalux/posts/postAuthor.astro";
|
|
4
5
|
import RandomPost from "@components/stalux/posts/randomPost.astro";
|
|
5
|
-
|
|
6
|
+
|
|
6
7
|
import { getSidebarAnimation } from "@utils/view-transitions";
|
|
7
8
|
---
|
|
8
9
|
|
|
9
10
|
<aside
|
|
10
|
-
class=
|
|
11
|
+
class="stalux-sidebar"
|
|
11
12
|
transition:name="left-sidebar"
|
|
12
13
|
transition:animate={getSidebarAnimation("left")}
|
|
13
14
|
>
|
|
14
15
|
<PostAuthor />
|
|
15
|
-
<div class=
|
|
16
|
+
<div class="stalux-sidebar-container">
|
|
16
17
|
<SocialMedia />
|
|
17
18
|
</div>
|
|
18
|
-
<div class=
|
|
19
|
+
<div class="stalux-sidebar-container">
|
|
19
20
|
<RandomPost />
|
|
20
21
|
</div>
|
|
21
22
|
</aside>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { type CollectionEntry, getCollection } from "astro:content";
|
|
3
3
|
import PostCard from "@components/stalux/posts/postCard.astro";
|
|
4
|
-
import styles from "@styles/components/posts/postList.module.css";
|
|
5
4
|
|
|
6
5
|
interface Props {
|
|
7
6
|
posts?: CollectionEntry<"posts">[];
|
|
@@ -12,8 +11,8 @@ const props = Astro.props as Props;
|
|
|
12
11
|
const posts = props.posts ?? (await getCollection("posts", ({ data }) => !data.draft));
|
|
13
12
|
---
|
|
14
13
|
|
|
15
|
-
<div data-stalux="postlist" class=
|
|
16
|
-
<ul class=
|
|
14
|
+
<div data-stalux="postlist" class="stalux-post-list-container">
|
|
15
|
+
<ul class="post-list">
|
|
17
16
|
{posts.map((post, index) => (
|
|
18
17
|
<li>
|
|
19
18
|
<PostCard post={post} priority={index === 0} />
|
|
@@ -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 {
|
|
@@ -18,16 +19,16 @@ const { t } = createTranslator((siteConfig.lang as string) || "zh-CN");
|
|
|
18
19
|
---
|
|
19
20
|
|
|
20
21
|
{(props.prev || props.next) && (
|
|
21
|
-
<nav class=
|
|
22
|
-
<div class=
|
|
22
|
+
<nav class="stalux-pagination" aria-label={t("post.navigation")}>
|
|
23
|
+
<div class="stalux-pagination-inner">
|
|
23
24
|
{props.prev ? (
|
|
24
25
|
<a
|
|
25
26
|
href={props.prev.url}
|
|
26
|
-
class=
|
|
27
|
+
class="stalux-pagination-link stalux-pagination-prev-post"
|
|
27
28
|
rel="prev"
|
|
28
29
|
data-astro-prefetch
|
|
29
30
|
>
|
|
30
|
-
<span class=
|
|
31
|
+
<span class="stalux-pagination-arrow">
|
|
31
32
|
<svg
|
|
32
33
|
aria-hidden="true"
|
|
33
34
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -43,14 +44,14 @@ const { t } = createTranslator((siteConfig.lang as string) || "zh-CN");
|
|
|
43
44
|
<path d="M19 12H5M12 19l-7-7 7-7" />
|
|
44
45
|
</svg>
|
|
45
46
|
</span>
|
|
46
|
-
<div class=
|
|
47
|
-
<span class=
|
|
48
|
-
<span class=
|
|
47
|
+
<div class="stalux-pagination-content">
|
|
48
|
+
<span class="stalux-pagination-label">{t("post.prevPost")}</span>
|
|
49
|
+
<span class="stalux-pagination-title">{props.prev.title}</span>
|
|
49
50
|
</div>
|
|
50
51
|
</a>
|
|
51
52
|
) : (
|
|
52
|
-
<span class=
|
|
53
|
-
<span class=
|
|
53
|
+
<span class="stalux-pagination-link stalux-pagination-prev-post stalux-pagination-disabled">
|
|
54
|
+
<span class="stalux-pagination-arrow">
|
|
54
55
|
<svg
|
|
55
56
|
aria-hidden="true"
|
|
56
57
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -66,9 +67,9 @@ const { t } = createTranslator((siteConfig.lang as string) || "zh-CN");
|
|
|
66
67
|
<path d="M19 12H5M12 19l-7-7 7-7" />
|
|
67
68
|
</svg>
|
|
68
69
|
</span>
|
|
69
|
-
<div class=
|
|
70
|
-
<span class=
|
|
71
|
-
<span class=
|
|
70
|
+
<div class="stalux-pagination-content">
|
|
71
|
+
<span class="stalux-pagination-label">{t("post.prevPost")}</span>
|
|
72
|
+
<span class="stalux-pagination-title">{t("post.noPrev")}</span>
|
|
72
73
|
</div>
|
|
73
74
|
</span>
|
|
74
75
|
)}
|
|
@@ -76,15 +77,15 @@ const { t } = createTranslator((siteConfig.lang as string) || "zh-CN");
|
|
|
76
77
|
{props.next ? (
|
|
77
78
|
<a
|
|
78
79
|
href={props.next.url}
|
|
79
|
-
class=
|
|
80
|
+
class="stalux-pagination-link stalux-pagination-next-post"
|
|
80
81
|
rel="next"
|
|
81
82
|
data-astro-prefetch
|
|
82
83
|
>
|
|
83
|
-
<div class=
|
|
84
|
-
<span class=
|
|
85
|
-
<span class=
|
|
84
|
+
<div class="stalux-pagination-content">
|
|
85
|
+
<span class="stalux-pagination-label">{t("post.nextPost")}</span>
|
|
86
|
+
<span class="stalux-pagination-title">{props.next.title}</span>
|
|
86
87
|
</div>
|
|
87
|
-
<span class=
|
|
88
|
+
<span class="stalux-pagination-arrow">
|
|
88
89
|
<svg
|
|
89
90
|
aria-hidden="true"
|
|
90
91
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -102,12 +103,12 @@ const { t } = createTranslator((siteConfig.lang as string) || "zh-CN");
|
|
|
102
103
|
</span>
|
|
103
104
|
</a>
|
|
104
105
|
) : (
|
|
105
|
-
<span class=
|
|
106
|
-
<div class=
|
|
107
|
-
<span class=
|
|
108
|
-
<span class=
|
|
106
|
+
<span class="stalux-pagination-link stalux-pagination-next-post stalux-pagination-disabled">
|
|
107
|
+
<div class="stalux-pagination-content">
|
|
108
|
+
<span class="stalux-pagination-label">{t("post.nextPost")}</span>
|
|
109
|
+
<span class="stalux-pagination-title">{t("post.noNext")}</span>
|
|
109
110
|
</div>
|
|
110
|
-
<span class=
|
|
111
|
+
<span class="stalux-pagination-arrow">
|
|
111
112
|
<svg
|
|
112
113
|
aria-hidden="true"
|
|
113
114
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
+
import "../../../styles/generated-article.css";
|
|
2
3
|
import PostDate from "@components/stalux/common/date.astro";
|
|
3
4
|
import PostTaxonomy from "@components/stalux/posts/PostTaxonomy.astro";
|
|
4
5
|
import PostToc from "@components/stalux/posts/postToc.astro";
|
|
5
|
-
|
|
6
|
+
|
|
6
7
|
import { getSidebarAnimation } from "@utils/view-transitions";
|
|
7
8
|
|
|
8
9
|
interface Props {
|
|
@@ -15,20 +16,20 @@ const { headings = [], tags = [], categories = [] } = Astro.props;
|
|
|
15
16
|
---
|
|
16
17
|
|
|
17
18
|
<aside
|
|
18
|
-
class=
|
|
19
|
+
class="stalux-sidebar-right"
|
|
19
20
|
transition:name="right-sidebar"
|
|
20
21
|
transition:animate={getSidebarAnimation("right")}
|
|
21
22
|
>
|
|
22
|
-
<div class=
|
|
23
|
+
<div class="stalux-sidebar-container">
|
|
23
24
|
<PostDate />
|
|
24
25
|
</div>
|
|
25
|
-
<div class=
|
|
26
|
+
<div class="stalux-sidebar-container">
|
|
26
27
|
<PostToc headings={headings} />
|
|
27
28
|
</div>
|
|
28
|
-
<div class=
|
|
29
|
+
<div class="stalux-sidebar-container">
|
|
29
30
|
<PostTaxonomy kind="tag" items={tags} />
|
|
30
31
|
</div>
|
|
31
|
-
<div class=
|
|
32
|
+
<div class="stalux-sidebar-container">
|
|
32
33
|
<PostTaxonomy kind="category" items={categories} />
|
|
33
34
|
</div>
|
|
34
35
|
</aside>
|