切换风格 ./themes/cactus/_config.yml
中找到 colorscheme
修改就完事
404 页面
文件路径:.src/pages/404.astro
import PageLayout from "@/layouts/Base.astro";
const meta = { description: "哦! 你捕捉到了湮灭物质!", title: "哦!你访问的网站湮灭了!",};---//下面这里修改页面上显示的东西<PageLayout meta={meta}> <h1 class="title mb-6">404 | 物质于风沙中湮灭</h1> <p class="mb-8">沙漠中的风沙湮灭了这次访问</p></PageLayout>
主页页面
文件路径:.src/site.config.ts
//这里修改的是主页上最近博客的日期显示格式export const siteConfig: SiteConfig = { author: "驿站" date: { options: { day: "numeric", month: "short", month: "numeric", year: "numeric", }, }, description: "驿站", lang: "zh-CN", ogLocale: "zh-CN", astro.config.ts L:42 title: "驿站",}
//这里修改的是主页上的标签位置与显示名称,顺次export const menuLinks: { path: string; title: string }[] = [ // 修改:改为中文 { path: "/", title: "主页", }, { path: "/about/", title: "关于", }, { path: "/posts/", title: "博客", }, { path: "/notes/", title: "笔记", },];
文件路径:.src/pages/index.astro
// 下面这个显示的最大最近更新条数const MAX_POSTS = 10;const allPosts = await getAllPosts();const allPostsByDate = allPosts .sort(collectionDateSort) .slice(0, MAX_POSTS) as CollectionEntry<"post">[];
// 下面这个数字是显示的最大笔记条数const MAX_NOTES = 5;const allNotes = await getCollection("note");const latestNotes = allNotes.sort(collectionDateSort).slice(0, MAX_NOTES);
修改主页图标
文件路径:.astro.config.ts
修改图标路径为本地文件,而非@ icones.js.org 图标库
export default defineConfig({ image: { domains: ["webmention.io"], }, integrations: [ expressiveCode(expressiveCodeOptions), icon({ iconDir: "public/icons", //修改:指定自定义图标目录 name = svg文件名 }),
文件路径:.src\components\SocialList.astro
name 后跟 .public\icons
中文件名
const socialLinks: { friendlyName: string; isWebmention?: boolean; link: string; name: string;}[] = [ //这里添加图标名与图标跳转链接 { friendlyName: "Github", link: "https://github.com/Tenadults", name: "github", }, { friendlyName: "BiliBili", link: "https://www.bilibili.com", name: "bilibili-s", },];
测试图床链接
****