@windcoder/astro-theme-orchid 0.0.0-stage → 0.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/README.md +118 -2
- package/package.json +70 -5
- package/src/components/AlbumCard.astro +73 -0
- package/src/components/Analytics.astro +22 -0
- package/src/components/BaseLayout.astro +188 -0
- package/src/components/Calendar.astro +379 -0
- package/src/components/CategoryBar.astro +74 -0
- package/src/components/Comment.astro +48 -0
- package/src/components/EncryptedContent.astro +42 -0
- package/src/components/Footer.astro +31 -0
- package/src/components/Header.astro +153 -0
- package/src/components/License.astro +29 -0
- package/src/components/Live2DWidget.astro +262 -0
- package/src/components/MusicPlayer.astro +940 -0
- package/src/components/OutdatedCard.astro +53 -0
- package/src/components/Pagination.astro +94 -0
- package/src/components/PhotoCard.astro +22 -0
- package/src/components/PostCard.astro +89 -0
- package/src/components/PostNav.astro +40 -0
- package/src/components/RecommendedPost.astro +166 -0
- package/src/components/SakuraEffect.astro +152 -0
- package/src/components/Sidebar.astro +334 -0
- package/src/components/Toc.astro +27 -0
- package/src/components/analytics/GoogleAnalytics.astro +22 -0
- package/src/components/analytics/La51Analytics.astro +52 -0
- package/src/components/analytics/MicrosoftClarity.astro +18 -0
- package/src/components/analytics/UmamiAnalytics.astro +86 -0
- package/src/components/comments/Artalk.astro +51 -0
- package/src/components/comments/Disqus.astro +43 -0
- package/src/components/comments/Giscus.astro +50 -0
- package/src/components/comments/Twikoo.astro +65 -0
- package/src/components/comments/Waline.astro +36 -0
- package/src/i18n/en.ts +164 -0
- package/src/i18n/index.ts +18 -0
- package/src/i18n/resolve.ts +49 -0
- package/src/i18n/zh-CN.ts +184 -0
- package/src/icons.ts +71 -0
- package/src/index.ts +411 -0
- package/src/plugins/plantuml-encoder.ts +95 -0
- package/src/plugins/rehype-diagram.ts +218 -0
- package/src/plugins/rehype-ec-vt-rerun.ts +80 -0
- package/src/plugins/rehype-email.ts +75 -0
- package/src/plugins/rehype-github-card.ts +114 -0
- package/src/plugins/rehype.ts +284 -0
- package/src/plugins/remark-diagram.ts +78 -0
- package/src/plugins/remark-directives.ts +100 -0
- package/src/plugins/remark-excerpt.ts +29 -0
- package/src/plugins/remark-image-grid.ts +97 -0
- package/src/plugins/remark-reading-time.ts +38 -0
- package/src/plugins/scripts/diagram-panzoom.js +388 -0
- package/src/plugins/scripts/plantuml-theme-switch.js +90 -0
- package/src/routes/404.astro +14 -0
- package/src/routes/_hydrate.ts +34 -0
- package/src/routes/about.astro +25 -0
- package/src/routes/api/allPostMeta.json.ts +26 -0
- package/src/routes/archive.astro +81 -0
- package/src/routes/categories/[category].astro +37 -0
- package/src/routes/categories/index.astro +29 -0
- package/src/routes/friends.astro +83 -0
- package/src/routes/gallery/[album].astro +97 -0
- package/src/routes/gallery/index.astro +100 -0
- package/src/routes/guestbook.astro +37 -0
- package/src/routes/index.astro +47 -0
- package/src/routes/og/[...slug].ts +281 -0
- package/src/routes/page/[page].astro +53 -0
- package/src/routes/posts/[...slug].astro +350 -0
- package/src/routes/robots.txt.ts +18 -0
- package/src/routes/rss.xml.ts +37 -0
- package/src/routes/series/[name].astro +66 -0
- package/src/routes/series/index.astro +64 -0
- package/src/routes/sponsor.astro +84 -0
- package/src/routes/tags/[tag].astro +40 -0
- package/src/routes/tags/index.astro +29 -0
- package/src/schema.ts +1218 -0
- package/src/scripts/app.ts +1041 -0
- package/src/scripts/share-poster.ts +468 -0
- package/src/styles/global.css +4864 -0
- package/src/utils/crypto.ts +46 -0
- package/src/utils/gallery.ts +76 -0
- package/src/utils/lqip.ts +18 -0
- package/src/utils/related.ts +101 -0
- package/src/utils.ts +233 -0
- package/src/vite.ts +105 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
import BaseLayout from "virtual:theme/components/BaseLayout.astro";
|
|
3
|
+
import config from "virtual:theme/config";
|
|
4
|
+
import { t } from "../i18n/index.js";
|
|
5
|
+
|
|
6
|
+
const cfg = config.sponsor;
|
|
7
|
+
const methods = cfg.methods.filter((m) => m.enabled);
|
|
8
|
+
const sponsors = cfg.sponsors;
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<BaseLayout title={cfg.title} page="sponsor">
|
|
12
|
+
<header class="archive-head reveal">
|
|
13
|
+
<h1 class="page-title">{cfg.title}</h1>
|
|
14
|
+
{cfg.description && <p class="page-sub">{cfg.description}</p>}
|
|
15
|
+
</header>
|
|
16
|
+
|
|
17
|
+
{
|
|
18
|
+
cfg.usage && (
|
|
19
|
+
<div class="sponsor-usage card reveal">
|
|
20
|
+
{cfg.usage}
|
|
21
|
+
</div>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
{
|
|
26
|
+
methods.length > 0 && (
|
|
27
|
+
<div class="sponsor-grid reveal">
|
|
28
|
+
{methods.map((m) => (
|
|
29
|
+
<div class="sponsor-method card">
|
|
30
|
+
<div class="sm-name">
|
|
31
|
+
{m.icon && <span class="sm-icon">{m.icon}</span>}
|
|
32
|
+
{m.name}
|
|
33
|
+
</div>
|
|
34
|
+
{m.description && <p class="sm-desc">{m.description}</p>}
|
|
35
|
+
{m.image ? (
|
|
36
|
+
<img class="sponsor-qr" src={m.image} alt={t('qrAlt', { name: m.name })} loading="lazy" />
|
|
37
|
+
) : m.link ? (
|
|
38
|
+
<a class="btn sm-link" href={m.link} target="_blank" rel="noopener">
|
|
39
|
+
{t('goSponsor')}
|
|
40
|
+
</a>
|
|
41
|
+
) : (
|
|
42
|
+
<div class="sponsor-qr sponsor-qr-empty" aria-hidden="true">
|
|
43
|
+
{t('qrPlaceholder')}
|
|
44
|
+
</div>
|
|
45
|
+
)}
|
|
46
|
+
</div>
|
|
47
|
+
))}
|
|
48
|
+
</div>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
{
|
|
53
|
+
cfg.showSponsorsList && (
|
|
54
|
+
<section class="card page-card reveal">
|
|
55
|
+
<h3 class="sponsor-list-title">
|
|
56
|
+
{t('sponsorList')}
|
|
57
|
+
{sponsors.length > 0 && <span class="sl-count">{sponsors.length}</span>}
|
|
58
|
+
</h3>
|
|
59
|
+
{sponsors.length > 0 ? (
|
|
60
|
+
<div class="sponsor-list">
|
|
61
|
+
{sponsors.map((s) => (
|
|
62
|
+
<div class="sponsor-item">
|
|
63
|
+
{s.avatar ? (
|
|
64
|
+
<img class="sponsor-item-avatar" src={s.avatar} alt={s.name} loading="lazy" />
|
|
65
|
+
) : (
|
|
66
|
+
<span class="sponsor-item-avatar avatar-fallback">{s.name.slice(0, 1)}</span>
|
|
67
|
+
)}
|
|
68
|
+
<div class="sponsor-item-info">
|
|
69
|
+
<div class="sponsor-item-name">
|
|
70
|
+
{s.name}
|
|
71
|
+
{s.amount && <b class="sl-amount">{s.amount}</b>}
|
|
72
|
+
</div>
|
|
73
|
+
{s.date && <time class="sponsor-item-date">{s.date}</time>}
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
))}
|
|
77
|
+
</div>
|
|
78
|
+
) : (
|
|
79
|
+
<p class="tag-empty">{t('noSponsors')}</p>
|
|
80
|
+
)}
|
|
81
|
+
</section>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
</BaseLayout>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { getCollection } from "astro:content";
|
|
3
|
+
import BaseLayout from "virtual:theme/components/BaseLayout.astro";
|
|
4
|
+
import { t } from "../../i18n/index.js";
|
|
5
|
+
import { collectTags, formatDate, getSortedPosts } from "../../utils.js";
|
|
6
|
+
|
|
7
|
+
// 先排序再聚合,保证每个标签内文章按新→旧排列
|
|
8
|
+
export async function getStaticPaths() {
|
|
9
|
+
const all = await getCollection("posts", ({ data }) =>
|
|
10
|
+
import.meta.env.PROD ? !data.draft : true,
|
|
11
|
+
);
|
|
12
|
+
const sorted = getSortedPosts(all);
|
|
13
|
+
return [...collectTags(sorted).entries()].map(([tag, posts]) => ({
|
|
14
|
+
params: { tag },
|
|
15
|
+
props: { tag, posts },
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const { tag, posts } = Astro.props;
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
<BaseLayout title={t('tagTitle', { tag })} page="tags">
|
|
23
|
+
<header class="archive-head reveal">
|
|
24
|
+
<h1 class="page-title">{tag}</h1>
|
|
25
|
+
<p class="page-sub">{t('totalPosts', { n: posts.length })}</p>
|
|
26
|
+
</header>
|
|
27
|
+
<div class="tag-list">
|
|
28
|
+
{
|
|
29
|
+
posts.map((post) => (
|
|
30
|
+
<a class="related-card card tag-item reveal" href={`/posts/${post.id}/`}>
|
|
31
|
+
<div class="rc-title">{post.data.title}</div>
|
|
32
|
+
<div class="rc-meta">
|
|
33
|
+
{formatDate(post.data.published)}
|
|
34
|
+
{post.data.category ? ` · ${post.data.category}` : ''}
|
|
35
|
+
</div>
|
|
36
|
+
</a>
|
|
37
|
+
))
|
|
38
|
+
}
|
|
39
|
+
</div>
|
|
40
|
+
</BaseLayout>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { getCollection } from "astro:content";
|
|
3
|
+
import BaseLayout from "virtual:theme/components/BaseLayout.astro";
|
|
4
|
+
import { t } from "../../i18n/index.js";
|
|
5
|
+
import { collectTags, getSortedPosts } from "../../utils.js";
|
|
6
|
+
|
|
7
|
+
// 标签云:标签内文章数 > 1 用大字号(tag-s3),否则小字号(tag-s1)
|
|
8
|
+
const all = await getCollection("posts", ({ data }) =>
|
|
9
|
+
import.meta.env.PROD ? !data.draft : true,
|
|
10
|
+
);
|
|
11
|
+
const tags = [...collectTags(getSortedPosts(all)).entries()];
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<BaseLayout title={t('tags')} page="tags">
|
|
15
|
+
<header class="archive-head reveal">
|
|
16
|
+
<h1 class="page-title">{t('tags')}</h1>
|
|
17
|
+
<p class="page-sub">{t('totalTags', { n: tags.length })}</p>
|
|
18
|
+
</header>
|
|
19
|
+
<div class="tag-cloud card reveal">
|
|
20
|
+
{
|
|
21
|
+
tags.map(([tag, list]) => (
|
|
22
|
+
<a class={list.length > 1 ? 'tag-s3' : 'tag-s1'} href={`/tags/${encodeURIComponent(tag)}/`}>
|
|
23
|
+
{tag}
|
|
24
|
+
<span class="tag-count">{list.length}</span>
|
|
25
|
+
</a>
|
|
26
|
+
))
|
|
27
|
+
}
|
|
28
|
+
</div>
|
|
29
|
+
</BaseLayout>
|