@xingwangzhe/stalux 1.2.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/LICENSE +21 -0
- package/README.md +192 -0
- package/package.json +108 -0
- package/scripts/cli.mjs +103 -0
- package/src/assets/BiCcCircle.svg +1 -0
- package/src/assets/astro.svg +1 -0
- package/src/assets/background/README.md +3 -0
- package/src/assets/background/pattern-1.min.svg +1 -0
- package/src/assets/background/pattern-10.min.svg +1 -0
- package/src/assets/background/pattern-11.min.svg +1 -0
- package/src/assets/background/pattern-12.min.svg +1 -0
- package/src/assets/background/pattern-13.min.svg +1 -0
- package/src/assets/background/pattern-14.min.svg +1 -0
- package/src/assets/background/pattern-15.min.svg +1 -0
- package/src/assets/background/pattern-16.min.svg +1 -0
- package/src/assets/background/pattern-17.min.svg +1 -0
- package/src/assets/background/pattern-18.min.svg +1 -0
- package/src/assets/background/pattern-19.min.svg +1 -0
- package/src/assets/background/pattern-2.min.svg +1 -0
- package/src/assets/background/pattern-20.min.svg +1 -0
- package/src/assets/background/pattern-21.min.svg +1 -0
- package/src/assets/background/pattern-22.min.svg +1 -0
- package/src/assets/background/pattern-23.min.svg +1 -0
- package/src/assets/background/pattern-24.min.svg +1 -0
- package/src/assets/background/pattern-25.min.svg +1 -0
- package/src/assets/background/pattern-26.min.svg +1 -0
- package/src/assets/background/pattern-27.min.svg +1 -0
- package/src/assets/background/pattern-28.min.svg +1 -0
- package/src/assets/background/pattern-29.min.svg +1 -0
- package/src/assets/background/pattern-3.min.svg +1 -0
- package/src/assets/background/pattern-30.min.svg +1 -0
- package/src/assets/background/pattern-31.min.svg +1 -0
- package/src/assets/background/pattern-32.min.svg +1 -0
- package/src/assets/background/pattern-33.min.svg +1 -0
- package/src/assets/background/pattern-34.min.svg +1 -0
- package/src/assets/background/pattern-35.min.svg +1 -0
- package/src/assets/background/pattern-36.min.svg +1 -0
- package/src/assets/background/pattern-37.min.svg +1 -0
- package/src/assets/background/pattern-38.min.svg +1 -0
- package/src/assets/background/pattern-39.min.svg +1 -0
- package/src/assets/background/pattern-4.min.svg +1 -0
- package/src/assets/background/pattern-40.min.svg +1 -0
- package/src/assets/background/pattern-41.min.svg +1 -0
- package/src/assets/background/pattern-42.min.svg +1 -0
- package/src/assets/background/pattern-5.min.svg +1 -0
- package/src/assets/background/pattern-6.min.svg +1 -0
- package/src/assets/background/pattern-7.min.svg +1 -0
- package/src/assets/background/pattern-8.min.svg +1 -0
- package/src/assets/background/pattern-9.min.svg +1 -0
- package/src/assets/background.svg +1 -0
- package/src/assets/cc-icon.svg +4 -0
- package/src/assets/fonts/GoogleSansCode-Italic.woff2 +0 -0
- package/src/assets/fonts/GoogleSansCode.woff2 +0 -0
- package/src/assets/fonts/LXGWWenKai-Regular.ttf +0 -0
- package/src/assets/fonts/LXGWWenKai-Regular.woff2 +0 -0
- package/src/components/stalux/analytics/clarity.astro +25 -0
- package/src/components/stalux/analytics/google.astro +31 -0
- package/src/components/stalux/analytics/umami.astro +16 -0
- package/src/components/stalux/archives/archivesList.astro +116 -0
- package/src/components/stalux/archives/toArchive.astro +14 -0
- package/src/components/stalux/categories/categoriesCard.astro +49 -0
- package/src/components/stalux/categories/categoriesList.astro +17 -0
- package/src/components/stalux/common/author.astro +35 -0
- package/src/components/stalux/common/date.astro +59 -0
- package/src/components/stalux/common/search.astro +14 -0
- package/src/components/stalux/common/textType.astro +16 -0
- package/src/components/stalux/common/verCount.astro +10 -0
- package/src/components/stalux/footer/FooterBadges.astro +150 -0
- package/src/components/stalux/footer/FooterBeian.astro +91 -0
- package/src/components/stalux/footer/FooterCopyright.astro +40 -0
- package/src/components/stalux/footer/FooterStats.astro +108 -0
- package/src/components/stalux/footer/FooterThemeInfo.astro +67 -0
- package/src/components/stalux/layout/footer.astro +87 -0
- package/src/components/stalux/layout/head.astro +194 -0
- package/src/components/stalux/layout/listPage.astro +26 -0
- package/src/components/stalux/layout/navs.astro +174 -0
- package/src/components/stalux/links/linkCard.astro +50 -0
- package/src/components/stalux/links/linkList.astro +20 -0
- package/src/components/stalux/links/socialMedia.astro +102 -0
- package/src/components/stalux/posts/PhotoSwipeStyle.astro +3 -0
- package/src/components/stalux/posts/PostTaxonomy.astro +65 -0
- package/src/components/stalux/posts/WalineComment.astro +609 -0
- package/src/components/stalux/posts/postAuthor.astro +23 -0
- package/src/components/stalux/posts/postCC.astro +52 -0
- package/src/components/stalux/posts/postCard.astro +83 -0
- package/src/components/stalux/posts/postContent.astro +174 -0
- package/src/components/stalux/posts/postLeft.astro +41 -0
- package/src/components/stalux/posts/postList.astro +25 -0
- package/src/components/stalux/posts/postNavigation.astro +137 -0
- package/src/components/stalux/posts/postRight.astro +33 -0
- package/src/components/stalux/posts/postToc.astro +88 -0
- package/src/components/stalux/posts/randomPost.astro +134 -0
- package/src/components/stalux/tags/tagHeader.astro +50 -0
- package/src/components/stalux/tags/tagsCloud.astro +100 -0
- package/src/components/stalux/words/wordCard.astro +62 -0
- package/src/components/stalux/words/wordList.astro +70 -0
- package/src/config.ts +58 -0
- package/src/i18n/en.json +193 -0
- package/src/i18n/zh-CN.json +193 -0
- package/src/index.ts +215 -0
- package/src/internal/components-plugin.ts +54 -0
- package/src/internal/dev-toolbar.ts +33 -0
- package/src/internal/override.ts +99 -0
- package/src/internal/pagefind.ts +40 -0
- package/src/layouts/PostLayout.astro +90 -0
- package/src/layouts/Stalux.astro +91 -0
- package/src/pages/404.astro +103 -0
- package/src/pages/about.astro +59 -0
- package/src/pages/about.md.ts +15 -0
- package/src/pages/api/post.abbrlink.json.ts +20 -0
- package/src/pages/archives.astro +23 -0
- package/src/pages/archives.md.ts +24 -0
- package/src/pages/atom.xml.ts +29 -0
- package/src/pages/categories/[category].astro +35 -0
- package/src/pages/categories/[category].md.ts +34 -0
- package/src/pages/categories/index.astro +23 -0
- package/src/pages/categories/index.md.ts +27 -0
- package/src/pages/index.astro +30 -0
- package/src/pages/index.md.ts +18 -0
- package/src/pages/links.astro +23 -0
- package/src/pages/links.md.ts +18 -0
- package/src/pages/llms-full.txt.ts +25 -0
- package/src/pages/llms.txt.ts +26 -0
- package/src/pages/posts/[post].astro +69 -0
- package/src/pages/posts/[post].md.ts +109 -0
- package/src/pages/rss.xml.ts +29 -0
- package/src/pages/tags/[tag].astro +37 -0
- package/src/pages/tags/[tag].md.ts +34 -0
- package/src/pages/tags/index.astro +23 -0
- package/src/pages/tags/index.md.ts +27 -0
- package/src/pages/words.astro +24 -0
- package/src/pages/words.md.ts +14 -0
- package/src/plugins/feature-flags.ts +68 -0
- package/src/plugins/satteri-temml.ts +81 -0
- package/src/schemas/collections.ts +140 -0
- package/src/schemas/config.ts +226 -0
- package/src/scripts/background.ts +59 -0
- package/src/styles/base/init.css +286 -0
- package/src/styles/base/math.css +411 -0
- package/src/styles/components/archives/archivesList.module.css +378 -0
- package/src/styles/components/archives/toArchive.module.css +3 -0
- package/src/styles/components/categories/categoriesCard.module.css +87 -0
- package/src/styles/components/categories/categoriesList.module.css +27 -0
- package/src/styles/components/common/author.module.css +73 -0
- package/src/styles/components/common/date.module.css +15 -0
- package/src/styles/components/common/textType.module.css +10 -0
- package/src/styles/components/footer/footer.module.css +44 -0
- package/src/styles/components/layout/navs.module.css +250 -0
- package/src/styles/components/links/linkCard.module.css +99 -0
- package/src/styles/components/links/linkList.module.css +67 -0
- package/src/styles/components/links/socialLinks.module.css +22 -0
- package/src/styles/components/markdown.css +528 -0
- package/src/styles/components/posts/postAuthor.module.css +32 -0
- package/src/styles/components/posts/postCC.module.css +138 -0
- package/src/styles/components/posts/postCard.module.css +156 -0
- package/src/styles/components/posts/postCategories.module.css +50 -0
- package/src/styles/components/posts/postContent.module.css +230 -0
- package/src/styles/components/posts/postLayout.module.css +142 -0
- package/src/styles/components/posts/postLeft.module.css +38 -0
- package/src/styles/components/posts/postList.module.css +24 -0
- package/src/styles/components/posts/postNavigation.module.css +187 -0
- package/src/styles/components/posts/postRight.module.css +60 -0
- package/src/styles/components/posts/postSidebar.module.css +57 -0
- package/src/styles/components/posts/postTags.module.css +51 -0
- package/src/styles/components/posts/postTaxonomy.module.css +87 -0
- package/src/styles/components/posts/postToc.module.css +74 -0
- package/src/styles/components/posts/randomPost.module.css +131 -0
- package/src/styles/components/tags/tagHeader.module.css +44 -0
- package/src/styles/components/tags/tagsCloud.module.css +124 -0
- package/src/styles/components/words/wordCard.module.css +130 -0
- package/src/styles/components/words/wordList.module.css +39 -0
- package/src/styles/pages/archives.module.css +18 -0
- package/src/styles/pages/categories.module.css +13 -0
- package/src/styles/pages/home.module.css +51 -0
- package/src/styles/pages/listPage.module.css +13 -0
- package/src/styles/pages/tags.module.css +12 -0
- package/src/styles/pages/words.module.css +13 -0
- package/src/styles/shared/animations.css +87 -0
- package/src/styles/shared/stagger.css +20 -0
- package/src/utils/ai-discovery.ts +547 -0
- package/src/utils/badge-generator.ts +68 -0
- package/src/utils/cc.ts +46 -0
- package/src/utils/collections-stats.ts +48 -0
- package/src/utils/config-utils.ts +107 -0
- package/src/utils/count-words.ts +20 -0
- package/src/utils/dayjs.ts +106 -0
- package/src/utils/feed.ts +70 -0
- package/src/utils/i18n.ts +64 -0
- package/src/utils/lucide-icons.ts +52 -0
- package/src/utils/semantic-time.ts +11 -0
- package/src/utils/taxonomy.ts +44 -0
- package/src/utils/toc-scrollspy.ts +95 -0
- package/src/utils/waline.ts +27 -0
- package/src/utils/word-count-utils.ts +83 -0
- package/template/astro.config.mjs +51 -0
- package/template/package.json +27 -0
- package/template/public/robots.txt +3 -0
- package/template/src/content.config.ts +11 -0
- package/template/stalux/about/index.md +14 -0
- package/template/stalux/config/ai-discovery.yml +2 -0
- package/template/stalux/config/author.yml +4 -0
- package/template/stalux/config/comment.yml +5 -0
- package/template/stalux/config/footer.yml +13 -0
- package/template/stalux/config/head.yml +7 -0
- package/template/stalux/config/links.yml +4 -0
- package/template/stalux/config/media-links.yml +8 -0
- package/template/stalux/config/navs.yml +23 -0
- package/template/stalux/config/promote.yml +2 -0
- package/template/stalux/config/site.yml +7 -0
- package/template/stalux/config/typetexts.yml +5 -0
- package/template/stalux/posts/hello-stalux.md +47 -0
- package/template/stalux/words/_template.md +12 -0
- package/template/stalux/words/einstein-imagination.md +8 -0
- package/template/tsconfig.json +9 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
import styles from "@styles/components/links/linkCard.module.css";
|
|
3
|
+
import { getCollection } from "astro:content";
|
|
4
|
+
import { createTranslator } from "@utils/i18n";
|
|
5
|
+
import { getSiteData, getAuthorData, getHeadData, getNavsData, getLinksData, getCommentData, getFooterData, getPromoteData, getTypetextsData, getMediaLinksData } from "@utils/config-utils";
|
|
6
|
+
|
|
7
|
+
interface LinkItem {
|
|
8
|
+
title?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
url?: string;
|
|
11
|
+
link?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
icon?: string;
|
|
14
|
+
avatar?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface Props {
|
|
18
|
+
link: LinkItem;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const configEntries = await getCollection("config");
|
|
22
|
+
const siteConfig = getSiteData(configEntries);
|
|
23
|
+
const { t } = createTranslator(siteConfig.lang || "zh-CN");
|
|
24
|
+
const link = Astro.props.link;
|
|
25
|
+
const href = link.url ?? link.link ?? "#";
|
|
26
|
+
const title = link.title ?? link.name ?? t("links.defaultTitle");
|
|
27
|
+
const desc = link.description ?? "";
|
|
28
|
+
const icon = link.icon ?? link.avatar ?? "/favicon.ico";
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
<a
|
|
32
|
+
class={styles.card + " a-none"}
|
|
33
|
+
href={href}
|
|
34
|
+
target="_blank"
|
|
35
|
+
rel="noopener noreferrer"
|
|
36
|
+
>
|
|
37
|
+
<div class={styles.avatar}>
|
|
38
|
+
<img
|
|
39
|
+
src={icon}
|
|
40
|
+
alt={t("links.iconAlt", { name: title })}
|
|
41
|
+
loading="lazy"
|
|
42
|
+
width="80"
|
|
43
|
+
height="80"
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
<div class={styles.content}>
|
|
47
|
+
<h3 class={styles.title}>{title}</h3>
|
|
48
|
+
{desc && <p class={styles.description}>{desc}</p>}
|
|
49
|
+
</div>
|
|
50
|
+
</a>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
import LinkCard from "@components/stalux/links/linkCard.astro";
|
|
3
|
+
import styles from "@styles/components/links/linkList.module.css";
|
|
4
|
+
import { getCollection } from "astro:content";
|
|
5
|
+
import { getLinksData } from "@utils/config-utils";
|
|
6
|
+
|
|
7
|
+
const configEntries = await getCollection("config");
|
|
8
|
+
const linksConfig = getLinksData(configEntries);
|
|
9
|
+
const links = linksConfig?.sites ?? [];
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<ul class={`${styles.list} stagger-children`}>
|
|
13
|
+
{
|
|
14
|
+
links.map((link) => (
|
|
15
|
+
<li class={styles.item}>
|
|
16
|
+
<LinkCard link={link} />
|
|
17
|
+
</li>
|
|
18
|
+
))
|
|
19
|
+
}
|
|
20
|
+
</ul>
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
// 按需导入图标 — Vite tree-shake 只打包用到的图标
|
|
3
|
+
import {
|
|
4
|
+
siGithub,
|
|
5
|
+
siBilibili,
|
|
6
|
+
siQq,
|
|
7
|
+
siMaildotru,
|
|
8
|
+
siJuejin,
|
|
9
|
+
siX,
|
|
10
|
+
type SimpleIcon,
|
|
11
|
+
} from "simple-icons";
|
|
12
|
+
import { getCollection } from "astro:content";
|
|
13
|
+
import styles from "@styles/components/links/socialLinks.module.css";
|
|
14
|
+
import { getSiteData, getMediaLinksData } from "@utils/config-utils";
|
|
15
|
+
const configEntries = await getCollection("config");
|
|
16
|
+
const siteConfig = getSiteData(configEntries);
|
|
17
|
+
const mediaLinksSection = getMediaLinksData(configEntries);
|
|
18
|
+
const mediaLinks = mediaLinksSection?.items ?? [];
|
|
19
|
+
|
|
20
|
+
const isPostPage = Astro.url.pathname.startsWith("/posts/");
|
|
21
|
+
|
|
22
|
+
// 静态图标映射表:新增图标时只需添加对应的 simple-icons 导入和映射
|
|
23
|
+
const iconMap: Record<string, SimpleIcon> = {
|
|
24
|
+
github: siGithub,
|
|
25
|
+
bilibili: siBilibili,
|
|
26
|
+
qq: siQq,
|
|
27
|
+
maildotru: siMaildotru,
|
|
28
|
+
juejin: siJuejin,
|
|
29
|
+
x: siX,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
function getIconByTitle(iconName: string): SimpleIcon | undefined {
|
|
33
|
+
return iconMap[iconName];
|
|
34
|
+
}
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
<nav class={styles["social-links"]} transition:persist-props aria-label="Social media">
|
|
38
|
+
<ul>
|
|
39
|
+
{
|
|
40
|
+
mediaLinks.map((item) => {
|
|
41
|
+
const icon = item.icon ? getIconByTitle(item.icon) : undefined;
|
|
42
|
+
return (
|
|
43
|
+
<li class="social_icon">
|
|
44
|
+
<a
|
|
45
|
+
href={item.link}
|
|
46
|
+
target="_blank"
|
|
47
|
+
aria-label={item.icon}
|
|
48
|
+
rel="noopener noreferrer"
|
|
49
|
+
title={item.icon}
|
|
50
|
+
class="a-none"
|
|
51
|
+
>
|
|
52
|
+
{icon ? (
|
|
53
|
+
<div class="icon-container">
|
|
54
|
+
<svg
|
|
55
|
+
role="img"
|
|
56
|
+
viewBox="0 0 24 24"
|
|
57
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
58
|
+
width="24"
|
|
59
|
+
height="24"
|
|
60
|
+
fill="currentColor"
|
|
61
|
+
aria-hidden="true"
|
|
62
|
+
>
|
|
63
|
+
<title>{icon.title}</title>
|
|
64
|
+
<path d={icon.path} />
|
|
65
|
+
</svg>
|
|
66
|
+
</div>
|
|
67
|
+
) : (
|
|
68
|
+
<span class="custom-icon">
|
|
69
|
+
{item.icon
|
|
70
|
+
? item.icon.charAt(0).toUpperCase()
|
|
71
|
+
: ""}
|
|
72
|
+
</span>
|
|
73
|
+
)}
|
|
74
|
+
</a>
|
|
75
|
+
</li>
|
|
76
|
+
);
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
</ul>
|
|
80
|
+
</nav>
|
|
81
|
+
|
|
82
|
+
{
|
|
83
|
+
!isPostPage && (
|
|
84
|
+
<script>
|
|
85
|
+
import { animate } from "animejs";
|
|
86
|
+
animate(".social_icon", {
|
|
87
|
+
y: [
|
|
88
|
+
{ to: "-2.75rem", ease: "outExpo", duration: 600 },
|
|
89
|
+
{ to: 0, ease: "outBounce", duration: 800, delay: 100 },
|
|
90
|
+
],
|
|
91
|
+
rotate: {
|
|
92
|
+
from: "-1turn",
|
|
93
|
+
delay: 0,
|
|
94
|
+
},
|
|
95
|
+
delay: (_, i) => i * 50,
|
|
96
|
+
ease: "inOutCirc",
|
|
97
|
+
loopDelay: 1000,
|
|
98
|
+
loop: true,
|
|
99
|
+
});
|
|
100
|
+
</script>
|
|
101
|
+
)
|
|
102
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { fade } from "astro:transitions";
|
|
3
|
+
import style from "@styles/components/posts/postTaxonomy.module.css";
|
|
4
|
+
import { getCollection } from "astro:content";
|
|
5
|
+
import { getSiteData } from "@utils/config-utils";
|
|
6
|
+
import { createTranslator } from "@utils/i18n";
|
|
7
|
+
|
|
8
|
+
type Kind = "tag" | "category";
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
kind: Kind;
|
|
12
|
+
items?: string[];
|
|
13
|
+
title?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const configEntries = await getCollection("config");
|
|
17
|
+
const siteConfig = getSiteData(configEntries);
|
|
18
|
+
const { t } = createTranslator(siteConfig.lang || "zh-CN");
|
|
19
|
+
|
|
20
|
+
const { kind, items = [], title } = Astro.props;
|
|
21
|
+
|
|
22
|
+
// 根据 kind 选择文案、路由前缀与样式类名,
|
|
23
|
+
// 避免 tag / category 两套几乎相同的组件互相复制。
|
|
24
|
+
const cfg = {
|
|
25
|
+
tag: {
|
|
26
|
+
prefix: "/tags/",
|
|
27
|
+
heading: t("taxonomy.tag"),
|
|
28
|
+
empty: t("taxonomy.noTags"),
|
|
29
|
+
containerName: "tags-container",
|
|
30
|
+
contentName: "tags-content",
|
|
31
|
+
listClass: style.listWrap,
|
|
32
|
+
itemClass: style.itemPill,
|
|
33
|
+
},
|
|
34
|
+
category: {
|
|
35
|
+
prefix: "/categories/",
|
|
36
|
+
heading: t("taxonomy.category"),
|
|
37
|
+
empty: t("taxonomy.noCategories"),
|
|
38
|
+
containerName: "categories-container",
|
|
39
|
+
contentName: "categories-content",
|
|
40
|
+
listClass: style.listColumn,
|
|
41
|
+
itemClass: style.itemColumn,
|
|
42
|
+
},
|
|
43
|
+
}[kind];
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
<nav class={style.container} transition:name={cfg.containerName} aria-label={title ?? cfg.heading}>
|
|
47
|
+
{items.length > 0 && <h3 class={style.title}>{title ?? cfg.heading}</h3>}
|
|
48
|
+
{
|
|
49
|
+
items.length > 0 ? (
|
|
50
|
+
<div
|
|
51
|
+
class={cfg.listClass}
|
|
52
|
+
transition:name={cfg.contentName}
|
|
53
|
+
transition:animate={fade({ duration: "0.3s" })}
|
|
54
|
+
>
|
|
55
|
+
{items.map((item) => (
|
|
56
|
+
<a href={`${cfg.prefix}${item}/`} class={`${cfg.itemClass} a-none`} data-astro-prefetch>
|
|
57
|
+
{item}
|
|
58
|
+
</a>
|
|
59
|
+
))}
|
|
60
|
+
</div>
|
|
61
|
+
) : (
|
|
62
|
+
<div class={style.empty}>{cfg.empty}</div>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
</nav>
|