@windcoder/astro-theme-orchid 0.0.0-stage → 0.1.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.
Files changed (82) hide show
  1. package/README.md +311 -2
  2. package/package.json +68 -3
  3. package/src/components/AlbumCard.astro +73 -0
  4. package/src/components/Analytics.astro +22 -0
  5. package/src/components/BaseLayout.astro +188 -0
  6. package/src/components/Calendar.astro +379 -0
  7. package/src/components/CategoryBar.astro +74 -0
  8. package/src/components/Comment.astro +48 -0
  9. package/src/components/EncryptedContent.astro +42 -0
  10. package/src/components/Footer.astro +31 -0
  11. package/src/components/Header.astro +153 -0
  12. package/src/components/License.astro +29 -0
  13. package/src/components/Live2DWidget.astro +262 -0
  14. package/src/components/MusicPlayer.astro +940 -0
  15. package/src/components/OutdatedCard.astro +53 -0
  16. package/src/components/Pagination.astro +94 -0
  17. package/src/components/PhotoCard.astro +22 -0
  18. package/src/components/PostCard.astro +89 -0
  19. package/src/components/PostNav.astro +40 -0
  20. package/src/components/RecommendedPost.astro +166 -0
  21. package/src/components/SakuraEffect.astro +152 -0
  22. package/src/components/Sidebar.astro +334 -0
  23. package/src/components/Toc.astro +27 -0
  24. package/src/components/analytics/GoogleAnalytics.astro +22 -0
  25. package/src/components/analytics/La51Analytics.astro +52 -0
  26. package/src/components/analytics/MicrosoftClarity.astro +18 -0
  27. package/src/components/analytics/UmamiAnalytics.astro +86 -0
  28. package/src/components/comments/Artalk.astro +51 -0
  29. package/src/components/comments/Disqus.astro +43 -0
  30. package/src/components/comments/Giscus.astro +50 -0
  31. package/src/components/comments/Twikoo.astro +65 -0
  32. package/src/components/comments/Waline.astro +36 -0
  33. package/src/i18n/en.ts +164 -0
  34. package/src/i18n/index.ts +18 -0
  35. package/src/i18n/resolve.ts +49 -0
  36. package/src/i18n/zh-CN.ts +184 -0
  37. package/src/icons.ts +71 -0
  38. package/src/index.ts +406 -0
  39. package/src/plugins/plantuml-encoder.ts +95 -0
  40. package/src/plugins/rehype-diagram.ts +218 -0
  41. package/src/plugins/rehype-email.ts +75 -0
  42. package/src/plugins/rehype-github-card.ts +114 -0
  43. package/src/plugins/rehype.ts +284 -0
  44. package/src/plugins/remark-diagram.ts +78 -0
  45. package/src/plugins/remark-directives.ts +100 -0
  46. package/src/plugins/remark-excerpt.ts +29 -0
  47. package/src/plugins/remark-image-grid.ts +97 -0
  48. package/src/plugins/remark-reading-time.ts +38 -0
  49. package/src/plugins/scripts/diagram-panzoom.js +388 -0
  50. package/src/plugins/scripts/plantuml-theme-switch.js +90 -0
  51. package/src/routes/404.astro +14 -0
  52. package/src/routes/_hydrate.ts +34 -0
  53. package/src/routes/about.astro +25 -0
  54. package/src/routes/api/allPostMeta.json.ts +26 -0
  55. package/src/routes/archive.astro +81 -0
  56. package/src/routes/categories/[category].astro +37 -0
  57. package/src/routes/categories/index.astro +29 -0
  58. package/src/routes/friends.astro +83 -0
  59. package/src/routes/gallery/[album].astro +97 -0
  60. package/src/routes/gallery/index.astro +100 -0
  61. package/src/routes/guestbook.astro +37 -0
  62. package/src/routes/index.astro +47 -0
  63. package/src/routes/og/[...slug].ts +281 -0
  64. package/src/routes/page/[page].astro +53 -0
  65. package/src/routes/posts/[...slug].astro +337 -0
  66. package/src/routes/robots.txt.ts +18 -0
  67. package/src/routes/rss.xml.ts +37 -0
  68. package/src/routes/series/[name].astro +63 -0
  69. package/src/routes/series/index.astro +64 -0
  70. package/src/routes/sponsor.astro +84 -0
  71. package/src/routes/tags/[tag].astro +40 -0
  72. package/src/routes/tags/index.astro +29 -0
  73. package/src/schema.ts +1212 -0
  74. package/src/scripts/app.ts +1041 -0
  75. package/src/scripts/share-poster.ts +468 -0
  76. package/src/styles/global.css +4830 -0
  77. package/src/utils/crypto.ts +46 -0
  78. package/src/utils/gallery.ts +76 -0
  79. package/src/utils/lqip.ts +18 -0
  80. package/src/utils/related.ts +101 -0
  81. package/src/utils.ts +181 -0
  82. package/src/vite.ts +105 -0
@@ -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>