Skip to content

Lruihao/hugo-blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

菠菜眾長

Hugo Hugo build and deploy GitHub commit activity (main)

站名“菠菜眾長”,取“兼收並蓄,博採眾長”之意。

博客基于 HugoFixIt 搭建,建站的初衷不是为了炫耀所知,而是记录无知。

博客内容主要以 Web 前端开发方向为主,分享一些有趣程序、技巧、开发教程、心情和学习记录等。

你可以通过我的微信公众号GitHubRSS 来订阅本博客。

blog-preview

Content

Project setup

本博客已部署到 VercelGitHub Pages,工作流如下图所示:

blog-flow

▸ .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

System requirements

Clone

首先点上 Star 😜,然后下载源码:

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

下载源码后,有两种方法可以启动这个博客。

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,甚至可以通过 hugo-bin 在 Node.js 环境下使用 Hugo。

参考:hugo-bin

npm install hugo-bin --save-dev

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
此外,还可以运行 shell 脚本来选择常用的 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

License

Content License License

  • 此存储库中的文本、图像和视频等内容采用 CC BY-NC-SA 4.0 许可
  • 此存储库中的代码采用 MIT 许可
  • content/private 目录不在任何许可范围内

Author

Lruihao