@jet-w/astro-blog 0.1.6 → 0.2.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 (122) hide show
  1. package/dist/chunk-6D3XRDNY.js +145 -0
  2. package/dist/chunk-A2E2VSAQ.js +246 -0
  3. package/dist/{chunk-GYLSY3OJ.js → chunk-TJTPX2WP.js} +1 -1
  4. package/dist/config/index.d.ts +3 -47
  5. package/dist/config/index.js +18 -2
  6. package/dist/i18n-PgMCFBw0.d.ts +222 -0
  7. package/dist/index.d.ts +204 -7
  8. package/dist/index.js +255 -3
  9. package/dist/integration.d.ts +9 -1
  10. package/dist/integration.js +2 -1
  11. package/dist/{sidebar-DNdiCKBw.d.ts → sidebar-Da-W_4Lr.d.ts} +1 -1
  12. package/dist/utils/sidebar.d.ts +1 -1
  13. package/package.json +1 -1
  14. package/src/components/blog/FloatingToc.vue +11 -3
  15. package/src/components/blog/Hero.astro +17 -2
  16. package/src/components/blog/NavigationTabs.vue +46 -15
  17. package/src/components/blog/PostCard.astro +28 -10
  18. package/src/components/blog/RelatedPosts.astro +23 -7
  19. package/src/components/blog/TableOfContents.astro +10 -4
  20. package/src/components/blog/TagCloud.astro +4 -3
  21. package/src/components/home/FeaturedPostsSection.astro +22 -6
  22. package/src/components/home/QuickNavSection.astro +33 -4
  23. package/src/components/home/RecentPostsSection.astro +22 -6
  24. package/src/components/home/StatsSection.astro +24 -6
  25. package/src/components/layout/Footer.astro +36 -20
  26. package/src/components/layout/Header.astro +75 -17
  27. package/src/components/layout/Sidebar.astro +40 -25
  28. package/src/components/ui/LanguageSwitcher.vue +183 -0
  29. package/src/components/ui/SearchBox.vue +13 -5
  30. package/src/components/ui/SearchInterface.vue +49 -25
  31. package/src/layouts/BaseLayout.astro +77 -52
  32. package/src/layouts/PageLayout.astro +22 -27
  33. package/src/layouts/SlidesLayout.astro +14 -2
  34. package/src/pages/archives/[year]/[month].astro +36 -17
  35. package/src/pages/archives/index.astro +36 -20
  36. package/src/pages/categories/[category].astro +33 -16
  37. package/src/pages/categories/index.astro +37 -14
  38. package/src/pages/posts/[...slug].astro +125 -18
  39. package/src/pages/posts/index.astro +59 -37
  40. package/src/pages/posts/page/[page].astro +65 -27
  41. package/src/pages/rss.xml.ts +18 -6
  42. package/src/pages/search.astro +50 -14
  43. package/src/pages/slides/index.astro +25 -6
  44. package/src/pages/tags/[tag].astro +32 -15
  45. package/src/pages/tags/index.astro +39 -16
  46. package/src/plugins/remark-containers.mjs +351 -322
  47. package/src/plugins/remark-protect-code.mjs +69 -0
  48. package/src/styles/global.css +35 -1
  49. package/templates/default/.claude/ralph-loop.local.md +48 -0
  50. package/templates/default/astro.config.mjs +33 -4
  51. package/templates/default/content/posts/blog_docs_en/01.get-started/01-intro.md +81 -0
  52. package/templates/default/content/posts/blog_docs_en/01.get-started/02-install.md +137 -0
  53. package/templates/default/content/posts/blog_docs_en/01.get-started/03-create-post.md +176 -0
  54. package/templates/default/content/posts/blog_docs_en/01.get-started/04-structure.md +173 -0
  55. package/templates/default/content/posts/blog_docs_en/01.get-started/05-deploy.md +208 -0
  56. package/templates/default/content/posts/blog_docs_en/01.get-started/README.md +52 -0
  57. package/templates/default/content/posts/blog_docs_en/02.guide/02-containers.md +245 -0
  58. package/templates/default/content/posts/blog_docs_en/02.guide/03-code-blocks.md +207 -0
  59. package/templates/default/content/posts/blog_docs_en/02.guide/03-mermaid.md +194 -0
  60. package/templates/default/content/posts/blog_docs_en/02.guide/04-icons.md +229 -0
  61. package/templates/default/content/posts/blog_docs_en/02.guide/06-latex.md +233 -0
  62. package/templates/default/content/posts/blog_docs_en/02.guide/07-video.md +184 -0
  63. package/templates/default/content/posts/blog_docs_en/02.guide/08-slides.md +359 -0
  64. package/templates/default/content/posts/blog_docs_en/02.guide/README.md +213 -0
  65. package/templates/default/content/posts/blog_docs_en/03.config/01-site.md +208 -0
  66. package/templates/default/content/posts/blog_docs_en/03.config/02-sidebar.md +240 -0
  67. package/templates/default/content/posts/blog_docs_en/03.config/03-i18n.md +349 -0
  68. package/templates/default/content/posts/blog_docs_en/03.config/README.md +85 -0
  69. package/templates/default/content/posts/blog_docs_en/README.md +79 -0
  70. package/templates/default/content/posts/blog_docs_zh/01.get-started/01-intro.md +81 -0
  71. package/templates/default/content/posts/blog_docs_zh/01.get-started/02-install.md +137 -0
  72. package/templates/default/content/posts/blog_docs_zh/01.get-started/03-create-post.md +176 -0
  73. package/templates/default/content/posts/blog_docs_zh/01.get-started/04-structure.md +173 -0
  74. package/templates/default/content/posts/blog_docs_zh/01.get-started/05-deploy.md +208 -0
  75. package/templates/default/content/posts/blog_docs_zh/01.get-started/README.md +52 -0
  76. package/templates/default/content/posts/blog_docs_zh/02.guide/02-containers.md +245 -0
  77. package/templates/default/content/posts/blog_docs_zh/02.guide/03-code-blocks.md +206 -0
  78. package/templates/default/content/posts/blog_docs_zh/02.guide/03-mermaid.md +194 -0
  79. package/templates/default/content/posts/blog_docs_zh/02.guide/04-icons.md +229 -0
  80. package/templates/default/content/posts/blog_docs_zh/02.guide/06-latex.md +233 -0
  81. package/templates/default/content/posts/blog_docs_zh/02.guide/07-video.md +184 -0
  82. package/templates/default/content/posts/blog_docs_zh/02.guide/08-slides.md +359 -0
  83. package/templates/default/content/posts/blog_docs_zh/02.guide/README.md +213 -0
  84. package/templates/default/content/posts/blog_docs_zh/03.config/01-site.md +208 -0
  85. package/templates/default/content/posts/blog_docs_zh/03.config/02-sidebar.md +240 -0
  86. package/templates/default/content/posts/blog_docs_zh/03.config/03-i18n.md +348 -0
  87. package/templates/default/content/posts/blog_docs_zh/03.config/README.md +85 -0
  88. package/templates/default/content/posts/blog_docs_zh/README.md +78 -0
  89. package/templates/default/package-lock.json +9667 -0
  90. package/templates/default/package.json +1 -1
  91. package/templates/default/src/config/footer.ts +14 -11
  92. package/templates/default/src/config/locales/en/footer.ts +17 -0
  93. package/templates/default/src/config/locales/en/index.ts +20 -0
  94. package/templates/default/src/config/locales/en/menu.ts +14 -0
  95. package/templates/default/src/config/locales/en/sidebar.ts +34 -0
  96. package/templates/default/src/config/locales/en/site.ts +7 -0
  97. package/templates/default/src/config/locales/en/ui.ts +29 -0
  98. package/templates/default/src/config/locales/index.ts +7 -0
  99. package/templates/default/src/config/locales/zh-CN/footer.ts +17 -0
  100. package/templates/default/src/config/locales/zh-CN/index.ts +20 -0
  101. package/templates/default/src/config/locales/zh-CN/menu.ts +14 -0
  102. package/templates/default/src/config/locales/zh-CN/sidebar.ts +34 -0
  103. package/templates/default/src/config/locales/zh-CN/site.ts +7 -0
  104. package/templates/default/src/config/locales/zh-CN/ui.ts +29 -0
  105. package/templates/default/src/config/sidebar.ts +10 -12
  106. package/templates/default/src/config/site.ts +2 -2
  107. package/templates/default/src/content.config.ts +15 -3
  108. package/templates/default/src/env.d.ts +7 -0
  109. package/dist/chunk-MQXPSOYB.js +0 -124
  110. package/templates/default/content/posts/blog_docs/01-quick-start.md +0 -162
  111. package/templates/default/content/posts/blog_docs/02-frontmatter.md +0 -277
  112. package/templates/default/content/posts/blog_docs/03-markdown-basic.md +0 -350
  113. package/templates/default/content/posts/blog_docs/04-containers.md +0 -331
  114. package/templates/default/content/posts/blog_docs/05-code-blocks.md +0 -388
  115. package/templates/default/content/posts/blog_docs/06-mermaid.md +0 -431
  116. package/templates/default/content/posts/blog_docs/07-video.md +0 -243
  117. package/templates/default/content/posts/blog_docs/08-latex.md +0 -382
  118. package/templates/default/content/posts/blog_docs/09-icons.md +0 -326
  119. package/templates/default/content/posts/blog_docs/10-sidebar.md +0 -445
  120. package/templates/default/content/posts/blog_docs/11-config.md +0 -334
  121. package/templates/default/content/posts/blog_docs/12-slides.mdx +0 -552
  122. package/templates/default/content/posts/blog_docs/README.md +0 -151
@@ -0,0 +1,145 @@
1
+ import {
2
+ defaultI18nConfig
3
+ } from "./chunk-A2E2VSAQ.js";
4
+
5
+ // src/integration.ts
6
+ import { fileURLToPath } from "url";
7
+ import path from "path";
8
+ var VIRTUAL_I18N_MODULE_ID = "virtual:astro-blog-i18n";
9
+ var RESOLVED_VIRTUAL_I18N_MODULE_ID = "\0" + VIRTUAL_I18N_MODULE_ID;
10
+ var defaultOptions = {
11
+ routes: {
12
+ posts: true,
13
+ tags: true,
14
+ categories: true,
15
+ archives: true,
16
+ slides: true,
17
+ search: true,
18
+ rss: true
19
+ }
20
+ };
21
+ function getLocalePrefix(locale, i18nConfig) {
22
+ if (locale === i18nConfig.defaultLocale && !i18nConfig.routing.prefixDefaultLocale) {
23
+ return "";
24
+ }
25
+ return `/${locale}`;
26
+ }
27
+ function astroBlogIntegration(options = {}) {
28
+ const mergedOptions = {
29
+ ...defaultOptions,
30
+ routes: { ...defaultOptions.routes, ...options.routes }
31
+ };
32
+ const i18nConfig = options.i18n || defaultI18nConfig;
33
+ const currentDir = path.dirname(fileURLToPath(import.meta.url));
34
+ const pagesDir = path.resolve(currentDir, "../src/pages");
35
+ const vitePluginI18nConfig = () => ({
36
+ name: "astro-blog-i18n-config",
37
+ resolveId(id) {
38
+ if (id === VIRTUAL_I18N_MODULE_ID) {
39
+ return RESOLVED_VIRTUAL_I18N_MODULE_ID;
40
+ }
41
+ },
42
+ load(id) {
43
+ if (id === RESOLVED_VIRTUAL_I18N_MODULE_ID) {
44
+ return `export const i18nConfig = ${JSON.stringify(i18nConfig)};`;
45
+ }
46
+ }
47
+ });
48
+ return {
49
+ name: "@jet-w/astro-blog",
50
+ hooks: {
51
+ "astro:config:setup": ({ injectRoute, logger, updateConfig }) => {
52
+ logger.info("Injecting @jet-w/astro-blog routes...");
53
+ updateConfig({
54
+ vite: {
55
+ plugins: [vitePluginI18nConfig()]
56
+ }
57
+ });
58
+ const routes = mergedOptions.routes;
59
+ const locales = i18nConfig.locales;
60
+ const injectLocalizedRoute = (pattern, entrypoint) => {
61
+ for (const locale of locales) {
62
+ const prefix = getLocalePrefix(locale.code, i18nConfig);
63
+ const localizedPattern = prefix ? `${prefix}${pattern}` : pattern;
64
+ injectRoute({
65
+ pattern: localizedPattern,
66
+ entrypoint
67
+ });
68
+ }
69
+ };
70
+ if (routes.posts) {
71
+ injectLocalizedRoute("/posts", `${pagesDir}/posts/index.astro`);
72
+ injectLocalizedRoute(
73
+ "/posts/page/[page]",
74
+ `${pagesDir}/posts/page/[page].astro`
75
+ );
76
+ injectLocalizedRoute(
77
+ "/posts/[...slug]",
78
+ `${pagesDir}/posts/[...slug].astro`
79
+ );
80
+ }
81
+ if (routes.tags) {
82
+ injectLocalizedRoute("/tags", `${pagesDir}/tags/index.astro`);
83
+ injectLocalizedRoute("/tags/[tag]", `${pagesDir}/tags/[tag].astro`);
84
+ injectLocalizedRoute(
85
+ "/tags/[tag]/page/[page]",
86
+ `${pagesDir}/tags/[tag]/page/[page].astro`
87
+ );
88
+ }
89
+ if (routes.categories) {
90
+ injectLocalizedRoute(
91
+ "/categories",
92
+ `${pagesDir}/categories/index.astro`
93
+ );
94
+ injectLocalizedRoute(
95
+ "/categories/[category]",
96
+ `${pagesDir}/categories/[category].astro`
97
+ );
98
+ injectLocalizedRoute(
99
+ "/categories/[category]/page/[page]",
100
+ `${pagesDir}/categories/[category]/page/[page].astro`
101
+ );
102
+ }
103
+ if (routes.archives) {
104
+ injectLocalizedRoute("/archives", `${pagesDir}/archives/index.astro`);
105
+ injectLocalizedRoute(
106
+ "/archives/[year]/[month]",
107
+ `${pagesDir}/archives/[year]/[month].astro`
108
+ );
109
+ injectLocalizedRoute(
110
+ "/archives/[year]/[month]/page/[page]",
111
+ `${pagesDir}/archives/[year]/[month]/page/[page].astro`
112
+ );
113
+ }
114
+ if (routes.slides) {
115
+ injectLocalizedRoute("/slides", `${pagesDir}/slides/index.astro`);
116
+ injectLocalizedRoute(
117
+ "/slides/[...slug]",
118
+ `${pagesDir}/slides/[...slug].astro`
119
+ );
120
+ }
121
+ if (routes.search) {
122
+ injectLocalizedRoute("/search", `${pagesDir}/search.astro`);
123
+ injectLocalizedRoute(
124
+ "/search-index.json",
125
+ `${pagesDir}/search-index.json.ts`
126
+ );
127
+ }
128
+ if (routes.rss) {
129
+ injectLocalizedRoute("/rss.xml", `${pagesDir}/rss.xml.ts`);
130
+ }
131
+ injectLocalizedRoute("/[...slug]", `${pagesDir}/[...slug].astro`);
132
+ const localeCount = locales.length;
133
+ logger.info(
134
+ `Routes injected successfully for ${localeCount} locale(s): ${locales.map((l) => l.code).join(", ")}`
135
+ );
136
+ }
137
+ }
138
+ };
139
+ }
140
+ var integration_default = astroBlogIntegration;
141
+
142
+ export {
143
+ astroBlogIntegration,
144
+ integration_default
145
+ };
@@ -0,0 +1,246 @@
1
+ // src/config/i18n.ts
2
+ var zhCNTranslations = {
3
+ // Navigation
4
+ home: "\u9996\u9875",
5
+ blog: "\u535A\u5BA2",
6
+ about: "\u5173\u4E8E",
7
+ search: "\u641C\u7D22",
8
+ // Posts
9
+ posts: "\u6587\u7AE0",
10
+ postList: "\u6587\u7AE0\u5217\u8868",
11
+ noPostsFound: "\u6682\u65E0\u6587\u7AE0",
12
+ readMore: "\u9605\u8BFB\u66F4\u591A",
13
+ readingTime: "\u9605\u8BFB\u65F6\u95F4",
14
+ minuteRead: "\u5206\u949F",
15
+ // Tags & Categories
16
+ tags: "\u6807\u7B7E",
17
+ categories: "\u5206\u7C7B",
18
+ allTags: "\u5168\u90E8\u6807\u7B7E",
19
+ allCategories: "\u5168\u90E8\u5206\u7C7B",
20
+ taggedWith: "\u6807\u7B7E",
21
+ inCategory: "\u5206\u7C7B",
22
+ // Archives
23
+ archives: "\u5F52\u6863",
24
+ postsInArchive: "\u7BC7\u6587\u7AE0",
25
+ // Sidebar
26
+ recentPosts: "\u6700\u65B0\u6587\u7AE0",
27
+ popularTags: "\u70ED\u95E8\u6807\u7B7E",
28
+ friendLinks: "\u53CB\u60C5\u94FE\u63A5",
29
+ documentTree: "\u6587\u6863\u76EE\u5F55",
30
+ // Footer
31
+ quickLinks: "\u5FEB\u901F\u94FE\u63A5",
32
+ contact: "\u8054\u7CFB\u65B9\u5F0F",
33
+ // Search
34
+ searchPlaceholder: "\u641C\u7D22\u6587\u7AE0\u6807\u9898\u3001\u5185\u5BB9\u3001\u6807\u7B7E...",
35
+ searchResults: "\u641C\u7D22\u7ED3\u679C",
36
+ noResults: "\u6CA1\u6709\u627E\u5230\u76F8\u5173\u7ED3\u679C",
37
+ searching: "\u641C\u7D22\u4E2D...",
38
+ searchArticles: "\u641C\u7D22\u6587\u7AE0",
39
+ searchInAllArticles: "\u5728\u6240\u6709\u6587\u7AE0\u4E2D\u67E5\u627E\u60A8\u611F\u5174\u8DA3\u7684\u5185\u5BB9",
40
+ searchTips: "\u641C\u7D22\u6280\u5DE7",
41
+ basicSearch: "\u57FA\u7840\u641C\u7D22",
42
+ advancedFeatures: "\u9AD8\u7EA7\u529F\u80FD",
43
+ searchTipKeyword: "\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22\u6807\u9898\u548C\u5185\u5BB9",
44
+ searchTipMixedLang: "\u652F\u6301\u4E2D\u82F1\u6587\u6DF7\u5408\u641C\u7D22",
45
+ searchTipCaseInsensitive: "\u81EA\u52A8\u5FFD\u7565\u5927\u5C0F\u5199",
46
+ searchTipRealtime: "\u5B9E\u65F6\u641C\u7D22\u5EFA\u8BAE",
47
+ searchTipFilter: "\u6309\u6807\u7B7E\u548C\u5206\u7C7B\u7B5B\u9009",
48
+ searchTipFuzzy: "\u652F\u6301\u6A21\u7CCA\u5339\u914D",
49
+ // Hero section
50
+ browsePosts: "\u6D4F\u89C8\u6587\u7AE0",
51
+ aboutMe: "\u5173\u4E8E\u6211",
52
+ // Pagination
53
+ previousPage: "\u4E0A\u4E00\u9875",
54
+ nextPage: "\u4E0B\u4E00\u9875",
55
+ page: "\u7B2C",
56
+ of: "\u9875\uFF0C\u5171",
57
+ // Article details
58
+ publishedOn: "\u53D1\u5E03\u4E8E",
59
+ updatedOn: "\u66F4\u65B0\u4E8E",
60
+ author: "\u4F5C\u8005",
61
+ tableOfContents: "\u9875\u9762\u76EE\u5F55",
62
+ readingProgress: "\u9605\u8BFB\u8FDB\u5EA6",
63
+ relatedPosts: "\u76F8\u5173\u6587\u7AE0",
64
+ sharePost: "\u5206\u4EAB\u6587\u7AE0",
65
+ previousPost: "\u4E0A\u4E00\u7BC7",
66
+ nextPost: "\u4E0B\u4E00\u7BC7",
67
+ // Misc
68
+ backToTop: "\u56DE\u5230\u9876\u90E8",
69
+ copyCode: "\u590D\u5236",
70
+ copied: "\u5DF2\u590D\u5236",
71
+ expand: "\u5C55\u5F00",
72
+ collapse: "\u6536\u8D77",
73
+ expandCode: "\u5C55\u5F00\u4EE3\u7801",
74
+ collapseCode: "\u6536\u8D77\u4EE3\u7801",
75
+ lines: "\u884C",
76
+ viewMode: "\u89C6\u56FE\u6A21\u5F0F",
77
+ cardView: "\u5361\u7247\u89C6\u56FE",
78
+ listView: "\u5217\u8868\u89C6\u56FE",
79
+ sortBy: "\u6392\u5E8F",
80
+ sortByDate: "\u6309\u65E5\u671F",
81
+ sortByTitle: "\u6309\u6807\u9898",
82
+ filterByTag: "\u6309\u6807\u7B7E\u7B5B\u9009",
83
+ filterByCategory: "\u6309\u5206\u7C7B\u7B5B\u9009",
84
+ clearFilter: "\u6E05\u9664\u7B5B\u9009",
85
+ allPosts: "\u5168\u90E8\u6587\u7AE0",
86
+ draft: "\u8349\u7A3F",
87
+ // Slides
88
+ slides: "\u6F14\u793A",
89
+ slidesList: "\u6F14\u793A\u5217\u8868",
90
+ // RSS
91
+ rssFeed: "RSS \u8BA2\u9605",
92
+ // Quick Navigation
93
+ quickNavigation: "\u5FEB\u901F\u5BFC\u822A",
94
+ timeline: "\u65F6\u95F4\u8F74",
95
+ viewAllTimeline: "\u67E5\u770B\u5168\u90E8\u65F6\u95F4\u8F74",
96
+ postsCount: "\u7BC7"
97
+ };
98
+ var enTranslations = {
99
+ // Navigation
100
+ home: "Home",
101
+ blog: "Blog",
102
+ about: "About",
103
+ search: "Search",
104
+ // Posts
105
+ posts: "Posts",
106
+ postList: "All Posts",
107
+ noPostsFound: "No posts found",
108
+ readMore: "Read more",
109
+ readingTime: "Reading time",
110
+ minuteRead: "min",
111
+ // Tags & Categories
112
+ tags: "Tags",
113
+ categories: "Categories",
114
+ allTags: "All Tags",
115
+ allCategories: "All Categories",
116
+ taggedWith: "Tagged with",
117
+ inCategory: "In category",
118
+ // Archives
119
+ archives: "Archives",
120
+ postsInArchive: "posts",
121
+ // Sidebar
122
+ recentPosts: "Recent Posts",
123
+ popularTags: "Popular Tags",
124
+ friendLinks: "Friend Links",
125
+ documentTree: "Document Tree",
126
+ // Footer
127
+ quickLinks: "Quick Links",
128
+ contact: "Contact",
129
+ // Search
130
+ searchPlaceholder: "Search posts, tags, content...",
131
+ searchResults: "Search Results",
132
+ noResults: "No results found",
133
+ searching: "Searching...",
134
+ searchArticles: "Search Articles",
135
+ searchInAllArticles: "Find content that interests you in all articles",
136
+ searchTips: "Search Tips",
137
+ basicSearch: "Basic Search",
138
+ advancedFeatures: "Advanced Features",
139
+ searchTipKeyword: "Enter keywords to search titles and content",
140
+ searchTipMixedLang: "Supports mixed language search",
141
+ searchTipCaseInsensitive: "Case insensitive",
142
+ searchTipRealtime: "Real-time search suggestions",
143
+ searchTipFilter: "Filter by tags and categories",
144
+ searchTipFuzzy: "Supports fuzzy matching",
145
+ // Hero section
146
+ browsePosts: "Browse Posts",
147
+ aboutMe: "About Me",
148
+ // Pagination
149
+ previousPage: "Previous",
150
+ nextPage: "Next",
151
+ page: "Page",
152
+ of: "of",
153
+ // Article details
154
+ publishedOn: "Published on",
155
+ updatedOn: "Updated on",
156
+ author: "Author",
157
+ tableOfContents: "Table of Contents",
158
+ readingProgress: "Reading Progress",
159
+ relatedPosts: "Related Posts",
160
+ sharePost: "Share",
161
+ previousPost: "Previous",
162
+ nextPost: "Next",
163
+ // Misc
164
+ backToTop: "Back to Top",
165
+ copyCode: "Copy",
166
+ copied: "Copied",
167
+ expand: "Expand",
168
+ collapse: "Collapse",
169
+ expandCode: "Expand code",
170
+ collapseCode: "Collapse code",
171
+ lines: "lines",
172
+ viewMode: "View Mode",
173
+ cardView: "Card View",
174
+ listView: "List View",
175
+ sortBy: "Sort by",
176
+ sortByDate: "Date",
177
+ sortByTitle: "Title",
178
+ filterByTag: "Filter by tag",
179
+ filterByCategory: "Filter by category",
180
+ clearFilter: "Clear filter",
181
+ allPosts: "All Posts",
182
+ draft: "Draft",
183
+ // Slides
184
+ slides: "Slides",
185
+ slidesList: "All Slides",
186
+ // RSS
187
+ rssFeed: "RSS Feed",
188
+ // Quick Navigation
189
+ quickNavigation: "Quick Navigation",
190
+ timeline: "Timeline",
191
+ viewAllTimeline: "View all timeline",
192
+ postsCount: "posts"
193
+ };
194
+ var builtInTranslations = {
195
+ "zh-CN": zhCNTranslations,
196
+ "zh": zhCNTranslations,
197
+ "en": enTranslations,
198
+ "en-US": enTranslations,
199
+ "en-GB": enTranslations
200
+ };
201
+ var defaultLocales = [
202
+ {
203
+ code: "zh-CN",
204
+ name: "\u4E2D\u6587",
205
+ htmlLang: "zh-CN",
206
+ dateLocale: "zh-CN",
207
+ direction: "ltr"
208
+ }
209
+ ];
210
+ var defaultI18nConfig = {
211
+ defaultLocale: "zh-CN",
212
+ locales: defaultLocales,
213
+ localeConfigs: {},
214
+ routing: {
215
+ prefixDefaultLocale: false
216
+ }
217
+ };
218
+ function defineI18nConfig(config) {
219
+ return {
220
+ defaultLocale: config.defaultLocale || "zh-CN",
221
+ locales: config.locales || defaultLocales,
222
+ localeConfigs: config.localeConfigs || {},
223
+ routing: {
224
+ prefixDefaultLocale: config.routing?.prefixDefaultLocale ?? false
225
+ }
226
+ };
227
+ }
228
+ function getUITranslations(locale, config) {
229
+ const localeConfig = config?.localeConfigs?.[locale];
230
+ const customTranslations = localeConfig?.ui;
231
+ const baseTranslations = builtInTranslations[locale] || builtInTranslations[locale.split("-")[0]] || builtInTranslations["en"];
232
+ if (customTranslations) {
233
+ return { ...baseTranslations, ...customTranslations };
234
+ }
235
+ return baseTranslations;
236
+ }
237
+
238
+ export {
239
+ zhCNTranslations,
240
+ enTranslations,
241
+ builtInTranslations,
242
+ defaultLocales,
243
+ defaultI18nConfig,
244
+ defineI18nConfig,
245
+ getUITranslations
246
+ };
@@ -1,7 +1,7 @@
1
1
  // src/config/site.ts
2
2
  var siteConfig = {
3
3
  title: "My Astro Blog",
4
- description: "A modern blog built with Astro, Vue, and Tailwind CSS",
4
+ description: "",
5
5
  author: "Author",
6
6
  email: "",
7
7
  avatar: "/images/avatar.svg",
@@ -1,5 +1,6 @@
1
1
  import { SiteConfig, NavigationItem } from '../types/index.js';
2
- export { D as DividerConfig, M as ManualConfig, f as MixedConfig, P as PathMatchConfig, e as ScanConfig, S as SidebarConfig, b as SidebarGroup, c as SidebarItem, d as defaultSidebarConfig, a as defineSidebarConfig, s as sidebarConfig } from '../sidebar-DNdiCKBw.js';
2
+ export { D as DividerConfig, M as ManualConfig, f as MixedConfig, P as PathMatchConfig, e as ScanConfig, b as SidebarConfig, a as SidebarGroup, S as SidebarItem, d as defaultSidebarConfig, c as defineSidebarConfig, s as sidebarConfig } from '../sidebar-Da-W_4Lr.js';
3
+ export { F as FooterConfig, m as FooterLink, I as I18nConfig, o as I18nRoutingConfig, L as Locale, n as LocaleConfig, S as SocialLink, U as UITranslations, j as builtInTranslations, c as defaultFooterConfig, g as defaultI18nConfig, d as defaultIcons, l as defaultLocales, a as defaultSocialLinks, e as defineFooterConfig, h as defineI18nConfig, b as defineSocialLinks, k as enTranslations, f as footerConfig, i as getUITranslations, s as socialLinks, z as zhCNTranslations } from '../i18n-PgMCFBw0.js';
3
4
 
4
5
  /**
5
6
  * Default site configuration
@@ -28,49 +29,4 @@ declare const menu: NavigationItem[];
28
29
  declare function defineMenu(items: NavigationItem[]): NavigationItem[];
29
30
  declare const defaultMenu: NavigationItem[];
30
31
 
31
- /**
32
- * 社交链接配置
33
- */
34
- interface SocialLink {
35
- type: string;
36
- url: string;
37
- label?: string;
38
- icon?: string;
39
- }
40
- declare const defaultIcons: Record<string, string>;
41
- declare const socialLinks: SocialLink[];
42
- declare const defaultSocialLinks: SocialLink[];
43
- /**
44
- * Define social links
45
- */
46
- declare function defineSocialLinks(links: SocialLink[]): SocialLink[];
47
-
48
- /**
49
- * Footer 配置
50
- */
51
-
52
- interface FooterLink {
53
- name: string;
54
- href: string;
55
- }
56
- interface FooterConfig {
57
- quickLinksTitle: string;
58
- quickLinks: FooterLink[];
59
- contactTitle: string;
60
- socialLinks: SocialLink[];
61
- showRss: boolean;
62
- rssUrl: string;
63
- copyright: string;
64
- poweredBy: {
65
- text: string;
66
- url: string;
67
- };
68
- }
69
- declare const footerConfig: FooterConfig;
70
- /**
71
- * Define footer configuration
72
- */
73
- declare function defineFooterConfig(config: Partial<FooterConfig>): FooterConfig;
74
- declare const defaultFooterConfig: FooterConfig;
75
-
76
- export { type FooterConfig, type FooterLink, type SocialLink, defaultFooterConfig, defaultIcons, defaultMenu, defaultSEO, defaultSiteConfig, defaultSocialLinks, defineFooterConfig, defineMenu, defineSiteConfig, defineSocialLinks, footerConfig, menu, siteConfig, socialLinks };
32
+ export { defaultMenu, defaultSEO, defaultSiteConfig, defineMenu, defineSiteConfig, menu, siteConfig };
@@ -16,23 +16,39 @@ import {
16
16
  sidebarConfig,
17
17
  siteConfig,
18
18
  socialLinks
19
- } from "../chunk-GYLSY3OJ.js";
19
+ } from "../chunk-TJTPX2WP.js";
20
+ import {
21
+ builtInTranslations,
22
+ defaultI18nConfig,
23
+ defaultLocales,
24
+ defineI18nConfig,
25
+ enTranslations,
26
+ getUITranslations,
27
+ zhCNTranslations
28
+ } from "../chunk-A2E2VSAQ.js";
20
29
  export {
30
+ builtInTranslations,
21
31
  defaultFooterConfig,
32
+ defaultI18nConfig,
22
33
  defaultIcons,
34
+ defaultLocales,
23
35
  defaultMenu,
24
36
  defaultSEO,
25
37
  defaultSidebarConfig,
26
38
  defaultSiteConfig,
27
39
  defaultSocialLinks,
28
40
  defineFooterConfig,
41
+ defineI18nConfig,
29
42
  defineMenu,
30
43
  defineSidebarConfig,
31
44
  defineSiteConfig,
32
45
  defineSocialLinks,
46
+ enTranslations,
33
47
  footerConfig,
48
+ getUITranslations,
34
49
  menu,
35
50
  sidebarConfig,
36
51
  siteConfig,
37
- socialLinks
52
+ socialLinks,
53
+ zhCNTranslations
38
54
  };