958 字
5 分钟
Fuwari静态博客搭建教程

你需要准备的#

  1. 一个high iQ的脑子,遇到问题会问AI

  2. 要有一点点的编程基础

  3. 安装Node.js

  4. 注册github账号

  5. 安装一个源代码编辑器像visual studio code

正式开始#

  1. 下载Fuwari博客的仓库的压缩包:https://github.com/saicaca/fuwari

  2. 解压

  3. 安装pnpm:打开cmd运行npm install -g pnpm

  4. 在项目根目录打开cmd运行:pnpm installpnpm add sharp

  5. 成功本地部署Fuwari

改写Fuwari的示例信息和示例文章#

  1. 在根目录的 src 文件夹中,找到 config.ts 改写示例信息

  2. 这是我的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: 345
      fixed: false, // Hide the theme color picker for visitors
      forceDarkMode: 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 default
      credit: {
      enable: true, // Display the credit text of the banner image
      text: "Pixiv @chokei", // Credit text to be displayed
      url: "https://www.pixiv.net/artworks/122782209", // (Optional) URL link to the original artwork or artist's page
      },
      },
      background: {
      enable: true, // Enable background image
      src: "/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 post
      depth: 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 added
      external: 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",
      };
  3. 在根目录下的 src/content/posts 文件夹中有示例文章,文章介绍了一些md语法和技巧,将其保存到别处or删除

开始写文章#

  1. 在项目根目录执行:pnpm new-post <文章标题>

  2. 在项目根目录下的 src/content/posts 文件夹中会多出一个 xxx.md文件

  3. 打开它

    title: xxx //title:文章标题
    published: 2025-10-1 //published:文章创建时间
    description: '' //文章描述,显示在文章标题下方
    image: '' //封面图
    tags: [] //文章标签
    categories: '' //文章分类
    draft: false
    lang: ''

本地预览,然后部署在Netlify上#

  1. 本地预览:在项目根目录执行:pnpm dev后,打开浏览器进入http://localhost:4321/

  2. 打包项目:在项目根目录执行:pnpm build后,在根目录形成一个dist文件夹,里面就是打包好的项目。

  3. 部署Netlify,在浏览器打开https://app.netlify.com/,登录你的Github账号,把打包好的项目直接移进首页就行了。

  4. 部署完成后,Netlify 会生成一个临时 URL,你可以通过该链接访问网站。

  5. 在 Netlify 仪表板中,进入站点设置。添加自定义域名,并更新 DNS 设置以指向 Netlify 提供的地址。

到这里,你已经成功搭建了你的个人博客😍#

Fuwari静态博客搭建教程
https://ygdsndblog.netlify.app/posts/fuwari/
作者
ygdsnd
发布于
2025-09-13
许可协议
CC BY-NC-SA 4.0