山高水长
首页
  • 分类
  • 标签
  • 归档
友情链接
GitHub (opens new window)

山高水长

首页
  • 分类
  • 标签
  • 归档
友情链接
GitHub (opens new window)
  • 博客搭建记录
    • 安装
    • 个性化
    • 发布
    • 参考文章
  • 优化autoFrontmatter代码
  • 部署到云服务器
  • blog
Shanya
2022-07-21
目录

博客搭建记录

# 博客搭建记录

本博客采用的是基于VuePress (opens new window)的Vdoing (opens new window)主题,配置了自动化工作流程,推送到github即可自动完成部署。

# 安装

可以直接克隆我的博客仓库进行快速配置。

# clone the project
git clone https://github.com/Shanyaliux/Shanyaliux.github.io.git

# enter the project directory
cd Shanyaliux.github.io

# install dependency 注意:如安装不成功请关闭淘宝源。
npm install # or yarn install

# develop
npm run dev # or yarn dev

1
2
3
4
5
6
7
8
9
10
11
12

修改github远程仓库

git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
1
$ git remote -v
# Verify new remote URL
> origin  https://github.com/USERNAME/REPOSITORY.git (fetch)
> origin  https://github.com/USERNAME/REPOSITORY.git (push)
1
2
3
4

# 个性化

  • package.json

    第九行修改为你自己的域名

    "baiduPush": "node utils/baiduPush.js https://shanyaliux.cn && bash baiduPush.sh",
    
    1
  • baiduPush.sh

    更换成你自己的百度站点推送API

    curl -H 'Content-Type:text/plain' --data-binary @urls.txt "YOUR API"
    
    1
  • deploy.sh 和 deploy.ps1

    第七行修改为你自己的域名

    echo 'shanyaliux.cn' > CNAME
    
    1
  • 站点内容修改

​ 参考官方文档:vuepress-theme-vdoing (opens new window)

# 发布

  • 设置Actions secrets

    在博客项目的setting->Security->Secrets->Actions中添加ACCESS_TOKEN,其内容为github生成的token。

    github获取token方法:github获取token官方文档 (opens new window)

​ image-20220721224949636

  • 此后运行部署脚本即可实现博客发布

    bash ./deploy.sh 	# linux
    ./deploy.ps1 		# windows
    
    1
    2

# 参考文章

vuepress官网 (opens new window)

vdoing官网 (opens new window)

编辑 (opens new window)
#blog
上次更新: 2022/09/30, 04:53:04
优化autoFrontmatter代码

优化autoFrontmatter代码→

最近更新
01
FCOS
09-30
02
Python执行终端命令
09-13
03
Android Compose 权限请求
08-12
更多文章>
Theme by Vdoing | Copyright © 2020-2022 Shanya | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式