@xingwangzhe/stalux 1.29.8 → 1.30.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.
Files changed (105) hide show
  1. package/README.md +5 -1
  2. package/package.json +10 -6
  3. package/src/components/stalux/archives/archivesList.astro +19 -15
  4. package/src/components/stalux/archives/toArchive.astro +2 -2
  5. package/src/components/stalux/categories/categoriesCard.astro +8 -7
  6. package/src/components/stalux/categories/categoriesList.astro +3 -2
  7. package/src/components/stalux/common/author.astro +8 -3
  8. package/src/components/stalux/common/date.astro +3 -4
  9. package/src/components/stalux/common/textType.astro +7 -2
  10. package/src/components/stalux/footer/FooterBadges.astro +9 -97
  11. package/src/components/stalux/footer/FooterBeian.astro +2 -44
  12. package/src/components/stalux/footer/FooterCopyright.astro +1 -16
  13. package/src/components/stalux/footer/FooterStats.astro +4 -25
  14. package/src/components/stalux/footer/FooterThemeInfo.astro +1 -28
  15. package/src/components/stalux/layout/footer.astro +3 -3
  16. package/src/components/stalux/layout/listPage.astro +3 -3
  17. package/src/components/stalux/layout/navs.astro +16 -13
  18. package/src/components/stalux/links/linkCard.astro +7 -6
  19. package/src/components/stalux/links/linkList.astro +4 -3
  20. package/src/components/stalux/links/socialMedia.astro +2 -2
  21. package/src/components/stalux/posts/PostTaxonomy.astro +13 -8
  22. package/src/components/stalux/posts/postAuthor.astro +6 -5
  23. package/src/components/stalux/posts/postCC.astro +10 -9
  24. package/src/components/stalux/posts/postCard.astro +19 -15
  25. package/src/components/stalux/posts/postContent.astro +22 -14
  26. package/src/components/stalux/posts/postLeft.astro +5 -4
  27. package/src/components/stalux/posts/postList.astro +2 -3
  28. package/src/components/stalux/posts/postNavigation.astro +24 -23
  29. package/src/components/stalux/posts/postRight.astro +7 -6
  30. package/src/components/stalux/posts/postToc.astro +7 -19
  31. package/src/components/stalux/posts/randomPost.astro +8 -7
  32. package/src/components/stalux/tags/tagHeader.astro +10 -6
  33. package/src/components/stalux/tags/tagsCloud.astro +10 -9
  34. package/src/components/stalux/words/wordCard.astro +11 -10
  35. package/src/components/stalux/words/wordList.astro +4 -3
  36. package/src/index.ts +5 -4
  37. package/src/internal/runtime-cache-key.ts +13 -1
  38. package/src/layouts/PostLayout.astro +3 -4
  39. package/src/layouts/Stalux.astro +0 -17
  40. package/src/pages/404.astro +9 -77
  41. package/src/pages/archives.astro +3 -3
  42. package/src/pages/categories/index.astro +3 -3
  43. package/src/pages/index.astro +6 -18
  44. package/src/pages/tags/index.astro +3 -3
  45. package/src/pages/words.astro +3 -3
  46. package/src/scripts/waline-client.ts +1 -1
  47. package/src/styles/archives.css +1 -0
  48. package/src/styles/article.css +1 -0
  49. package/src/styles/base.css +287 -0
  50. package/src/styles/categories.css +1 -0
  51. package/src/styles/content.css +471 -0
  52. package/src/styles/generated-archives.css +3 -0
  53. package/src/styles/generated-article.css +3 -0
  54. package/src/styles/generated-categories.css +3 -0
  55. package/src/styles/generated-links.css +3 -0
  56. package/src/styles/generated-prose.css +2 -0
  57. package/src/styles/generated-tags.css +3 -0
  58. package/src/styles/generated-waline.css +2 -0
  59. package/src/styles/generated-words.css +3 -0
  60. package/src/styles/generated.css +3 -0
  61. package/src/styles/{components/posts/waline.css → integrations.css} +19 -23
  62. package/src/styles/links.css +1 -0
  63. package/src/styles/{shared/view-transitions.css → motion.css} +96 -0
  64. package/src/styles/prose.css +1 -0
  65. package/src/styles/tags.css +1 -0
  66. package/src/styles/theme.css +1 -0
  67. package/src/styles/words.css +1 -0
  68. package/src/styles/base/init.css +0 -287
  69. package/src/styles/components/archives/archivesList.module.css +0 -203
  70. package/src/styles/components/archives/toArchive.module.css +0 -3
  71. package/src/styles/components/categories/categoriesCard.module.css +0 -88
  72. package/src/styles/components/categories/categoriesList.module.css +0 -23
  73. package/src/styles/components/common/author.module.css +0 -72
  74. package/src/styles/components/common/date.module.css +0 -15
  75. package/src/styles/components/common/textType.module.css +0 -10
  76. package/src/styles/components/footer/footer.module.css +0 -44
  77. package/src/styles/components/layout/navs.module.css +0 -261
  78. package/src/styles/components/links/linkCard.module.css +0 -116
  79. package/src/styles/components/links/linkList.module.css +0 -54
  80. package/src/styles/components/links/socialLinks.module.css +0 -80
  81. package/src/styles/components/markdown.css +0 -523
  82. package/src/styles/components/posts/postAuthor.module.css +0 -31
  83. package/src/styles/components/posts/postCC.module.css +0 -138
  84. package/src/styles/components/posts/postCard.module.css +0 -167
  85. package/src/styles/components/posts/postContent.module.css +0 -238
  86. package/src/styles/components/posts/postLayout.module.css +0 -138
  87. package/src/styles/components/posts/postList.module.css +0 -25
  88. package/src/styles/components/posts/postNavigation.module.css +0 -186
  89. package/src/styles/components/posts/postSidebar.module.css +0 -59
  90. package/src/styles/components/posts/postTaxonomy.module.css +0 -87
  91. package/src/styles/components/posts/postToc.module.css +0 -74
  92. package/src/styles/components/posts/randomPost.module.css +0 -131
  93. package/src/styles/components/tags/tagHeader.module.css +0 -44
  94. package/src/styles/components/tags/tagsCloud.module.css +0 -155
  95. package/src/styles/components/words/wordCard.module.css +0 -136
  96. package/src/styles/components/words/wordList.module.css +0 -26
  97. package/src/styles/pages/archives.module.css +0 -22
  98. package/src/styles/pages/categories.module.css +0 -17
  99. package/src/styles/pages/home.module.css +0 -61
  100. package/src/styles/pages/listPage.module.css +0 -16
  101. package/src/styles/pages/tags.module.css +0 -16
  102. package/src/styles/pages/words.module.css +0 -16
  103. package/src/styles/shared/animations.css +0 -87
  104. package/src/styles/shared/stagger.css +0 -20
  105. /package/src/styles/{base/math.css → math.css} +0 -0
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  import { getCollection } from "astro:content";
3
3
  import Search from "@components/stalux/common/search.astro";
4
- import styles from "@styles/components/layout/navs.module.css";
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={styles.navToggle}
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={styles.navOverlay}></div>
30
+ <div data-ref="stalux-nav-overlay" class="stalux-nav-overlay stalux-u-w-full"></div>
31
31
 
32
32
  <!-- 导航列表 -->
33
- <div class={styles.navContainer}>
33
+ <div class="stalux-nav-container stalux-u-w-full stalux-u-min-w-0">
34
34
  <button
35
35
  type="button"
36
36
  data-ref="stalux-nav-scroll-left"
37
- class={styles.scrollBtn}
37
+ class="stalux-nav-scroll-btn stalux-u-items-center stalux-u-justify-center"
38
38
  data-side="left"
39
39
  aria-label={t("nav.scrollLeft")}
40
40
  >
@@ -43,32 +43,35 @@ const navs = navsConfig?.items ?? [];
43
43
  </svg>
44
44
  </button>
45
45
 
46
- <ul data-ref="stalux-nav-list" class={styles.navList}>
46
+ <ul
47
+ data-ref="stalux-nav-list"
48
+ class="stalux-nav-list stalux-u-flex stalux-u-items-center stalux-u-justify-center stalux-u-flex-wrap stalux-u-w-full stalux-u-min-w-0"
49
+ >
47
50
  {navs.map((item) => {
48
51
  const NavIcon = item.icon ? getLucideIcon(item.icon, Astro.logger) : null;
49
52
  return (
50
- <li class={styles.navItem}>
53
+ <li class="stalux-nav-item stalux-u-flex stalux-u-items-center">
51
54
  <a
52
55
  href={item.link}
53
- class={styles.navLink}
56
+ class="stalux-nav-link"
54
57
  data-ref="stalux-nav-link"
55
58
  data-astro-prefetch
56
59
  >
57
60
  {NavIcon && <NavIcon size={20} stroke-width={2} class="nav-icon" />}
58
- <span class={styles.navText}>{item.title}</span>
61
+ <span class="stalux-nav-text">{item.title}</span>
59
62
  </a>
60
63
  </li>
61
64
  );
62
65
  })}
63
- <li class={styles.navItem}>
66
+ <li class="stalux-nav-item stalux-u-flex stalux-u-items-center">
64
67
  <a
65
68
  href="#search"
66
- class={styles.navLink}
69
+ class="stalux-nav-link"
67
70
  data-ref="stalux-search-btn"
68
71
  aria-label={t("search.title")}
69
72
  >
70
73
  {SearchIcon && <SearchIcon size={20} stroke-width={2} class="nav-icon" />}
71
- <span class={styles.navText}>{t("nav.search")}</span>
74
+ <span class="stalux-nav-text">{t("nav.search")}</span>
72
75
  </a>
73
76
  </li>
74
77
  </ul>
@@ -76,7 +79,7 @@ const navs = navsConfig?.items ?? [];
76
79
  <button
77
80
  type="button"
78
81
  data-ref="stalux-nav-scroll-right"
79
- class={styles.scrollBtn}
82
+ class="stalux-nav-scroll-btn stalux-u-items-center stalux-u-justify-center"
80
83
  data-side="right"
81
84
  aria-label={t("nav.scrollRight")}
82
85
  >
@@ -1,6 +1,7 @@
1
1
  ---
2
+ import "../../../styles/generated-links.css";
2
3
  import { getCollection } from "astro:content";
3
- import styles from "@styles/components/links/linkCard.module.css";
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={styles.card} href={href} target="_blank" rel="noopener">
32
- <div class={styles.avatar}>
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={styles.content}>
42
- <h2 class={styles.title}>{title}</h2>
43
- {desc && <p class={styles.description}>{desc}</p>}
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
- import styles from "@styles/components/links/linkList.module.css";
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={styles.list}>
13
+ <ul class="stalux-links">
13
14
  {links.map((link) => (
14
- <li class={styles.item}>
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
- import styles from "@styles/components/links/socialLinks.module.css";
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={styles["social-links"]}
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
- import style from "@styles/components/posts/postTaxonomy.module.css";
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: style.listWrap,
31
- itemClass: style.itemPill,
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: style.listColumn,
40
- itemClass: style.itemColumn,
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 class={style.container} transition:name={cfg.containerName} aria-label={title ?? cfg.heading}>
46
- {items.length > 0 && <h3 class={style.title}>{title ?? cfg.heading}</h3>}
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={style.empty}>{cfg.empty}</div>
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
- import style from "@styles/components/posts/postAuthor.module.css";
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={style.sidebarContainer} style={isPostPage ? "margin-top: -3em;" : ""}>
15
- <div class={style.authorSection}>
16
- <div class={style.authorCard}>
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={style.authorBio}>{authorConfig.bio}</p>
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
- import style from "@styles/components/posts/postCC.module.css";
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={style.ccBox}>
28
- <div class={style.ccContent}>
29
- <p class={style.ccTitle}>{title}</p>
30
- <p class={style.ccAuthor}>{t("post.author")}{author}</p>
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={style.ccUrl}>
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={style.ccLicense}>
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={style.ccWatermark}>
48
- <div class={style.ccIcon} set:html={ccIcon} />
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
- import style from "@styles/components/posts/postCard.module.css";
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={style.post}>
24
- <div class={style.postContainer}>
23
+ <article class="block h-full text-inherit no-underline">
24
+ <div class="stalux-post-card stalux-u-flex stalux-u-flex-col stalux-u-w-full stalux-u-min-w-0">
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={style.postCover}>
32
+ <div class="stalux-card-post-cover stalux-u-w-full stalux-u-min-w-0">
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={style.postTitle}
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={style.time}>
53
+ <div class="stalux-card-time stalux-u-items-center stalux-u-flex-wrap">
54
54
  {post.data.date && (
55
55
  <time
56
- class={style.postDate}
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,37 @@ const description = post.data.desc || "";
61
61
  )}
62
62
  {post.data.updated && (
63
63
  <time
64
- class={style.postUpdated}
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={style.postDescription}>{description}</div>
72
- <div class={style.postMeta}>
73
- <div class={style.postTags}>
71
+ <div class="stalux-card-post-description stalux-u-min-w-0">{description}</div>
72
+ <div class="stalux-card-post-meta stalux-u-flex stalux-u-flex-col">
73
+ <div
74
+ class="stalux-card-post-tags stalux-u-flex stalux-u-items-center stalux-u-flex-wrap"
75
+ >
74
76
  {post.data.tags?.map((tag) => (
75
77
  <a class="a-none" href={`/tags/${tag}`} data-astro-prefetch>
76
- <span class={style.postTag}>{tag}</span>
78
+ <span class="stalux-card-post-tag">{tag}</span>
77
79
  </a>
78
80
  ))}
79
81
  </div>
80
- <div class={style.postCategories}>
82
+ <div
83
+ class="stalux-card-post-categories stalux-u-flex stalux-u-items-center stalux-u-flex-wrap"
84
+ >
81
85
  {post.data.categories?.map((category) => (
82
86
  <a class="a-none" href={`/categories/${category}`} data-astro-prefetch>
83
- <span class={style.postCategory}>{category}</span>
87
+ <span class="stalux-card-post-category">{category}</span>
84
88
  </a>
85
89
  ))}
86
90
  </div>
87
91
  </div>
88
92
  <a
89
93
  href={`/posts/${post.data.abbrlink}/`}
90
- class={`${style.readMore} a-none`}
94
+ class="stalux-card-read-more a-none"
91
95
  data-astro-prefetch
92
96
  >
93
97
  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
- import style from "@styles/components/posts/postContent.module.css";
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={style.articleContent}
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={style.articleHeader}>
42
- <h1 class={style.title} transition:name={props.titleTransitionName}>{props.title}</h1>
43
- <div class={style.metadata}>
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={style.metaItem}
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={style.metaItem}
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={style.pageStats}>
68
+ <div class="stalux-post-page-stats">
66
69
  {(props.readingMinutes ?? 0) > 0 && (
67
- <span class={style.readingTime}>
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={style.wordCount}>
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={style.sourceLinkRow}>
90
- <a class={style.sourceLink} href={mdSourceUrl} target="_blank" rel="noopener noreferrer">
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={style.body} data-pagefind-body>
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
- import style from "@styles/components/posts/postSidebar.module.css";
6
+
6
7
  import { getSidebarAnimation } from "@utils/view-transitions";
7
8
  ---
8
9
 
9
10
  <aside
10
- class={style.sidebar}
11
+ class="stalux-sidebar"
11
12
  transition:name="left-sidebar"
12
13
  transition:animate={getSidebarAnimation("left")}
13
14
  >
14
15
  <PostAuthor />
15
- <div class={style.sidebarContainer}>
16
+ <div class="stalux-sidebar-container">
16
17
  <SocialMedia />
17
18
  </div>
18
- <div class={style.sidebarContainer}>
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={styles.container}>
16
- <ul class={styles["post-list"]}>
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
- import style from "@styles/components/posts/postNavigation.module.css";
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={style.postNavigation} aria-label={t("post.navigation")}>
22
- <div class={style.postNavigationInner}>
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={`${style.postNavLink} ${style.prevPost}`}
27
+ class="stalux-pagination-link stalux-pagination-prev-post"
27
28
  rel="prev"
28
29
  data-astro-prefetch
29
30
  >
30
- <span class={style.postNavArrow}>
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={style.postNavContent}>
47
- <span class={style.postNavLabel}>{t("post.prevPost")}</span>
48
- <span class={style.postNavTitle}>{props.prev.title}</span>
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={`${style.postNavLink} ${style.prevPost} ${style.disabled}`}>
53
- <span class={style.postNavArrow}>
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={style.postNavContent}>
70
- <span class={style.postNavLabel}>{t("post.prevPost")}</span>
71
- <span class={style.postNavTitle}>{t("post.noPrev")}</span>
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={`${style.postNavLink} ${style.nextPost}`}
80
+ class="stalux-pagination-link stalux-pagination-next-post"
80
81
  rel="next"
81
82
  data-astro-prefetch
82
83
  >
83
- <div class={style.postNavContent}>
84
- <span class={style.postNavLabel}>{t("post.nextPost")}</span>
85
- <span class={style.postNavTitle}>{props.next.title}</span>
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={style.postNavArrow}>
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={`${style.postNavLink} ${style.nextPost} ${style.disabled}`}>
106
- <div class={style.postNavContent}>
107
- <span class={style.postNavLabel}>{t("post.nextPost")}</span>
108
- <span class={style.postNavTitle}>{t("post.noNext")}</span>
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={style.postNavArrow}>
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
- import style from "@styles/components/posts/postSidebar.module.css";
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={style.sidebarRight}
19
+ class="stalux-sidebar-right"
19
20
  transition:name="right-sidebar"
20
21
  transition:animate={getSidebarAnimation("right")}
21
22
  >
22
- <div class={style.sidebarContainer}>
23
+ <div class="stalux-sidebar-container">
23
24
  <PostDate />
24
25
  </div>
25
- <div class={style.sidebarContainer}>
26
+ <div class="stalux-sidebar-container">
26
27
  <PostToc headings={headings} />
27
28
  </div>
28
- <div class={style.sidebarContainer}>
29
+ <div class="stalux-sidebar-container">
29
30
  <PostTaxonomy kind="tag" items={tags} />
30
31
  </div>
31
- <div class={style.sidebarContainer}>
32
+ <div class="stalux-sidebar-container">
32
33
  <PostTaxonomy kind="category" items={categories} />
33
34
  </div>
34
35
  </aside>