Hexo个人博客搭建

本文最后更新于:几秒前


Hexo个人博客搭建

$a+b=c$
$\boldsymbol{E}{top}^{inc}exp\left(i\big(k_x^{inc}x+k{z~top}^{inc}(z-h)\big)\right)$

本站用开源软件Hexo 和Github搭建的静态博客,主题用的是butterfly

一款 Material Design 风格的 Hexo 主题 / An elegant Material-Design theme for Hexo



  1. 安装nodejs、git

  2. 在文件夹中右击 Git Bash Here

  3. 常用npm命令,安装Hexo博客,输入:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    npm install -g hexo-cli # 安装hexo可略过
    hexo init
    hexo new 我的新博客
    hexo g #生成
    hexo s #启动服务预览
    localhost:4000 # 打开浏览器输入地址

    git config --global user.name "仓库名"
    git config --global user.email "邮箱"
    npm install hexo-deployer-git --save # 安装上传文件
    npm install hexo-renderer-pug hexo-renderer-stylus # 安装 butterfly插件
    npm install hexo-generator-index-pin-top --save # 文章置顶插件
    npm install hexo-hide-posts --save # 隐藏文章
    hexo d #部署
    hexo c #清除缓存,若是网页正常情况下可以忽略这条命令
    1
    2
    3
    4
    5
    $ ssh-keygen -t rsa -C "邮箱"
    # 创建一个 ssh key, 用准备好的email作为标签
    Generating public/private rsa key pair.
    Enter file in which to save the key (/c/Users/you/.ssh/id_rsa): [Press enter]

  4. 配置网站

进入根目录里的themes文件夹,里面也有个_config.yml文件

1
2
3
4
deploy:
type: git
repo: git@github.com:仓库名/仓库名.github.io.git
branch: main

博客顶部设置:

1
2
3
4
5
6
7
8
9
10
11
12
13
---
title: Hexo个人博客搭建 # 文章标题
tags: [Gridea,Hexo,Python] # 文章标签
published: true
hideInList: false
isTop: true # 置顶箭头
abbrlink: 20929
date: 2023-03-14 10:19:08 #博客时间
feature:
sticky: 101
top: 101 # 越大越靠前
category: Hexo # 分类 category
---

打开–终端–新建终端

1
2
3
4
5
6
git add .
git commit -m "github action update"
git push origin main
git push -f origin main # 强制推送

git add . ;git commit -m "github action update";git push origin main

$a+b=c$


Hexo个人博客搭建
http://example.com/Hexo个人博客搭建/
作者
John Doe
发布于
2023年3月18日
更新于
2024年4月26日
许可协议