win10 本地搭建 docusaurus博客发布github上面

一、安装git

下载地址:Git - Downloading Package

安装完成后生成秘钥之后上车github上面实现本地免秘钥发布项目

git config --global user.name "github用户名"

git config --global user.email "github邮箱"

ssh-keygen -t rsa -C "admin@gmail.com"    # 一路回车下去会在/c/Users/Administrator/.ssh/id_rsa.pub生成公钥 ,之后使用记事本打开复制公钥内容到github上面。

二、安装nodejs

下载地址:https://nodejs.org/dist/v16.14.2/node-v16.14.2-x86.msi

三 、github注册/登录

点击settings-->SSH and GPG keys--->  New ssh key ,复制公钥进去

四、创建github 项目

点击Creating repository 会创建一个项目

五、安装docusaurus到本地 

npx create-docusaurus@latest website classic    

 项目结构

my-website
├── blog
│   ├── 2019-05-28-hola.md
│   ├── 2019-05-29-hello-world.md
│   └── 2020-05-30-welcome.md
├── docs
│   ├── doc1.md
│   ├── doc2.md
│   ├── doc3.md
│   └── mdx.md
├── src
│   ├── css
│   │   └── custom.css
│   └── pages
│       ├── styles.module.css
│       └── index.js
├── static
│   └── img
├── docusaurus.config.js
├── package.json
├── README.md
├── sidebars.js
└── yarn.lock

运行 docusaurus,默认情况下,浏览器将自动打开 http://localhost:3000 的新窗口。

cd my-website
npm run start

六、项目不是github上面

git init
git add .
git remote add origin git@github.com:system/system.git
git commit -m "first commit"
git branch -M main
git push -u origin main
GIT_USER=system yarn deploy

之后访问github主目录文件即可打开个人博客

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

R0ot

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值