Giter Club home page Giter Club logo

hexo-pages's Introduction

Hexo

使用 Hexo + GitHub Pages 搭建一个静态网站

官方网址:https://hexo.io/zh-cn/

官方文档:https://hexo.io/zh-cn/docs/

安装 Node.js

注意:

  • (Node.js 版本需不低于 10.13,建议使用 Node.js 12.0 及以上版本)
  • 使用 Node.js 官方安装程序时,请确保勾选 Add to PATH 选项(默认已勾选)

下载地址:https://nodejs.org/en/download

具体安装步骤:略

安装 Git

下载地址:https://git-scm.com/download/

具体安装步骤:略

安装 Hexo

# 设置淘宝源
npm config set registry https://registry.npmmirror.com
# 安装 Hexo
npm install -g hexo-cli

使用 Hexo

hexo init hexo-pages
cd hexo-pages
npm install
hexo server

source\_post 文件下,编写 markdown 文档即可,文件名称推荐使用简单的英文表示。

如果有图片等资源,可以放在 source/images 下,使用![](/images/image.jpg) 的方法访问它们。

部署 hexo

在 GitHub Pages 部署 Hexo

或者使用以下自动化方法部署:

1、安装 hexo-deployer-git

npm install hexo-deployer-git --save

2、修改 _config.yml 配置文件

deploy:
  type: git
  repo: https://github.com/<username>/<project>
  # example, https://github.com/hexojs/hexojs.github.io
  branch: main

记得修改 _config.yml 为你的真实域名:https://username.github.io/project

3、执行 hexo clean && hexo deploy

4、浏览 <GitHub 用户名>.github.io 检查你的网站能否运作。

hexo-pages's People

Watchers

BBigSun avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.