@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.
- package/dist/chunk-FXPGR372.js +0 -0
- package/dist/chunk-GYLSY3OJ.js +173 -0
- package/dist/config/index.d.ts +166 -0
- package/dist/config/index.js +38 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +59 -0
- package/dist/types/index.d.ts +75 -0
- package/dist/types/index.js +1 -0
- package/package.json +84 -0
- package/src/components/EChartsCard.vue +118 -0
- package/src/components/Mermaid.vue +73 -0
- package/src/components/about/ContentCard.astro +27 -0
- package/src/components/about/IconCard.astro +77 -0
- package/src/components/about/SocialLinks.astro +54 -0
- package/src/components/about/TagCard.astro +65 -0
- package/src/components/about/TagGroup.astro +33 -0
- package/src/components/about/TimelineCard.astro +52 -0
- package/src/components/blog/FloatingToc.vue +198 -0
- package/src/components/blog/Hero.astro +147 -0
- package/src/components/blog/NavigationTabs.vue +245 -0
- package/src/components/blog/PostCard.astro +161 -0
- package/src/components/blog/PostNavigation.astro +106 -0
- package/src/components/blog/RelatedPosts.astro +175 -0
- package/src/components/blog/TableOfContents.astro +153 -0
- package/src/components/blog/TagCloud.astro +91 -0
- package/src/components/home/FeaturedPostsSection.astro +54 -0
- package/src/components/home/QuickNavSection.astro +81 -0
- package/src/components/home/RecentPostsSection.astro +52 -0
- package/src/components/home/StatsSection.astro +44 -0
- package/src/components/layout/Footer.astro +103 -0
- package/src/components/layout/Header.astro +68 -0
- package/src/components/layout/Sidebar.astro +594 -0
- package/src/components/media/Bilibili.astro +114 -0
- package/src/components/media/Slides.astro +313 -0
- package/src/components/media/Video.astro +111 -0
- package/src/components/media/VideoPlayer.astro +89 -0
- package/src/components/media/YouTube.astro +92 -0
- package/src/components/pte/StudyCalendar.vue +1348 -0
- package/src/components/ui/Icon.astro +187 -0
- package/src/components/ui/MobileMenu.vue +201 -0
- package/src/components/ui/Pagination.astro +143 -0
- package/src/components/ui/SearchBox.vue +179 -0
- package/src/components/ui/SearchInterface.vue +409 -0
- package/src/components/ui/SidebarToggle.vue +57 -0
- package/src/components/ui/ThemeToggle.vue +90 -0
- package/src/layouts/AboutLayout.astro +18 -0
- package/src/layouts/BaseLayout.astro +362 -0
- package/src/layouts/PageLayout.astro +217 -0
- package/src/layouts/SlidesLayout.astro +320 -0
- package/src/plugins/rehype-clean-containers.mjs +24 -0
- package/src/plugins/rehype-relative-links.mjs +43 -0
- package/src/plugins/rehype-tabs.mjs +116 -0
- package/src/plugins/remark-containers.mjs +407 -0
- package/src/plugins/remark-mermaid.mjs +46 -0
- package/src/styles/global.css +870 -0
- package/src/styles/slides.css +220 -0
- package/src/utils/sidebar.ts +492 -0
- package/templates/default/astro.config.mjs +51 -0
- package/templates/default/content/pages/about.mdx +93 -0
- package/templates/default/content/pages/index.mdx +20 -0
- package/templates/default/content/posts/blog_docs/01-quick-start.md +162 -0
- package/templates/default/content/posts/blog_docs/02-frontmatter.md +277 -0
- package/templates/default/content/posts/blog_docs/03-markdown-basic.md +350 -0
- package/templates/default/content/posts/blog_docs/04-containers.md +331 -0
- package/templates/default/content/posts/blog_docs/05-code-blocks.md +388 -0
- package/templates/default/content/posts/blog_docs/06-mermaid.md +431 -0
- package/templates/default/content/posts/blog_docs/07-video.md +243 -0
- package/templates/default/content/posts/blog_docs/08-latex.md +382 -0
- package/templates/default/content/posts/blog_docs/09-icons.md +326 -0
- package/templates/default/content/posts/blog_docs/10-sidebar.md +445 -0
- package/templates/default/content/posts/blog_docs/11-config.md +334 -0
- package/templates/default/content/posts/blog_docs/12-slides.mdx +552 -0
- package/templates/default/content/posts/blog_docs/README.md +151 -0
- package/templates/default/content/slides/demo.md +146 -0
- package/templates/default/content/slides/docs/basic-demo.md +35 -0
- package/templates/default/content/slides/docs/code-demo.md +62 -0
- package/templates/default/content/slides/docs/echarts-demo.md +139 -0
- package/templates/default/content/slides/docs/fragment-demo.md +35 -0
- package/templates/default/content/slides/docs/math-demo.md +48 -0
- package/templates/default/content/slides/docs/mermaid-demo.md +105 -0
- package/templates/default/content/slides/docs/theme-demo.md +38 -0
- package/templates/default/content/slides/docs/vertical-demo.md +50 -0
- package/templates/default/package.json +31 -0
- package/templates/default/public/favicon-bak.svg +4 -0
- package/templates/default/public/images/avatar.jpg +0 -0
- package/templates/default/public/images/avatar.svg +142 -0
- package/templates/default/public/js/mermaid-container.js +402 -0
- package/templates/default/public/js/mermaid-init.js +131 -0
- package/templates/default/public/js/mermaid-render.js +98 -0
- package/templates/default/public/js/mermaid-simple.js +95 -0
- package/templates/default/public/js/tabs-init.js +86 -0
- package/templates/default/public/media/individual_portfolio/INDIVIDUAL PORTFOLIO.png +0 -0
- package/templates/default/public/slides/plugin/highlight/highlight.js +5 -0
- package/templates/default/public/slides/plugin/highlight/monokai.css +71 -0
- package/templates/default/public/slides/plugin/markdown/markdown.js +7 -0
- package/templates/default/public/slides/plugin/math/math.js +1 -0
- package/templates/default/public/slides/plugin/notes/notes.js +1 -0
- package/templates/default/public/slides/reveal.css +9 -0
- package/templates/default/public/slides/reveal.js +9 -0
- package/templates/default/public/slides/theme/beige.css +366 -0
- package/templates/default/public/slides/theme/black-contrast.css +362 -0
- package/templates/default/public/slides/theme/black.css +359 -0
- package/templates/default/public/slides/theme/blood.css +392 -0
- package/templates/default/public/slides/theme/dracula.css +385 -0
- package/templates/default/public/slides/theme/league.css +368 -0
- package/templates/default/public/slides/theme/moon.css +362 -0
- package/templates/default/public/slides/theme/night.css +360 -0
- package/templates/default/public/slides/theme/serif.css +363 -0
- package/templates/default/public/slides/theme/simple.css +362 -0
- package/templates/default/public/slides/theme/sky.css +370 -0
- package/templates/default/public/slides/theme/solarized.css +363 -0
- package/templates/default/public/slides/theme/white-contrast.css +362 -0
- package/templates/default/public/slides/theme/white.css +359 -0
- package/templates/default/public/slides/theme/white_contrast_compact_verbatim_headers.css +360 -0
- package/templates/default/public/test-complete.html +43 -0
- package/templates/default/public/test-mermaid.html +124 -0
- package/templates/default/src/config/index.ts +114 -0
- package/templates/default/src/content.config.ts +96 -0
- package/templates/default/src/pages/[...slug].astro +27 -0
- package/templates/default/src/pages/archives/[year]/[month]/page/[page].astro +176 -0
- package/templates/default/src/pages/archives/[year]/[month].astro +158 -0
- package/templates/default/src/pages/archives/index.astro +210 -0
- package/templates/default/src/pages/categories/[category]/page/[page].astro +218 -0
- package/templates/default/src/pages/categories/[category].astro +198 -0
- package/templates/default/src/pages/categories/index.astro +190 -0
- package/templates/default/src/pages/container-test.astro +79 -0
- package/templates/default/src/pages/mermaid-direct.html +78 -0
- package/templates/default/src/pages/posts/[...slug].astro +335 -0
- package/templates/default/src/pages/posts/index.astro +541 -0
- package/templates/default/src/pages/posts/page/[page].astro +146 -0
- package/templates/default/src/pages/rss.xml.ts +28 -0
- package/templates/default/src/pages/search-index.json.ts +21 -0
- package/templates/default/src/pages/search.astro +50 -0
- package/templates/default/src/pages/slides/[...slug].astro +54 -0
- package/templates/default/src/pages/slides/index.astro +135 -0
- package/templates/default/src/pages/tags/[tag]/page/[page].astro +211 -0
- package/templates/default/src/pages/tags/[tag].astro +191 -0
- package/templates/default/src/pages/tags/index.astro +167 -0
- package/templates/default/tailwind.config.mjs +78 -0
- package/templates/default/tsconfig.json +9 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { siteConfig } from '../../config/site';
|
|
3
|
+
import { footerConfig, defaultIcons } from '../../config';
|
|
4
|
+
|
|
5
|
+
const currentYear = new Date().getFullYear();
|
|
6
|
+
|
|
7
|
+
function getIcon(link: { type: string; icon?: string }): string {
|
|
8
|
+
return link.icon || defaultIcons[link.type] || '';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// 替换版权信息中的占位符
|
|
12
|
+
const copyright = footerConfig.copyright
|
|
13
|
+
.replace('{year}', String(currentYear))
|
|
14
|
+
.replace('{author}', siteConfig.author);
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
<footer class="bg-slate-50 dark:bg-slate-800 border-t border-slate-200 dark:border-slate-700 mt-auto">
|
|
18
|
+
<div class="container mx-auto px-4 py-6">
|
|
19
|
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
|
|
20
|
+
<!-- 站点信息 -->
|
|
21
|
+
<div>
|
|
22
|
+
<div class="flex items-center space-x-3 mb-3">
|
|
23
|
+
{siteConfig.avatar && (
|
|
24
|
+
<img
|
|
25
|
+
src={siteConfig.avatar}
|
|
26
|
+
alt={siteConfig.title}
|
|
27
|
+
class="w-8 h-8 rounded-full"
|
|
28
|
+
/>
|
|
29
|
+
)}
|
|
30
|
+
<div>
|
|
31
|
+
<h3 class="text-base font-semibold text-slate-900 dark:text-slate-100">
|
|
32
|
+
{siteConfig.title}
|
|
33
|
+
</h3>
|
|
34
|
+
<p class="text-xs text-slate-600 dark:text-slate-400">
|
|
35
|
+
{siteConfig.description}
|
|
36
|
+
</p>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<!-- 快速链接 -->
|
|
42
|
+
<div>
|
|
43
|
+
<h4 class="text-sm font-semibold text-slate-900 dark:text-slate-100 mb-3">
|
|
44
|
+
{footerConfig.quickLinksTitle}
|
|
45
|
+
</h4>
|
|
46
|
+
<div class="flex flex-wrap gap-x-4 gap-y-1">
|
|
47
|
+
{footerConfig.quickLinks.map((item) => (
|
|
48
|
+
<a
|
|
49
|
+
href={item.href}
|
|
50
|
+
class="text-sm text-slate-600 dark:text-slate-400 hover:text-primary-500 transition-colors"
|
|
51
|
+
>
|
|
52
|
+
{item.name}
|
|
53
|
+
</a>
|
|
54
|
+
))}
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<!-- 社交链接 -->
|
|
59
|
+
<div>
|
|
60
|
+
<h4 class="text-sm font-semibold text-slate-900 dark:text-slate-100 mb-3">
|
|
61
|
+
{footerConfig.contactTitle}
|
|
62
|
+
</h4>
|
|
63
|
+
<div class="flex space-x-4">
|
|
64
|
+
{footerConfig.socialLinks.map((link) => (
|
|
65
|
+
<a
|
|
66
|
+
href={link.url}
|
|
67
|
+
target={link.type === 'email' ? undefined : '_blank'}
|
|
68
|
+
rel={link.type === 'email' ? undefined : 'noopener noreferrer'}
|
|
69
|
+
class="text-slate-600 dark:text-slate-400 hover:text-primary-500 transition-colors"
|
|
70
|
+
aria-label={link.label || link.type}
|
|
71
|
+
>
|
|
72
|
+
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24">
|
|
73
|
+
<path d={getIcon(link)} />
|
|
74
|
+
</svg>
|
|
75
|
+
</a>
|
|
76
|
+
))}
|
|
77
|
+
|
|
78
|
+
{footerConfig.showRss && (
|
|
79
|
+
<a
|
|
80
|
+
href={footerConfig.rssUrl}
|
|
81
|
+
class="text-slate-600 dark:text-slate-400 hover:text-primary-500 transition-colors"
|
|
82
|
+
aria-label="RSS订阅"
|
|
83
|
+
>
|
|
84
|
+
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24">
|
|
85
|
+
<path d="M3.429 2.486c9.36 0 16.943 7.583 16.943 16.943h-3.257c0-7.563-6.123-13.686-13.686-13.686V2.486zM3.429 9.114c5.647 0 10.229 4.581 10.229 10.229h-3.257c0-3.844-3.128-6.972-6.972-6.972V9.114zM6.686 16.486c0 1.8-1.457 3.257-3.257 3.257S0.172 18.286 0.172 16.486s1.457-3.257 3.257-3.257 3.257 1.457 3.257 3.257z"/>
|
|
86
|
+
</svg>
|
|
87
|
+
</a>
|
|
88
|
+
)}
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
<!-- 版权信息 -->
|
|
94
|
+
<div class="border-t border-slate-200 dark:border-slate-700 pt-4 mt-6">
|
|
95
|
+
<div class="flex flex-col sm:flex-row justify-between items-center text-sm text-slate-600 dark:text-slate-400">
|
|
96
|
+
<p>{copyright}</p>
|
|
97
|
+
<p class="mt-2 sm:mt-0">
|
|
98
|
+
Powered by <a href={footerConfig.poweredBy.url} class="link" target="_blank" rel="noopener noreferrer">{footerConfig.poweredBy.text}</a>
|
|
99
|
+
</p>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
</footer>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { siteConfig } from '../../config/site';
|
|
3
|
+
import ThemeToggle from '../../components/ui/ThemeToggle.vue';
|
|
4
|
+
import SearchBox from '../../components/ui/SearchBox.vue';
|
|
5
|
+
import MobileMenu from '../../components/ui/MobileMenu.vue';
|
|
6
|
+
|
|
7
|
+
const currentPath = Astro.url.pathname;
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<header class="sticky top-0 z-50 bg-white/80 dark:bg-slate-900/80 backdrop-blur-sm border-b border-slate-200 dark:border-slate-700">
|
|
11
|
+
<div class="container mx-auto px-4">
|
|
12
|
+
<nav class="flex items-center justify-between h-16">
|
|
13
|
+
<!-- Logo 和站点名称 -->
|
|
14
|
+
<div class="flex items-center space-x-4">
|
|
15
|
+
<a href="/" class="flex items-center space-x-3 hover:opacity-80 transition-opacity">
|
|
16
|
+
{siteConfig.avatar && (
|
|
17
|
+
<img
|
|
18
|
+
src={siteConfig.avatar}
|
|
19
|
+
alt={siteConfig.title}
|
|
20
|
+
class="w-8 h-8 rounded-full"
|
|
21
|
+
/>
|
|
22
|
+
)}
|
|
23
|
+
<div class="hidden sm:block">
|
|
24
|
+
<h1 class="text-xl font-bold text-slate-900 dark:text-slate-100">
|
|
25
|
+
{siteConfig.title}
|
|
26
|
+
</h1>
|
|
27
|
+
<p class="text-xs text-slate-600 dark:text-slate-400 -mt-1">
|
|
28
|
+
技术博客
|
|
29
|
+
</p>
|
|
30
|
+
</div>
|
|
31
|
+
</a>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<!-- 桌面端导航 -->
|
|
35
|
+
<div class="hidden md:flex items-center space-x-8">
|
|
36
|
+
{siteConfig.menu.map((item) => (
|
|
37
|
+
<a
|
|
38
|
+
href={item.href}
|
|
39
|
+
class={`text-sm font-medium transition-colors hover:text-primary-500 ${
|
|
40
|
+
currentPath === item.href || (item.href !== '/' && currentPath.startsWith(item.href))
|
|
41
|
+
? 'text-primary-500'
|
|
42
|
+
: 'text-slate-700 dark:text-slate-300'
|
|
43
|
+
}`}
|
|
44
|
+
>
|
|
45
|
+
{item.name}
|
|
46
|
+
</a>
|
|
47
|
+
))}
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<!-- 右侧功能区 -->
|
|
51
|
+
<div class="flex items-center">
|
|
52
|
+
<!-- 搜索框 -->
|
|
53
|
+
<div class="hidden sm:block mr-2">
|
|
54
|
+
<SearchBox client:load />
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div class="hidden sm:block mr-2">
|
|
58
|
+
<!-- 主题切换 -->
|
|
59
|
+
<ThemeToggle client:load />
|
|
60
|
+
</div>
|
|
61
|
+
<!-- 移动端菜单 -->
|
|
62
|
+
<div class="md:hidden">
|
|
63
|
+
<MobileMenu client:load navigation={siteConfig.menu} />
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</nav>
|
|
67
|
+
</div>
|
|
68
|
+
</header>
|