最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

細(xì)致講解如何用hexo+github配置一個(gè)可以建在分目錄下的個(gè)人博客(2023版)

2023-01-23 12:26 作者:蜉蝣_Adonis  | 我要投稿

提示:本文所有使用到的軟件均已放置在網(wǎng)盤中,可以直接下載

1.下載并安裝Node.js git

Node.js安裝地址:https://nodejs.org/zh-cn/

Windows系統(tǒng)下的安裝地址:https://git-scm.com/download/windows

macOS系統(tǒng)下的安裝地址:https://git-scm.com/download/mac

(macOS系統(tǒng)會(huì)自帶git,版本低一點(diǎn)但也夠用了)

在cmd/終端中進(jìn)行指令輸入

node -v來(lái)檢測(cè)Node.js是否安裝成功

返回:

`v18.13.0`

git --version來(lái)檢測(cè)git是否安裝成功

返回:

`git version 2.37.1 (Apple Git-137.1)`

2.生成SSH密鑰

輸入指令

ssh-keygen -t rsa -C "user@email.com"(這里換成你注冊(cè)github的郵箱)

返回:

`` Generating public/private rsa key pair.

`` Enter file in which to save the key (/Users/Adonis142857/.ssh/id_rsa):?

`` Created directory '/Users/Adonis142857/.ssh'.

接下來(lái)的passphrase可以直接留空

`` Enter passphrase (empty for no passphrase):?

`` Enter same passphrase again:?

`` Your identification has been saved in /Users/Adonis142857/.ssh/id_rsa

`` Your public key has been saved in /Users/Adonis142857/.ssh/id_rsa.pub

`` The key fingerprint is:

打開上方目錄中生成的文件'id_rsa.pub'

Ctrl+a/?+a進(jìn)行全文選中

Ctrl+c/?+c進(jìn)行全文拷貝

3.進(jìn)入github.com并登錄

點(diǎn)擊右上角人物頭像
點(diǎn)擊Settings
點(diǎn)擊SSH and GPG keys
點(diǎn)擊New SSH Key
在Title中輸入你的github用戶名,Key中輸入剛才在id_rsa.pub中復(fù)制到的字符串

4.安裝hexo

依賴安裝慢點(diǎn)可以使用鏡像

指令如下

清空代理

npm config set proxy null

清理緩存

npm cache clean --force

重新設(shè)置鏡像源

npm config set registry https://registry.npm.taobao.org

用指令cd進(jìn)入要安裝hexo的目錄

例:

cd? /Users/Adonis142857/Documents/website/blog

使用指令

sudo npm install hexo-cli -g

安裝完后使用指令

hexo init blog

安裝完后進(jìn)入目錄?

cd blog

使用指令安裝依賴

npm install

安裝完后可以使用指令

hexo s?

在本地頁(yè)面上查看效果

在瀏覽器中進(jìn)入地址localhost:4000即可查看博客界面

5.創(chuàng)建用于儲(chǔ)存博客的儲(chǔ)存庫(kù)

進(jìn)入網(wǎng)站github.com

點(diǎn)擊New

在其中配置Repository name

這里分兩種

(1)希望在username.github.io打開自己博客

那么就在Repository name中填寫username.github.io(要換成自己的github用戶名)

例:

希望在Adonis142857.github.io打開自己博客

那么就在Repository name中填寫Adonis142857.github.io

(2)希望在username.github.io/Repository name中打開自己博客(即建在分目錄的博客)

那么就在Repository?name中填寫自己想要建的分目錄名稱

例:

希望在Adonis142857.github.io/blog中打開自己博客

那么就在Repository?name中填寫blog

配置完后點(diǎn)擊Create repository


6.將hexo界面發(fā)布到github上

打開blog文件夾下的_config.yml文件

改三個(gè)地方

肯定要把作者改成自己了(

改動(dòng)url:

(1)希望在username.github.io打開自己博客

那么就改成url: https://username.github.io

例:

url: https://Adonis142857.github.io

(2)希望在username.github.io/Repository name中打開自己博客(即建在分目錄的博客)

那么就改成url: https://username.github.io/Repository name

例:

url: https://Adonis142857.github.io/blog

這里type和branch按照?qǐng)D片進(jìn)行填寫就可以

repo還是要分兩種情況進(jìn)行改動(dòng)

(1)希望在username.github.io打開自己博客

那么就改成repo: git@github.com:username/username.github.io.git

例:

repo: git@github.com:Adonis142857/Adonis142857.github.io.git

(2)希望在username.github.io/Repository name中打開自己博客(即建在分目錄的博客)

那么就改成repo: git@github.com:username/Repository name.git

例:

repo: git@github.com:Adonis142857/blog.git

修改完成后用Ctrl+s/?+s進(jìn)行保存

使用指令安裝插件

npm install hexo-deployer-git --save

使用指令配置git的郵箱和用戶名

git config --global user.email "user@email.com"

git config --global user.name "username"

(都要改成自己的郵箱和用戶名哦)

接下來(lái)輸入三個(gè)指令

hexo clean

hexo generate

hexo deploy

然后你的博客就已經(jīng)被成功推送到github上了

可以去看看哦

細(xì)致講解如何用hexo+github配置一個(gè)可以建在分目錄下的個(gè)人博客(2023版)的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
罗平县| 遂昌县| 武穴市| 满城县| 贵南县| 兖州市| 石泉县| 苗栗市| 安阳县| 天等县| 石屏县| 高陵县| 华亭县| 图木舒克市| 上虞市| 余干县| 社旗县| 卫辉市| 怀来县| 乐安县| 井冈山市| 城市| 泰兴市| 灵寿县| 保德县| 乐清市| 鸡泽县| 长治县| 义乌市| 扶绥县| 石嘴山市| 防城港市| 宽城| 通辽市| 青冈县| 水富县| 米脂县| 莱阳市| 浏阳市| 隆化县| 铁岭县|