958 字
5 分钟
Fuwari静态博客搭建教程
你需要准备的
-
一个
high iQ的脑子,遇到问题会问AI -
要有一点点的编程基础
-
安装
Node.js -
注册
github账号 -
安装一个源代码编辑器像
visual studio code
正式开始
-
下载Fuwari博客的仓库的压缩包:https://github.com/saicaca/fuwari

-
解压
-
安装pnpm:打开cmd运行
npm install -g pnpm -
在项目根目录打开cmd运行:
pnpm install和pnpm add sharp -
成功本地部署Fuwari
改写Fuwari的示例信息和示例文章
-
在根目录的
src文件夹中,找到config.ts改写示例信息 -
这是我的
config.ts参考-
import type {ExpressiveCodeConfig,ImageFallbackConfig,LicenseConfig,NavBarConfig,ProfileConfig,SiteConfig,UmamiConfig,} from "./types/config";import { LinkPreset } from "./types/config";export const siteConfig: SiteConfig = {title: "ygdsnd Blog",description:"分享内网穿透、静态网站搭建等的个人博客",keywords: [],lang: "zh_CN", // 'en', 'zh_CN', 'zh_TW', 'ja', 'ko', 'es', 'th'themeColor: {hue: 220, // Default hue for the theme color, from 0 to 360. e.g. red: 0, teal: 200, cyan: 250, pink: 345fixed: false, // Hide the theme color picker for visitorsforceDarkMode: false, // Force dark mode and hide theme switcher},banner: {enable: false,src: "/xinghui.avif", // Relative to the /src directory. Relative to the /public directory if it starts with '/'position: "center", // Equivalent to object-position, only supports 'top', 'center', 'bottom'. 'center' by defaultcredit: {enable: true, // Display the credit text of the banner imagetext: "Pixiv @chokei", // Credit text to be displayedurl: "https://www.pixiv.net/artworks/122782209", // (Optional) URL link to the original artwork or artist's page},},background: {enable: true, // Enable background imagesrc: "/background.jpg", // Background image URL (supports HTTPS)position: "center", // Background position: 'top', 'center', 'bottom'size: "cover", // Background size: 'cover', 'contain', 'auto'repeat: "no-repeat", // Background repeat: 'no-repeat', 'repeat', 'repeat-x', 'repeat-y'attachment: "fixed", // Background attachment: 'fixed', 'scroll', 'local'opacity: 0.5, // Background opacity (0-1)},toc: {enable: true, // Display the table of contents on the right side of the postdepth: 2, // Maximum heading depth to show in the table, from 1 to 3},favicon: [// Leave this array empty to use the default favicon{src: "https://picui.cn/thumbnails/999b613e0650a058c527d40b3c236bb7.png", // Path of the favicon, relative to the /public directory// theme: 'light', // (Optional) Either 'light' or 'dark', set only if you have different favicons for light and dark mode// sizes: '32x32', // (Optional) Size of the favicon, set only if you have favicons of different sizes},],};export const navBarConfig: NavBarConfig = {links: [LinkPreset.Home,LinkPreset.Archive,LinkPreset.About,{name: "个人主页",url: "https://ygdsnd.github.io", // Internal links should not include the base path, as it is automatically addedexternal: true, // Show an external link icon and will open in a new tab},],};export const profileConfig: ProfileConfig = {avatar: "https://picui.cn/thumbnails/1c4df8c405b2dd1983b2ac4672922ecf.png", // Relative to the /src directory. Relative to the /public directory if it starts with '/'name: "ygdsnd",bio: "一个普通人",links: [{name: "Bilibli",icon: "fa6-brands:bilibili",url: "https://space.bilibili.com/1210398385",},{name: "GitHub",icon: "fa6-brands:github",url: "https://github.com/ygdsnd",},],};export const licenseConfig: LicenseConfig = {enable: true,name: "CC BY-NC-SA 4.0",url: "https://creativecommons.org/licenses/by-nc-sa/4.0/",};export const imageFallbackConfig: ImageFallbackConfig = {enable: false,originalDomain: "",fallbackDomain: "",};export const umamiConfig: UmamiConfig = {enable: false,baseUrl: "",shareId: "",timezone: "",};export const expressiveCodeConfig: ExpressiveCodeConfig = {theme: "github-dark",};
-
-
在根目录下的
src/content/posts文件夹中有示例文章,文章介绍了一些md语法和技巧,将其保存到别处or删除
开始写文章
-
在项目根目录执行:
pnpm new-post <文章标题> -
在项目根目录下的
src/content/posts文件夹中会多出一个xxx.md文件 -
打开它
title: xxx //title:文章标题published: 2025-10-1 //published:文章创建时间description: '' //文章描述,显示在文章标题下方image: '' //封面图tags: [] //文章标签categories: '' //文章分类draft: falselang: ''
本地预览,然后部署在Netlify上
-
本地预览:在项目根目录执行:
pnpm dev后,打开浏览器进入http://localhost:4321/ -
打包项目:在项目根目录执行:
pnpm build后,在根目录形成一个dist文件夹,里面就是打包好的项目。 -
部署Netlify,在浏览器打开
https://app.netlify.com/,登录你的Github账号,把打包好的项目直接移进首页就行了。 -
部署完成后,Netlify 会生成一个临时 URL,你可以通过该链接访问网站。
-
在 Netlify 仪表板中,进入站点设置。添加自定义域名,并更新 DNS 设置以指向 Netlify 提供的地址。
到这里,你已经成功搭建了你的个人博客😍
Fuwari静态博客搭建教程
https://ygdsndblog.netlify.app/posts/fuwari/