Keys's stuff Keys's stuff
首页
  • JavaScript
  • CSS
  • 技术文档
  • GitHub
  • Nodejs
  • NPM
  • 博客搭建
  • 学习
  • 面试
  • 心情杂货
  • 实用技巧
  • 友情链接
  • 常用工具 (opens new window)
  • 索引

    • 分类
    • 标签
    • 归档
  • 网站工具参考
  • 常用类库组件
  • HTML参考手册 (opens new window)
  • 后端博客参考 (opens new window)
  • ChatGPT入门介绍 (opens new window)
  • JavaScript 教程 (opens new window)
  • ES6教程 (opens new window)
  • VUE (opens new window)
  • GIT (opens new window)
  • 学习笔记

    • 《JavaScript高级程序设计》
    • 《Vue》
    • 《React》
    • 《TypeScript 从零实现 axios》
    • TypeScript
    • JS设计模式总结
关于
GitHub (opens new window)

Keys Xu

音乐的力量
首页
  • JavaScript
  • CSS
  • 技术文档
  • GitHub
  • Nodejs
  • NPM
  • 博客搭建
  • 学习
  • 面试
  • 心情杂货
  • 实用技巧
  • 友情链接
  • 常用工具 (opens new window)
  • 索引

    • 分类
    • 标签
    • 归档
  • 网站工具参考
  • 常用类库组件
  • HTML参考手册 (opens new window)
  • 后端博客参考 (opens new window)
  • ChatGPT入门介绍 (opens new window)
  • JavaScript 教程 (opens new window)
  • ES6教程 (opens new window)
  • VUE (opens new window)
  • GIT (opens new window)
  • 学习笔记

    • 《JavaScript高级程序设计》
    • 《Vue》
    • 《React》
    • 《TypeScript 从零实现 axios》
    • TypeScript
    • JS设计模式总结
关于
GitHub (opens new window)
  • 技术文档

  • GitHub

  • Nodejs

  • 博客搭建

    • 解决百度无法收录GitHub Pages
    • 使用Gitalk实现静态博客无后台评论系统
    • GitHub + jsDelivr + TinyPNG+ PicGo 打造稳定快速、高效免费图床
    • GitHubPages快速发布
    • vdoing主题效果图
  • VSCode

  • 技术
  • 博客搭建
keys
2022-02-23

GitHubPages快速发布原创

快速发布个人网站到github Pages

// 1.下载 gh-pages 包
npm install -D gh-pages

// 2. 在 package.json 文件上添加脚本命令
"scripts": {
  "docs:dev": "vuepress dev docs",
  "docs:build": "vuepress build docs",
  // 上面我修改了 VuePress 的输出目录,所以您如果没有修改 .vuepress/config.js
  // 的 dest 属性,应该将这里的 dist 改为 .vuepress/dist
  // 注意在使用 gh-pages 的时候请确保你已经添加了 git 远程仓库。
  "deploy": "gh-pages -d dist",
  "deploy:build": "npm run docs:build && gh-pages -d dist"
}

// 3. 打包并推送到 gh-pages 分支
npm run deploy:build

// 4.打开你的 Github pages, 地址是 https://<yourname>/github.io/<repo>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

gh pages详细信息如下

gh-pages@3.2.3 | MIT | deps: 7 | versions: 28
Publish to a gh-pages branch on GitHub (or any other branch on any other remote)
https://github.com/tschaub/gh-pages

bin: gh-pages, gh-pages-clean

dist
.tarball: https://registry.npmmirror.com/gh-pages/-/gh-pages-3.2.3.tgz
.shasum: 897e5f15e111f42af57d21d430b83e5cdf29472c
.integrity: sha512-jA1PbapQ1jqzacECfjUaO9gV8uBgU6XNMV0oXLtfCX3haGLe5Atq8BxlrADhbD6/UdG9j6tZLWAkAybndOXTJg==

dependencies:
async: ^2.6.1           email-addresses: ^3.0.1 find-cache-dir: ^3.3.1  globby: ^6.1.0
commander: ^2.18.0      filenamify: ^4.3.0      fs-extra: ^8.1.0

maintainers:
- markdalgleish <mark.john.dalgleish@gmail.com>
- tschaub <tim.schaub@gmail.com>

dist-tags:
beta: 1.0.0-beta.1  latest: 3.2.3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

发布完成后,会自动把编译之后的dist文件夹push到远程分支的gh-pages 中。

详细的配置参数参考:GitHub gh-pages (opens new window)

最后在github 中配置相关的仓库信息即可。

参考资料:

npm的gh-pages结合github发布repository网站 (opens new window)

VuePress 快速踩坑 (opens new window)

GitHub gh-pages (opens new window)

编辑 (opens new window)
#gh-pages
上次更新: 2022/02/23, 18:17:51
GitHub + jsDelivr + TinyPNG+ PicGo 打造稳定快速、高效免费图床
vdoing主题效果图

← GitHub + jsDelivr + TinyPNG+ PicGo 打造稳定快速、高效免费图床 vdoing主题效果图→

最近更新
01
2023工作展望xx
02-13
02
2023工作展望
02-13
03
程序员技术指南
01-18
更多文章>
Theme by Vdoing | Copyright © 2019-2023 Keys Xu | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式