Hugo Toha 项目教程

Hugo Toha 项目教程

hugo-toha.github.io An example hugo static site with Toha theme. hugo-toha.github.io 项目地址: https://gitcode.com/gh_mirrors/hu/hugo-toha.github.io

1. 项目的目录结构及介绍

hugo-toha.github.io/
├── archetypes/
│   └── default.md
├── assets/
│   ├── css/
│   ├── js/
│   └── images/
├── content/
│   ├── about/
│   ├── blog/
│   ├── projects/
│   └── resume/
├── data/
│   └── config.yaml
├── static/
│   ├── favicon.ico
│   └── robots.txt
├── .gitignore
├── .gitlab-ci.yml
├── hugo_build.lock
├── LICENSE
├── README.md
├── go.mod
├── go.sum
├── hugo.yaml
├── netlify.toml
├── package-lock.json
├── package.hugo.json
└── package.json

目录结构介绍

  • archetypes/: 包含默认的内容模板文件 default.md
  • assets/: 存放项目的静态资源,如 CSS、JavaScript 和图片。
  • content/: 存放网站的内容文件,包括关于页面、博客文章、项目和简历。
  • data/: 存放项目的配置文件 config.yaml
  • static/: 存放静态文件,如网站图标和 robots.txt。
  • .gitignore: Git 忽略文件列表。
  • .gitlab-ci.yml: GitLab CI/CD 配置文件。
  • hugo_build.lock: Hugo 构建锁文件。
  • LICENSE: 项目许可证文件。
  • README.md: 项目说明文件。
  • go.mod: Go 模块依赖文件。
  • go.sum: Go 模块校验文件。
  • hugo.yaml: Hugo 配置文件。
  • netlify.toml: Netlify 配置文件。
  • package-lock.json: npm 锁定文件。
  • package.hugo.json: Hugo 包配置文件。
  • package.json: npm 包配置文件。

2. 项目的启动文件介绍

启动命令

hugo server -w

命令介绍

  • hugo server: 启动 Hugo 开发服务器。
  • -w: 监听文件变化并自动重新加载。

3. 项目的配置文件介绍

hugo.yaml

baseURL: "https://hugo-toha.github.io/"
languageCode: "en-us"
title: "Hugo Toha"
theme: "toha"

配置文件介绍

  • baseURL: 网站的基础 URL。
  • languageCode: 网站的语言代码。
  • title: 网站的标题。
  • theme: 使用的 Hugo 主题,这里是 toha

netlify.toml

[build]
  publish = "public"
  command = "hugo --gc --minify"

[context.production.environment]
  HUGO_VERSION = "0.88.1"
  HUGO_ENV = "production"
  HUGO_ENABLEGITINFO = "true"

配置文件介绍

  • publish: 发布目录,这里是 public
  • command: 构建命令,使用 hugo --gc --minify
  • HUGO_VERSION: Hugo 版本。
  • HUGO_ENV: 环境变量,这里是 production
  • HUGO_ENABLEGITINFO: 启用 Git 信息。

通过以上配置,您可以轻松启动并配置 Hugo Toha 项目。

hugo-toha.github.io An example hugo static site with Toha theme. hugo-toha.github.io 项目地址: https://gitcode.com/gh_mirrors/hu/hugo-toha.github.io

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

卓桔洋

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值