Build a Blog
Spaceship
1. 购买域名

2. 添加域名服务器

Facebook Docusaurus
- 创建项目
npx create-docusaurus@latest myblog classic
-
调整配置文件
docusaurus.config.ts -
编译查看报错
npm run build
- 本地构建无误后,
push到 git 仓库
Cloudflare Pages
- 创建 pages 项目

- 配置去自动拉取 git 仓库

Algolia Docsearch
- 安装 docsearch 依赖
npm install @docsearch/docusaurus-adapter
-
创建 API

- 创建爬虫及索引, 爬虫代码选用官方 Docusaurus v2 & v3 模板

- 爬虫代码添加对代码块的检索

content: [
"article p",
"article li",
"article code", // 新增
"article pre code" // 新增
],
- 配置文件中添加创建的 API Key, indexname, Application ID

Picgo
1. 安装插件

2. 配置图床
- 应用ID
- 应用密钥
- 桶名
- 自定义节点 ( AWS S3 API )
- 自定义域名

3. 调整 Picgo 配置文件
{
"picBed": {
"uploader": "aws-s3",
"current": "aws-s3",
"aws-s3": {
"_configName": "blog",
"_id": "xxx",
"_createdAt": 1768649827452,
"_updatedAt": 1768674415888,
"accessKeyID": "",
"secretAccessKey": "",
"bucketName": "桶名",
"uploadPath": "",
"region": "auto",
"endpoint": "填入AWS S3 API",
"proxy": null,
"rejectUnauthorized": true,
"acl": "public-read",
"pathStyleAccess": true,
"outputURLPattern": "",
"urlPrefix": "填入自定义域名",
"urlSuffix": "",
"disableBucketPrefixToURL": false
},
"list": [
{
"type": "tcyun",
"name": "腾讯云COS",
"visible": false
},
{
"type": "aliyun",
"name": "阿里云OSS",
"visible": false
},
{
"type": "smms",
"name": "SM.MS",
"visible": false
},
{
"type": "github",
"name": "GitHub",
"visible": false
},
{
"type": "qiniu",
"name": "七牛云",
"visible": false
},
{
"type": "imgur",
"name": "Imgur",
"visible": false
},
{
"type": "upyun",
"name": "又拍云",
"visible": false
},
{
"type": "aws-s3",
"name": "Amazon S3",
"visible": true
}
]
},
"picgoPlugins": {
"picgo-plugin-s3-lls": true,
"picgo-plugin-rename-file": true
},
"debug": true,
"PICGO_ENV": "GUI",
"settings": {
"server": {
"port": 36677,
"host": "127.0.0.1",
"enable": false
},
"shortKey": {
"picgo:upload": {
"enable": true,
"key": "CommandOrControl+Shift+P",
"name": "upload",
"label": "快捷上传"
}
},
"showUpdateTip": false,
"startupMode": "SHOW_SETTING_WINDOW",
"privacyEnsure": true,
"checkBetaUpdate": false,
"pasteStyle": "markdown",
"rename": false,
"autoRename": false
},
"needReload": false,
"picgo-plugin-rename-file": {
"format": "{hash}{ext}"
},
"uploader": {
"aws-s3": {
"configList": [
{
"_configName": "blog",
"_id": "xxx",
"_createdAt": 1768649827452,
"_updatedAt": 1768674415888,
"accessKeyID": "",
"secretAccessKey": "",
"bucketName": "",
"uploadPath": "",
"region": "auto",
"endpoint": "填入 AWS S3 API",
"proxy": null,
"rejectUnauthorized": true,
"acl": "public-read",
"pathStyleAccess": true,
"outputURLPattern": "",
"urlPrefix": "填入自定义域名",
"urlSuffix": "",
"disableBucketPrefixToURL": false
}
],
"defaultId": "xxx"
}
}
}