Skip to content

jianye0428/JianBlog

Repository files navigation

Jian's Blog

Hugo License Hugo build and deploy GitHub commit activity (main)

blog-flow

Directory structure

▸ .github/       # GitHub configuration
▸ .scripts/      # custom scripts
▸ .shell/        # shell commands for hugo project, entrance: hugo_main.sh
▸ archetypes/    # page archetypes (like scaffolds of archetypes)
▸ assets/        # css, js, third-party libraries etc.
▸ config/        # configuration files
▸ content/       # markdown files for hugo project
  ▸ private/     # private submodule for encrypted content
▸ data/          # blog data (allow: yaml, json, toml), e.g. friends.yml
▸ public/        # build directory
▸ static/        # static files, e.g. favicon.ico
▸ themes/        # theme submodules

Quick Start

只需根据操作系统(Windows、Linux、macOS)安装最新版本的 Hugo(>= 0.109.0)

git clone --recursive git@github.com:Lruihao/hugo-blog.git

有两种方法可以启动这个博客。

NPM

npm install
# build the blog
npm run build
# run a local debugging server with watch
npm run server
# run a local debugging server in production environment
npm run server:production
# update theme submodules
npm run update:theme

如果没有全局安装 Hugo,甚至可以通过 npm install hugo-bin --save-dev 来安装一个 Hugo 的包装器。

package.json 需配置 extended 版本:

{
  ...
  "hugo-bin": {
    "buildTags": "extended"
  }
}

再通过 npx hugo 启动。

Hugo

# Development environment
hugo server --disableFastRender --navigateToChanged --bind 0.0.0.0
# Production environment
hugo server --disableFastRender --navigateToChanged --environment production --bind 0.0.0.0

此外,还可以运行 hugo_main.sh 来选择常用的 Hugo 命令:

cd .shell && sh hugo_main.sh
--------------Hugo Admin--------------
Please enter the serial number to work
--------------------------------------
1. post
2. server
3. server:production
4. build
5. submodule-sync
6. push
--------------------------------------
Press Ctrl+C to stop

作者

Lruihao

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published