优化SEO,支持descript,subtitle,og图片支持中文,解决一些遗留的英文。

This commit is contained in:
blue-cape 2025-03-17 23:41:22 +08:00
parent f30b0f8efe
commit 0a584bafca
10 changed files with 141 additions and 19 deletions

View File

@ -20,9 +20,9 @@ const { noMarginTop = false } = Astro.props;
> >
<Socials centered /> <Socials centered />
<div class="my-2 flex flex-col items-center whitespace-nowrap sm:flex-row"> <div class="my-2 flex flex-col items-center whitespace-nowrap sm:flex-row">
<span>Copyright &#169; {currentYear}&nbsp;{SITE.author}</span> <span>版权所有 &#169; {SITE.created}-{currentYear}&nbsp;{SITE.author}</span>
<span class="hidden sm:inline">&nbsp;|&nbsp;</span> <span class="hidden sm:inline">&nbsp;|&nbsp;</span>
<span>All rights reserved.</span> <span>保留所有权利</span>
</div> </div>
</div> </div>
</footer> </footer>

View File

@ -24,13 +24,6 @@ const isActive = (path: string) => {
--- ---
<header> <header>
<a
id="skip-to-content"
href="#main-content"
class="absolute -top-full left-16 z-50 bg-background px-3 py-2 text-accent backdrop-blur-lg transition-all focus:top-4"
>
Skip to content
</a>
<div <div
id="nav-container" id="nav-container"
class="mx-auto flex max-w-3xl flex-col items-center justify-between sm:flex-row" class="mx-auto flex max-w-3xl flex-col items-center justify-between sm:flex-row"

View File

@ -22,7 +22,7 @@ const { page } = Astro.props;
ariaLabel="Previous" ariaLabel="Previous"
> >
<IconArrowLeft class="inline-block" /> <IconArrowLeft class="inline-block" />
Prev 上一页
</LinkButton> </LinkButton>
{page.currentPage} / {page.lastPage} {page.currentPage} / {page.lastPage}
<LinkButton <LinkButton

View File

@ -1,13 +1,16 @@
export const SITE = { export const SITE = {
website: "https://cape.blue/", // replace this with your deployed domain website: "https://cape.blue/", // replace this with your deployed domain
created: "2024",
author: "ZephyrG", author: "ZephyrG",
profile: "https://赵文光.中国/", profile: "https://赵文光.中国/",
desc: "一个分享技术、文学的博客", desc: "探索技术前沿与文学深度的精神栖息地。这里有最新技术趋势解读、经典文学作品剖析、编程实践指南与创作心得分享,助力思维成长与知识沉淀。",
title: "蓝色的海角", title: "蓝色的海角",
subtitle:"技术解析×文学评论×原创观点分享",
keywords: "技术博客, 文学分析, 编程教程, 创作方法论, 书评推荐, 开源项目, 知识共享, 深度学习, 经典阅读, 代码实践, 思维训练, 内容创作",
ogImage: "astropaper-og.jpg", ogImage: "astropaper-og.jpg",
lightAndDarkMode: true, lightAndDarkMode: true,
postPerIndex: 4, postPerIndex: 4,
postPerPage: 4, postPerPage: 8,
scheduledPostMargin: 15 * 60 * 1000, // 15 minutes scheduledPostMargin: 15 * 60 * 1000, // 15 minutes
showArchives: true, showArchives: true,
showBackButton: true, // show back button in post detail showBackButton: true, // show back button in post detail
@ -16,5 +19,5 @@ export const SITE = {
url: "https://codeberg.org/blue-cape/astro-paper-zh/src/branch/main/src/data/blog", url: "https://codeberg.org/blue-cape/astro-paper-zh/src/branch/main/src/data/blog",
text: "建议修改", text: "建议修改",
appendFilePath: true, appendFilePath: true,
}, }
} as const; } as const;

View File

@ -32,7 +32,7 @@ func routeSplitMiddleware() gin.HandlerFunc {
return return
} }
if _, err := os.Stat(config.GlobalConfig.Static.Dir + ctx.Request.URL.Path); os.IsNotExist(err) { if _, err := os.Stat(config.GlobalConfig.Static.Dir + ctx.Request.URL.Path); os.IsNotExist(err) {
ctx.Redirect(301, "/404.html") ctx.File("./static/404.html")
ctx.Abort() ctx.Abort()
return return
} }

View File

@ -0,0 +1,111 @@
---
title: 阿加莎·克里斯蒂作品阅读记
pubDatetime: 2025-03-11T19:52:00+08:00
description: 阿加莎·克里斯蒂85册全集。
featured: true
slug: 阿加莎
tags:
- 悬疑小说
- 阿加莎·克里斯蒂
---
## 前言
简单记录一下阿加莎·克里斯蒂85册全集的阅读进度。
### 一、波洛系列38部
1. [x] 《斯泰尔斯庄园奇案》(首部波洛登场)
2. [ ] 《高尔夫球场命案》
3. [ ] 《首相绑架案》(短篇集)
4. [x] 《罗杰疑案》(叙述性诡计开山作)
5. [ ] 《四巨头》(又名《四魔头》)
6. [ ] 《蓝色列车之谜》
7. [x] 《悬崖山庄奇案》
8. [ ] 《人性记录》
9. [x] 《东方快车谋杀案》(道德困境经典)
10. [ ] 《云中命案》
11. [ ] 《三幕悲剧》
12. [ ] 《底牌》(心理博弈代表作)
13. [ ] 《古墓之谜》
14. [x] 《ABC谋杀案》连环杀人模式
15. [x] 《尼罗河上的惨案》(异国谋杀巅峰)
16. [ ] 《沉默的证人》
17. [ ] 《幽巷谋杀案》(短篇集)
18. [ ] 《死亡约会》
19. [x] 《波洛圣诞探案记》
20. [x] 《牙医谋杀案》
21. [ ] 《H庄园的午餐》
22. [x] 《阳光下的罪恶》
23. [x] 《五只小猪》(又名《啤酒谋杀案》)
24. [ ] 《空幻之屋》
25. [ ] 《赫尔克里·波洛的丰功伟绩》(短篇集)
26. [ ] 《顺水推舟》
27. [ ] 《清洁女工之死》
28. [ ] 《葬礼之后》
29. [ ] 《山核桃大街谋杀案》
30. [ ] 《弄假成真》
31. [ ] 《鸽群中的猫》
32. [ ] 《雪地上的女尸》(短篇集)
33. [ ] 《怪钟疑案》
34. [ ] 《第三个女郎》
35. [ ] 《万圣节前夜的谋杀》
36. [ ] 《大象的证词》
37. [ ] 《蒙面女人》(短篇集)
38. [x] 《帷幕》(波洛终章)
*注:部分短篇集如《首相绑架案》《雪地上的女尸》包含多个案件*
---
### 二、马普尔系列14部
1. [ ] 《寓所谜案》(马普尔首秀)
2. [ ] 《死亡草》(短篇集)
3. [ ] 《藏书室女尸之谜》
4. [ ] 《魔手》
5. [ ] 《谋杀启事》(乡间别墅派典范)
6. [ ] 《借镜杀人》
7. [ ] 《黑麦奇案》
8. [ ] 《命案目睹记》
9. [ ] 《破镜谋杀案》
10. [ ] 《加勒比海之谜》
11. [ ] 《伯特伦旅馆》
12. [ ] 《复仇女神》
13. [ ] 《沉睡谋杀案》(系列终章)
14. [ ] 《马普尔小姐最后的案件》(短篇集)
---
### 三、非系列作品37部
1. [ ] 《暗藏杀机》(汤米与塔彭丝系列首作)
2. [ ] 《褐衣男子》
3. [ ] 《烟囱别墅之谜》
4. [ ] 《犯罪团伙》
5. [ ] 《七面钟之谜》
6. [ ] 《神秘的奎因先生》
7. [ ] 《斯塔福特疑案》
8. [x] 《控方证人》(剧本)
9. [ ] 《惊险的浪漫》(短篇集)
10. [ ] 《金色的机遇》
11. [ ] 《悬崖上的谋杀》
12. [ ] 《黑咖啡》(剧本)
13. [x] 《无人生还》(孤岛模式鼻祖)
14. [ ] 《逆我者亡》
15. [ ] 《桑苏西来客》
16. [ ] 《零点》
17. [ ] 《死亡终局》
18. [ ] 《闪光的氰化物》
19. [ ] 《怪屋》
20. [ ] 《三只瞎老鼠》(剧本原型)
21. [ ] 《他们来到巴格达》
22. [ ] 《地狱之旅》
23. [ ] 《蜘蛛网》(剧本)
24. [ ] 《奉命谋杀》
25. [ ] 《意外来客》
26. [ ] 《灰马酒店》
27. [x] 《长夜》(人性黑暗代表作)
28. [ ] 《煦阳岭的疑云》
29. [ ] 《天涯过客》
30. [ ] 《命运之门》
31. [ ] 《灯火阑珊》
32. [ ] 《阿加莎·克里斯蒂自传》历时15年完成
---

View File

@ -8,6 +8,7 @@ const googleSiteVerification = import.meta.env.PUBLIC_GOOGLE_SITE_VERIFICATION;
export interface Props { export interface Props {
title?: string; title?: string;
subtitle?: string;
author?: string; author?: string;
profile?: string; profile?: string;
description?: string; description?: string;
@ -20,6 +21,7 @@ export interface Props {
const { const {
title = SITE.title, title = SITE.title,
subtitle = SITE.subtitle,
author = SITE.author, author = SITE.author,
profile = SITE.profile, profile = SITE.profile,
description = SITE.desc, description = SITE.desc,
@ -62,10 +64,11 @@ const structuredData = {
<meta name="generator" content={Astro.generator} /> <meta name="generator" content={Astro.generator} />
<!-- General Meta Tags --> <!-- General Meta Tags -->
<title>{title}</title> <title>{title} | {subtitle}</title>
<meta name="title" content={title} /> <meta name="title" content={title + " | " + subtitle} />
<meta name="description" content={description} /> <meta name="description" content={description} />
<meta name="author" content={author} /> <meta name="author" content={author} />
<meta name="keywords" content={SITE.keywords} />
<link rel="sitemap" href="/sitemap-index.xml" /> <link rel="sitemap" href="/sitemap-index.xml" />
<!-- Open Graph / Facebook --> <!-- Open Graph / Facebook -->

View File

@ -16,12 +16,12 @@ import { SITE } from "@/config";
<div class="mb-14 flex flex-col items-center justify-center"> <div class="mb-14 flex flex-col items-center justify-center">
<h1 class="text-9xl font-bold text-accent">404</h1> <h1 class="text-9xl font-bold text-accent">404</h1>
<span aria-hidden="true">¯\_(ツ)_/¯</span> <span aria-hidden="true">¯\_(ツ)_/¯</span>
<p class="mt-4 text-2xl sm:text-3xl">Page Not Found</p> <p class="mt-4 text-2xl sm:text-3xl">页面不见了</p>
<LinkButton <LinkButton
href="/" href="/"
class="my-6 text-lg underline decoration-dashed underline-offset-8" class="my-6 text-lg underline decoration-dashed underline-offset-8"
> >
Go back home 返回首页
</LinkButton> </LinkButton>
</div> </div>
</main> </main>

View File

@ -71,7 +71,7 @@ const recentPosts = sortedPosts.filter(({ data }) => !data.featured);
featuredPosts.length > 0 && ( featuredPosts.length > 0 && (
<> <>
<section id="featured" class="pt-12 pb-6"> <section id="featured" class="pt-12 pb-6">
<h2 class="text-2xl font-semibold tracking-wide">Featured</h2> <h2 class="text-2xl font-semibold tracking-wide">精选文章</h2>
<ul> <ul>
{featuredPosts.map(({ data, id }) => ( {featuredPosts.map(({ data, id }) => (
<Card <Card

View File

@ -35,6 +35,18 @@ async function loadGoogleFonts(
Array<{ name: string; data: ArrayBuffer; weight: number; style: string }> Array<{ name: string; data: ArrayBuffer; weight: number; style: string }>
> { > {
const fontsConfig = [ const fontsConfig = [
{
name: "Noto Sans SC",
font: "Noto+Sans+SC",
weight: 400,
style: "normal",
},
{
name: "Noto Sans SC",
font: "Noto+Sans+SC",
weight: 700,
style: "bold",
},
{ {
name: "IBM Plex Mono", name: "IBM Plex Mono",
font: "IBM+Plex+Mono", font: "IBM+Plex+Mono",