@jet-w/astro-blog 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 (140) hide show
  1. package/dist/chunk-FXPGR372.js +0 -0
  2. package/dist/chunk-GYLSY3OJ.js +173 -0
  3. package/dist/config/index.d.ts +166 -0
  4. package/dist/config/index.js +38 -0
  5. package/dist/index.d.ts +34 -0
  6. package/dist/index.js +59 -0
  7. package/dist/types/index.d.ts +75 -0
  8. package/dist/types/index.js +1 -0
  9. package/package.json +84 -0
  10. package/src/components/EChartsCard.vue +118 -0
  11. package/src/components/Mermaid.vue +73 -0
  12. package/src/components/about/ContentCard.astro +27 -0
  13. package/src/components/about/IconCard.astro +77 -0
  14. package/src/components/about/SocialLinks.astro +54 -0
  15. package/src/components/about/TagCard.astro +65 -0
  16. package/src/components/about/TagGroup.astro +33 -0
  17. package/src/components/about/TimelineCard.astro +52 -0
  18. package/src/components/blog/FloatingToc.vue +198 -0
  19. package/src/components/blog/Hero.astro +147 -0
  20. package/src/components/blog/NavigationTabs.vue +245 -0
  21. package/src/components/blog/PostCard.astro +161 -0
  22. package/src/components/blog/PostNavigation.astro +106 -0
  23. package/src/components/blog/RelatedPosts.astro +175 -0
  24. package/src/components/blog/TableOfContents.astro +153 -0
  25. package/src/components/blog/TagCloud.astro +91 -0
  26. package/src/components/home/FeaturedPostsSection.astro +54 -0
  27. package/src/components/home/QuickNavSection.astro +81 -0
  28. package/src/components/home/RecentPostsSection.astro +52 -0
  29. package/src/components/home/StatsSection.astro +44 -0
  30. package/src/components/layout/Footer.astro +103 -0
  31. package/src/components/layout/Header.astro +68 -0
  32. package/src/components/layout/Sidebar.astro +594 -0
  33. package/src/components/media/Bilibili.astro +114 -0
  34. package/src/components/media/Slides.astro +313 -0
  35. package/src/components/media/Video.astro +111 -0
  36. package/src/components/media/VideoPlayer.astro +89 -0
  37. package/src/components/media/YouTube.astro +92 -0
  38. package/src/components/pte/StudyCalendar.vue +1348 -0
  39. package/src/components/ui/Icon.astro +187 -0
  40. package/src/components/ui/MobileMenu.vue +201 -0
  41. package/src/components/ui/Pagination.astro +143 -0
  42. package/src/components/ui/SearchBox.vue +179 -0
  43. package/src/components/ui/SearchInterface.vue +409 -0
  44. package/src/components/ui/SidebarToggle.vue +57 -0
  45. package/src/components/ui/ThemeToggle.vue +90 -0
  46. package/src/layouts/AboutLayout.astro +18 -0
  47. package/src/layouts/BaseLayout.astro +362 -0
  48. package/src/layouts/PageLayout.astro +217 -0
  49. package/src/layouts/SlidesLayout.astro +320 -0
  50. package/src/plugins/rehype-clean-containers.mjs +24 -0
  51. package/src/plugins/rehype-relative-links.mjs +43 -0
  52. package/src/plugins/rehype-tabs.mjs +116 -0
  53. package/src/plugins/remark-containers.mjs +407 -0
  54. package/src/plugins/remark-mermaid.mjs +46 -0
  55. package/src/styles/global.css +870 -0
  56. package/src/styles/slides.css +220 -0
  57. package/src/utils/sidebar.ts +492 -0
  58. package/templates/default/astro.config.mjs +51 -0
  59. package/templates/default/content/pages/about.mdx +93 -0
  60. package/templates/default/content/pages/index.mdx +20 -0
  61. package/templates/default/content/posts/blog_docs/01-quick-start.md +162 -0
  62. package/templates/default/content/posts/blog_docs/02-frontmatter.md +277 -0
  63. package/templates/default/content/posts/blog_docs/03-markdown-basic.md +350 -0
  64. package/templates/default/content/posts/blog_docs/04-containers.md +331 -0
  65. package/templates/default/content/posts/blog_docs/05-code-blocks.md +388 -0
  66. package/templates/default/content/posts/blog_docs/06-mermaid.md +431 -0
  67. package/templates/default/content/posts/blog_docs/07-video.md +243 -0
  68. package/templates/default/content/posts/blog_docs/08-latex.md +382 -0
  69. package/templates/default/content/posts/blog_docs/09-icons.md +326 -0
  70. package/templates/default/content/posts/blog_docs/10-sidebar.md +445 -0
  71. package/templates/default/content/posts/blog_docs/11-config.md +334 -0
  72. package/templates/default/content/posts/blog_docs/12-slides.mdx +552 -0
  73. package/templates/default/content/posts/blog_docs/README.md +151 -0
  74. package/templates/default/content/slides/demo.md +146 -0
  75. package/templates/default/content/slides/docs/basic-demo.md +35 -0
  76. package/templates/default/content/slides/docs/code-demo.md +62 -0
  77. package/templates/default/content/slides/docs/echarts-demo.md +139 -0
  78. package/templates/default/content/slides/docs/fragment-demo.md +35 -0
  79. package/templates/default/content/slides/docs/math-demo.md +48 -0
  80. package/templates/default/content/slides/docs/mermaid-demo.md +105 -0
  81. package/templates/default/content/slides/docs/theme-demo.md +38 -0
  82. package/templates/default/content/slides/docs/vertical-demo.md +50 -0
  83. package/templates/default/package.json +31 -0
  84. package/templates/default/public/favicon-bak.svg +4 -0
  85. package/templates/default/public/images/avatar.jpg +0 -0
  86. package/templates/default/public/images/avatar.svg +142 -0
  87. package/templates/default/public/js/mermaid-container.js +402 -0
  88. package/templates/default/public/js/mermaid-init.js +131 -0
  89. package/templates/default/public/js/mermaid-render.js +98 -0
  90. package/templates/default/public/js/mermaid-simple.js +95 -0
  91. package/templates/default/public/js/tabs-init.js +86 -0
  92. package/templates/default/public/media/individual_portfolio/INDIVIDUAL PORTFOLIO.png +0 -0
  93. package/templates/default/public/slides/plugin/highlight/highlight.js +5 -0
  94. package/templates/default/public/slides/plugin/highlight/monokai.css +71 -0
  95. package/templates/default/public/slides/plugin/markdown/markdown.js +7 -0
  96. package/templates/default/public/slides/plugin/math/math.js +1 -0
  97. package/templates/default/public/slides/plugin/notes/notes.js +1 -0
  98. package/templates/default/public/slides/reveal.css +9 -0
  99. package/templates/default/public/slides/reveal.js +9 -0
  100. package/templates/default/public/slides/theme/beige.css +366 -0
  101. package/templates/default/public/slides/theme/black-contrast.css +362 -0
  102. package/templates/default/public/slides/theme/black.css +359 -0
  103. package/templates/default/public/slides/theme/blood.css +392 -0
  104. package/templates/default/public/slides/theme/dracula.css +385 -0
  105. package/templates/default/public/slides/theme/league.css +368 -0
  106. package/templates/default/public/slides/theme/moon.css +362 -0
  107. package/templates/default/public/slides/theme/night.css +360 -0
  108. package/templates/default/public/slides/theme/serif.css +363 -0
  109. package/templates/default/public/slides/theme/simple.css +362 -0
  110. package/templates/default/public/slides/theme/sky.css +370 -0
  111. package/templates/default/public/slides/theme/solarized.css +363 -0
  112. package/templates/default/public/slides/theme/white-contrast.css +362 -0
  113. package/templates/default/public/slides/theme/white.css +359 -0
  114. package/templates/default/public/slides/theme/white_contrast_compact_verbatim_headers.css +360 -0
  115. package/templates/default/public/test-complete.html +43 -0
  116. package/templates/default/public/test-mermaid.html +124 -0
  117. package/templates/default/src/config/index.ts +114 -0
  118. package/templates/default/src/content.config.ts +96 -0
  119. package/templates/default/src/pages/[...slug].astro +27 -0
  120. package/templates/default/src/pages/archives/[year]/[month]/page/[page].astro +176 -0
  121. package/templates/default/src/pages/archives/[year]/[month].astro +158 -0
  122. package/templates/default/src/pages/archives/index.astro +210 -0
  123. package/templates/default/src/pages/categories/[category]/page/[page].astro +218 -0
  124. package/templates/default/src/pages/categories/[category].astro +198 -0
  125. package/templates/default/src/pages/categories/index.astro +190 -0
  126. package/templates/default/src/pages/container-test.astro +79 -0
  127. package/templates/default/src/pages/mermaid-direct.html +78 -0
  128. package/templates/default/src/pages/posts/[...slug].astro +335 -0
  129. package/templates/default/src/pages/posts/index.astro +541 -0
  130. package/templates/default/src/pages/posts/page/[page].astro +146 -0
  131. package/templates/default/src/pages/rss.xml.ts +28 -0
  132. package/templates/default/src/pages/search-index.json.ts +21 -0
  133. package/templates/default/src/pages/search.astro +50 -0
  134. package/templates/default/src/pages/slides/[...slug].astro +54 -0
  135. package/templates/default/src/pages/slides/index.astro +135 -0
  136. package/templates/default/src/pages/tags/[tag]/page/[page].astro +211 -0
  137. package/templates/default/src/pages/tags/[tag].astro +191 -0
  138. package/templates/default/src/pages/tags/index.astro +167 -0
  139. package/templates/default/tailwind.config.mjs +78 -0
  140. package/templates/default/tsconfig.json +9 -0
File without changes
@@ -0,0 +1,173 @@
1
+ // src/config/site.ts
2
+ var siteConfig = {
3
+ title: "My Astro Blog",
4
+ description: "A modern blog built with Astro, Vue, and Tailwind CSS",
5
+ author: "Author",
6
+ email: "",
7
+ avatar: "/images/avatar.svg",
8
+ social: {
9
+ github: "",
10
+ twitter: "",
11
+ linkedin: "",
12
+ email: ""
13
+ },
14
+ menu: [
15
+ {
16
+ name: "\u9996\u9875",
17
+ href: "/",
18
+ icon: "home"
19
+ },
20
+ {
21
+ name: "\u535A\u5BA2",
22
+ href: "/posts",
23
+ icon: "posts"
24
+ },
25
+ {
26
+ name: "\u5173\u4E8E",
27
+ href: "/about",
28
+ icon: "about"
29
+ }
30
+ ]
31
+ };
32
+ var defaultSEO = {
33
+ title: siteConfig.title,
34
+ description: siteConfig.description,
35
+ image: "/images/og-image.jpg",
36
+ type: "website"
37
+ };
38
+ function defineSiteConfig(config) {
39
+ return {
40
+ ...siteConfig,
41
+ ...config,
42
+ social: {
43
+ ...siteConfig.social,
44
+ ...config.social
45
+ },
46
+ menu: config.menu || siteConfig.menu
47
+ };
48
+ }
49
+ var defaultSiteConfig = siteConfig;
50
+
51
+ // src/config/menu.ts
52
+ var menu = [
53
+ {
54
+ name: "\u9996\u9875",
55
+ href: "/",
56
+ icon: "home"
57
+ },
58
+ {
59
+ name: "\u535A\u5BA2",
60
+ href: "/posts",
61
+ icon: "posts"
62
+ },
63
+ {
64
+ name: "\u5173\u4E8E",
65
+ href: "/about",
66
+ icon: "about"
67
+ }
68
+ ];
69
+ function defineMenu(items) {
70
+ return items;
71
+ }
72
+ var defaultMenu = menu;
73
+
74
+ // src/config/sidebar.ts
75
+ var sidebarConfig = {
76
+ enabled: true,
77
+ width: "280px",
78
+ position: "right",
79
+ showSearch: true,
80
+ showRecentPosts: true,
81
+ recentPostsCount: 5,
82
+ showPopularTags: true,
83
+ popularTagsCount: 8,
84
+ showArchives: true,
85
+ archivesCount: 6,
86
+ showFriendLinks: true,
87
+ friendLinks: [
88
+ { title: "Astro \u5B98\u7F51", url: "https://astro.build" },
89
+ { title: "Tailwind CSS", url: "https://tailwindcss.com" },
90
+ { title: "Vue.js", url: "https://vuejs.org" }
91
+ ],
92
+ groups: [
93
+ {
94
+ type: "scan",
95
+ title: "\u6587\u6863\u76EE\u5F55",
96
+ icon: "folder",
97
+ scanPath: "",
98
+ collapsed: false
99
+ }
100
+ ]
101
+ };
102
+ function defineSidebarConfig(config) {
103
+ return {
104
+ ...sidebarConfig,
105
+ ...config,
106
+ groups: config.groups || sidebarConfig.groups
107
+ };
108
+ }
109
+ var defaultSidebarConfig = sidebarConfig;
110
+
111
+ // src/config/social.ts
112
+ var defaultIcons = {
113
+ github: "M12 0C5.374 0 0 5.373 0 12c0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23A11.509 11.509 0 0112 5.803c1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576C20.566 21.797 24 17.3 24 12c0-6.627-5.373-12-12-12z",
114
+ twitter: "M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085 4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z",
115
+ linkedin: "M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z",
116
+ email: "M3 8l7.89 4.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",
117
+ youtube: "M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z",
118
+ discord: "M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189z"
119
+ };
120
+ var socialLinks = [];
121
+ var defaultSocialLinks = socialLinks;
122
+ function defineSocialLinks(links) {
123
+ return links;
124
+ }
125
+
126
+ // src/config/footer.ts
127
+ var footerConfig = {
128
+ quickLinksTitle: "\u5FEB\u901F\u94FE\u63A5",
129
+ quickLinks: [
130
+ { name: "\u9996\u9875", href: "/" },
131
+ { name: "\u6587\u7AE0", href: "/posts" },
132
+ { name: "\u6807\u7B7E", href: "/tags" },
133
+ { name: "\u5206\u7C7B", href: "/categories" },
134
+ { name: "\u5F52\u6863", href: "/archives" },
135
+ { name: "\u5173\u4E8E", href: "/about" }
136
+ ],
137
+ contactTitle: "\u8054\u7CFB\u65B9\u5F0F",
138
+ socialLinks: [],
139
+ showRss: true,
140
+ rssUrl: "/rss.xml",
141
+ copyright: "\xA9 {year} {author}. All rights reserved.",
142
+ poweredBy: {
143
+ text: "Astro",
144
+ url: "https://astro.build"
145
+ }
146
+ };
147
+ function defineFooterConfig(config) {
148
+ return {
149
+ ...footerConfig,
150
+ ...config
151
+ };
152
+ }
153
+ var defaultFooterConfig = footerConfig;
154
+
155
+ export {
156
+ siteConfig,
157
+ defaultSEO,
158
+ defineSiteConfig,
159
+ defaultSiteConfig,
160
+ menu,
161
+ defineMenu,
162
+ defaultMenu,
163
+ sidebarConfig,
164
+ defineSidebarConfig,
165
+ defaultSidebarConfig,
166
+ defaultIcons,
167
+ socialLinks,
168
+ defaultSocialLinks,
169
+ defineSocialLinks,
170
+ footerConfig,
171
+ defineFooterConfig,
172
+ defaultFooterConfig
173
+ };
@@ -0,0 +1,166 @@
1
+ import { SiteConfig, NavigationItem } from '../types/index.js';
2
+
3
+ /**
4
+ * Default site configuration
5
+ * Users should override this in their own config
6
+ */
7
+ declare const siteConfig: SiteConfig;
8
+ declare const defaultSEO: {
9
+ title: string;
10
+ description: string;
11
+ image: string;
12
+ type: "website";
13
+ };
14
+ /**
15
+ * Create site config with user overrides
16
+ */
17
+ declare function defineSiteConfig(config: Partial<SiteConfig>): SiteConfig;
18
+ declare const defaultSiteConfig: SiteConfig;
19
+
20
+ /**
21
+ * Default menu configuration
22
+ */
23
+ declare const menu: NavigationItem[];
24
+ /**
25
+ * Define custom menu items
26
+ */
27
+ declare function defineMenu(items: NavigationItem[]): NavigationItem[];
28
+ declare const defaultMenu: NavigationItem[];
29
+
30
+ /**
31
+ * 侧边栏配置系统
32
+ *
33
+ * 支持三种配置类型:
34
+ * 1. scan - 扫描指定文件夹,自动生成树形结构
35
+ * 2. manual - 手动配置显示特定内容
36
+ * 3. mixed - 混合使用以上两种方式
37
+ */
38
+ interface PathMatchConfig {
39
+ pattern: string;
40
+ exact?: boolean;
41
+ }
42
+ interface SidebarItem {
43
+ title: string;
44
+ slug?: string;
45
+ link?: string;
46
+ icon?: string;
47
+ badge?: string;
48
+ badgeType?: 'info' | 'success' | 'warning' | 'error';
49
+ children?: SidebarItem[];
50
+ collapsed?: boolean;
51
+ }
52
+ interface ScanConfig {
53
+ type: 'scan';
54
+ title: string;
55
+ icon?: string;
56
+ scanPath: string;
57
+ collapsed?: boolean;
58
+ maxDepth?: number;
59
+ exclude?: string[];
60
+ include?: string[];
61
+ sortBy?: 'name' | 'date' | 'title' | 'custom';
62
+ sortOrder?: 'asc' | 'desc';
63
+ showForPaths?: string[];
64
+ hideForPaths?: string[];
65
+ }
66
+ interface ManualConfig {
67
+ type: 'manual';
68
+ title: string;
69
+ icon?: string;
70
+ collapsed?: boolean;
71
+ items: SidebarItem[];
72
+ showForPaths?: string[];
73
+ hideForPaths?: string[];
74
+ }
75
+ interface MixedConfig {
76
+ type: 'mixed';
77
+ title: string;
78
+ icon?: string;
79
+ collapsed?: boolean;
80
+ sections: (ScanConfig | ManualConfig)[];
81
+ showForPaths?: string[];
82
+ hideForPaths?: string[];
83
+ }
84
+ interface DividerConfig {
85
+ type: 'divider';
86
+ title?: string;
87
+ showForPaths?: string[];
88
+ hideForPaths?: string[];
89
+ }
90
+ type SidebarGroup = ScanConfig | ManualConfig | MixedConfig | DividerConfig;
91
+ interface SidebarConfig {
92
+ enabled: boolean;
93
+ width?: string;
94
+ position?: 'left' | 'right';
95
+ showSearch?: boolean;
96
+ showRecentPosts?: boolean;
97
+ recentPostsCount?: number;
98
+ showPopularTags?: boolean;
99
+ popularTagsCount?: number;
100
+ showArchives?: boolean;
101
+ archivesCount?: number;
102
+ showFriendLinks?: boolean;
103
+ friendLinks?: Array<{
104
+ title: string;
105
+ url: string;
106
+ icon?: string;
107
+ description?: string;
108
+ }>;
109
+ groups: SidebarGroup[];
110
+ }
111
+ /**
112
+ * 默认侧边栏配置
113
+ */
114
+ declare const sidebarConfig: SidebarConfig;
115
+ /**
116
+ * Define sidebar configuration
117
+ */
118
+ declare function defineSidebarConfig(config: Partial<SidebarConfig>): SidebarConfig;
119
+ declare const defaultSidebarConfig: SidebarConfig;
120
+
121
+ /**
122
+ * 社交链接配置
123
+ */
124
+ interface SocialLink {
125
+ type: string;
126
+ url: string;
127
+ label?: string;
128
+ icon?: string;
129
+ }
130
+ declare const defaultIcons: Record<string, string>;
131
+ declare const socialLinks: SocialLink[];
132
+ declare const defaultSocialLinks: SocialLink[];
133
+ /**
134
+ * Define social links
135
+ */
136
+ declare function defineSocialLinks(links: SocialLink[]): SocialLink[];
137
+
138
+ /**
139
+ * Footer 配置
140
+ */
141
+
142
+ interface FooterLink {
143
+ name: string;
144
+ href: string;
145
+ }
146
+ interface FooterConfig {
147
+ quickLinksTitle: string;
148
+ quickLinks: FooterLink[];
149
+ contactTitle: string;
150
+ socialLinks: SocialLink[];
151
+ showRss: boolean;
152
+ rssUrl: string;
153
+ copyright: string;
154
+ poweredBy: {
155
+ text: string;
156
+ url: string;
157
+ };
158
+ }
159
+ declare const footerConfig: FooterConfig;
160
+ /**
161
+ * Define footer configuration
162
+ */
163
+ declare function defineFooterConfig(config: Partial<FooterConfig>): FooterConfig;
164
+ declare const defaultFooterConfig: FooterConfig;
165
+
166
+ export { type DividerConfig, type FooterConfig, type FooterLink, type ManualConfig, type MixedConfig, type PathMatchConfig, type ScanConfig, type SidebarConfig, type SidebarGroup, type SidebarItem, type SocialLink, defaultFooterConfig, defaultIcons, defaultMenu, defaultSEO, defaultSidebarConfig, defaultSiteConfig, defaultSocialLinks, defineFooterConfig, defineMenu, defineSidebarConfig, defineSiteConfig, defineSocialLinks, footerConfig, menu, sidebarConfig, siteConfig, socialLinks };
@@ -0,0 +1,38 @@
1
+ import {
2
+ defaultFooterConfig,
3
+ defaultIcons,
4
+ defaultMenu,
5
+ defaultSEO,
6
+ defaultSidebarConfig,
7
+ defaultSiteConfig,
8
+ defaultSocialLinks,
9
+ defineFooterConfig,
10
+ defineMenu,
11
+ defineSidebarConfig,
12
+ defineSiteConfig,
13
+ defineSocialLinks,
14
+ footerConfig,
15
+ menu,
16
+ sidebarConfig,
17
+ siteConfig,
18
+ socialLinks
19
+ } from "../chunk-GYLSY3OJ.js";
20
+ export {
21
+ defaultFooterConfig,
22
+ defaultIcons,
23
+ defaultMenu,
24
+ defaultSEO,
25
+ defaultSidebarConfig,
26
+ defaultSiteConfig,
27
+ defaultSocialLinks,
28
+ defineFooterConfig,
29
+ defineMenu,
30
+ defineSidebarConfig,
31
+ defineSiteConfig,
32
+ defineSocialLinks,
33
+ footerConfig,
34
+ menu,
35
+ sidebarConfig,
36
+ siteConfig,
37
+ socialLinks
38
+ };
@@ -0,0 +1,34 @@
1
+ import { SidebarConfig, FooterConfig, SocialLink } from './config/index.js';
2
+ export { DividerConfig, FooterLink, ManualConfig, MixedConfig, PathMatchConfig, ScanConfig, SidebarGroup, SidebarItem, defaultFooterConfig, defaultIcons, defaultMenu, defaultSEO, defaultSidebarConfig, defaultSiteConfig, defaultSocialLinks, defineFooterConfig, defineMenu, defineSidebarConfig, defineSiteConfig, defineSocialLinks, footerConfig, menu, sidebarConfig, siteConfig, socialLinks } from './config/index.js';
3
+ import { SiteConfig } from './types/index.js';
4
+ export { BlogPost, Category, NavigationItem, PostFrontmatter, SEOProps, SearchResult, Tag } from './types/index.js';
5
+
6
+ /**
7
+ * Define blog configuration helper
8
+ */
9
+ interface BlogConfig {
10
+ site: SiteConfig;
11
+ sidebar?: SidebarConfig;
12
+ footer?: FooterConfig;
13
+ social?: SocialLink[];
14
+ }
15
+ declare function defineBlogConfig(config: BlogConfig): BlogConfig;
16
+ /**
17
+ * Get Astro config with jet-w.astro-blog integrations
18
+ */
19
+ declare function getAstroConfig(options?: {
20
+ remarkPlugins?: any[];
21
+ rehypePlugins?: any[];
22
+ }): {
23
+ markdown: {
24
+ remarkPlugins: any[];
25
+ rehypePlugins: any[];
26
+ shikiConfig: {
27
+ theme: string;
28
+ langs: never[];
29
+ wrap: boolean;
30
+ };
31
+ };
32
+ };
33
+
34
+ export { type BlogConfig, FooterConfig, SidebarConfig, SiteConfig, SocialLink, defineBlogConfig, getAstroConfig };
package/dist/index.js ADDED
@@ -0,0 +1,59 @@
1
+ import {
2
+ defaultFooterConfig,
3
+ defaultIcons,
4
+ defaultMenu,
5
+ defaultSEO,
6
+ defaultSidebarConfig,
7
+ defaultSiteConfig,
8
+ defaultSocialLinks,
9
+ defineFooterConfig,
10
+ defineMenu,
11
+ defineSidebarConfig,
12
+ defineSiteConfig,
13
+ defineSocialLinks,
14
+ footerConfig,
15
+ menu,
16
+ sidebarConfig,
17
+ siteConfig,
18
+ socialLinks
19
+ } from "./chunk-GYLSY3OJ.js";
20
+ import "./chunk-FXPGR372.js";
21
+
22
+ // src/index.ts
23
+ function defineBlogConfig(config) {
24
+ return config;
25
+ }
26
+ function getAstroConfig(options) {
27
+ return {
28
+ markdown: {
29
+ remarkPlugins: options?.remarkPlugins || [],
30
+ rehypePlugins: options?.rehypePlugins || [],
31
+ shikiConfig: {
32
+ theme: "github-dark",
33
+ langs: [],
34
+ wrap: true
35
+ }
36
+ }
37
+ };
38
+ }
39
+ export {
40
+ defaultFooterConfig,
41
+ defaultIcons,
42
+ defaultMenu,
43
+ defaultSEO,
44
+ defaultSidebarConfig,
45
+ defaultSiteConfig,
46
+ defaultSocialLinks,
47
+ defineBlogConfig,
48
+ defineFooterConfig,
49
+ defineMenu,
50
+ defineSidebarConfig,
51
+ defineSiteConfig,
52
+ defineSocialLinks,
53
+ footerConfig,
54
+ getAstroConfig,
55
+ menu,
56
+ sidebarConfig,
57
+ siteConfig,
58
+ socialLinks
59
+ };
@@ -0,0 +1,75 @@
1
+ interface BlogPost {
2
+ slug: string;
3
+ title: string;
4
+ description: string;
5
+ content: string;
6
+ pubDate: Date;
7
+ updatedDate?: Date;
8
+ tags: string[];
9
+ categories: string[];
10
+ author?: string;
11
+ image?: string;
12
+ draft?: boolean;
13
+ readingTime?: number;
14
+ }
15
+ interface PostFrontmatter {
16
+ title: string;
17
+ description: string;
18
+ pubDate: string;
19
+ updatedDate?: string;
20
+ tags?: string[];
21
+ categories?: string[];
22
+ author?: string;
23
+ image?: string;
24
+ draft?: boolean;
25
+ }
26
+ interface Tag {
27
+ name: string;
28
+ count: number;
29
+ slug: string;
30
+ }
31
+ interface Category {
32
+ name: string;
33
+ count: number;
34
+ slug: string;
35
+ }
36
+ interface SearchResult {
37
+ title: string;
38
+ description: string;
39
+ url: string;
40
+ content: string;
41
+ tags: string[];
42
+ categories: string[];
43
+ }
44
+ interface NavigationItem {
45
+ name: string;
46
+ href: string;
47
+ icon?: string;
48
+ children?: NavigationItem[];
49
+ }
50
+ interface SiteConfig {
51
+ title: string;
52
+ description: string;
53
+ author: string;
54
+ email?: string;
55
+ avatar?: string;
56
+ social?: {
57
+ github?: string;
58
+ twitter?: string;
59
+ linkedin?: string;
60
+ email?: string;
61
+ };
62
+ menu: NavigationItem[];
63
+ }
64
+ interface SEOProps {
65
+ title?: string;
66
+ description?: string;
67
+ image?: string;
68
+ url?: string;
69
+ type?: 'website' | 'article';
70
+ publishedTime?: string;
71
+ modifiedTime?: string;
72
+ tags?: string[];
73
+ }
74
+
75
+ export type { BlogPost, Category, NavigationItem, PostFrontmatter, SEOProps, SearchResult, SiteConfig, Tag };
@@ -0,0 +1 @@
1
+ import "../chunk-FXPGR372.js";
package/package.json ADDED
@@ -0,0 +1,84 @@
1
+ {
2
+ "name": "@jet-w/astro-blog",
3
+ "version": "0.1.0",
4
+ "description": "A modern Astro blog theme with Vue and Tailwind CSS support",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./dist/index.js"
10
+ },
11
+ "./config": {
12
+ "types": "./dist/config/index.d.ts",
13
+ "import": "./dist/config/index.js"
14
+ },
15
+ "./types": {
16
+ "types": "./dist/types/index.d.ts",
17
+ "import": "./dist/types/index.js"
18
+ },
19
+ "./plugins/*": "./src/plugins/*",
20
+ "./styles/*": "./src/styles/*",
21
+ "./components/*": "./src/components/*",
22
+ "./layouts/*": "./src/layouts/*",
23
+ "./utils/*": "./src/utils/*"
24
+ },
25
+ "files": [
26
+ "dist",
27
+ "src/plugins",
28
+ "src/styles",
29
+ "src/components",
30
+ "src/layouts",
31
+ "src/utils",
32
+ "templates"
33
+ ],
34
+ "scripts": {
35
+ "build": "tsup",
36
+ "dev": "tsup --watch",
37
+ "prepublishOnly": "npm run build"
38
+ },
39
+ "keywords": [
40
+ "astro",
41
+ "astro-theme",
42
+ "blog",
43
+ "vue",
44
+ "tailwindcss",
45
+ "markdown",
46
+ "mdx"
47
+ ],
48
+ "author": "Haiyue",
49
+ "license": "MIT",
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "https://github.com/jet-w/astro-blog"
53
+ },
54
+ "homepage": "https://github.com/jet-w/astro-blog#readme",
55
+ "bugs": {
56
+ "url": "https://github.com/jet-w/astro-blog/issues"
57
+ },
58
+ "peerDependencies": {
59
+ "astro": "^5.0.0",
60
+ "@astrojs/mdx": "^4.0.0",
61
+ "@astrojs/tailwind": "^5.0.0",
62
+ "@astrojs/vue": "^5.0.0",
63
+ "tailwindcss": "^3.4.0",
64
+ "vue": "^3.5.0"
65
+ },
66
+ "dependencies": {
67
+ "@tailwindcss/typography": "^0.5.15",
68
+ "fuse.js": "^7.0.0",
69
+ "gray-matter": "^4.0.3",
70
+ "marked": "^15.0.2",
71
+ "prismjs": "^1.29.0",
72
+ "rehype-katex": "^7.0.1",
73
+ "rehype-raw": "^7.0.0",
74
+ "remark-directive": "^4.0.0",
75
+ "remark-math": "^6.0.0",
76
+ "unist-util-visit": "^5.0.0"
77
+ },
78
+ "devDependencies": {
79
+ "@types/node": "^20.0.0",
80
+ "@types/prismjs": "^1.26.4",
81
+ "tsup": "^8.0.0",
82
+ "typescript": "^5.7.0"
83
+ }
84
+ }