更换到Astro #9

Merged
biss merged 30 commits from switch-to-astro into master 2026-06-19 13:23:31 +08:00
15 changed files with 1278 additions and 5602 deletions
Showing only changes of commit 9d6de3158e - Show all commits

No files matched your search

+269 -5534
View File
File diff suppressed because it is too large. Load diff
+3 -38
View File
@@ -9,44 +9,9 @@
"preview": "astro preview", "preview": "astro preview",
"server": "astro dev" "server": "astro dev"
}, },
"hexo": {
"version": "8.1.1"
},
"dependencies": { "dependencies": {
"@astrojs/rss": "^4.0.12", "@astrojs/rss": "^4.0.18",
"@astrojs/sitemap": "^3.6.0", "@astrojs/sitemap": "^3.7.3",
"astro": "^5.13.0", "astro": "^6.4.8"
"axios": "^1.15.0",
"cheerio": "^1.2.0",
"hexo": "^8.1.1",
"hexo-abbrlink": "^2.2.1",
"hexo-ai-summary-liushen": "^2.0.0",
"hexo-butterfly-swiper-lyx": "^1.0.2",
"hexo-deployer-git": "^4.0.0",
"hexo-douban": "^2.3.6",
"hexo-filter-mathjax": "^0.9.1",
"hexo-generator-archive": "^2.0.0",
"hexo-generator-category": "^2.0.0",
"hexo-generator-index": "^4.0.0",
"hexo-generator-search": "^2.4.3",
"hexo-generator-searchdb": "^1.5.0",
"hexo-generator-sitemap": "^3.0.1",
"hexo-generator-tag": "^2.0.0",
"hexo-indexnow": "^1.2.0",
"hexo-pretty-feed": "^2.1.0",
"hexo-renderer-ejs": "^2.0.0",
"hexo-renderer-marked": "^7.0.1",
"hexo-renderer-pug": "^3.0.0",
"hexo-renderer-stylus": "^3.0.1",
"hexo-safego": "^2.3.0",
"hexo-server": "^3.0.0",
"hexo-spoiler": "^1.7.4",
"hexo-wordcount": "^6.0.1",
"moment": "^2.30.1",
"node-fetch": "^3.3.2",
"p-limit": "^7.3.0",
"typesense": "^3.0.5",
"vite-plugin-require-transform": "^1.0.21",
"xml2js": "^0.6.2"
} }
} }
+64
View File
@@ -0,0 +1,64 @@
---
import type { BlogPost } from '@/lib/posts';
type TocItem = {
depth: number;
text: string;
id: string;
};
interface Props {
post: BlogPost;
toc: TocItem[];
relatedPosts: BlogPost[];
}
const { post, toc, relatedPosts } = Astro.props;
const avatar = 'https://free.picui.cn/free/2025/08/10/689845496a283.png';
---
<aside class="article-sidebar" aria-label="文章侧边栏">
<section class="sidebar-card article-author-card">
<img class="profile-avatar" src={avatar} alt="biss" loading="lazy" />
<div class="profile-name">biss</div>
<div class="article-author-meta">
<span>{post.dateText}</span>
{post.categories[0] && <a href={`/categories/${encodeURIComponent(post.categories[0])}/`}>{post.categories[0]}</a>}
</div>
</section>
{toc.length > 0 && (
<section class="sidebar-card toc-card">
<h2>
<span aria-hidden="true">☰</span>
文章目录
<em>{toc.length}</em>
</h2>
<nav class="toc-list" aria-label="文章目录">
{toc.map((item) => (
<a class={`toc-depth-${item.depth}`} href={`#${item.id}`}>{item.text}</a>
))}
</nav>
</section>
)}
<section class="sidebar-card same-category-card">
<h2>
<span aria-hidden="true">▣</span>
同类文章
<em>{relatedPosts.length}</em>
</h2>
{relatedPosts.length > 0 ? (
<div class="same-category-list">
{relatedPosts.map((item) => (
<a href={item.href}>
<strong>{item.title}</strong>
<time datetime={item.date.toISOString()}>{item.dateText}</time>
</a>
))}
</div>
) : (
<p class="sidebar-empty">这个分类下暂时没有其他文章。</p>
)}
</section>
</aside>
Loaded 3 of 15 files, more files were not shown because too many files have changed in this diff. Show more