Skip to content
View nlrvana's full-sized avatar

Block or report nlrvana

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
nlrvana/README.md

Hugo FixIt 博客模板(Go)

👉 中文 | English

这是 Hugo 主题 FixIt 的快速启动模板。它使用 Hugo 模块 功能加载主题。

它提供了基本的主题结构和配置。已经设置了 GitHub Actions,可以自动部署博客到 GitHub Pages。此外,还有一个定时任务,每天自动更新主题。

目录结构

▸ .github/       # GitHub configuration
▸ archetypes/    # page archetypes (like scaffolds of archetypes)
▸ assets/        # css, js, third-party libraries etc.
▸ config/        # configuration files
▸ content/       # markdown files for hugo project
▸ data/          # blog data (allow: yaml, json, toml), e.g. friends.yml
▸ public/        # build directory
▸ static/        # static files, e.g. favicon.ico
▸ themes/        # theme submodules
▸ go.mod
▸ go.sum

快速入门

完整的快速入门,请参阅此 页面

准备

使用模板

  1. 点击 Use this template,在 GitHub 上创建你的存储库。

    image
  2. 存储库创建后,只需克隆并享受吧!

    # 使用你自己的存储库 URL 进行克隆
    git clone --recursive https://github.com/<your_name>/<your_blog_repo>.git

Tip

仓库名决定了你的 GitHub Pages URL,例如:

仓库名 GitHub Pages
<your_name>.github.io https://<your_name>.github.io/
blog https://<your_name>.github.io/blog/

启动站点

# 开发环境
hugo server
# 生产环境
hugo server -e production

构建站点

当你的站点准备部署时,运行以下命令:

hugo

部署到 GitHub Pages

Note

聪明的你可能已经注意到,模板初始化后的第一次 GitHub Actions 自动部署失败了。这是因为你还没有配置 Workflow 权限和 GitHub Pages。

  1. 转到 Setting => Actions => General => Workflow permissions => 选中 "Read and write permissions"。
  2. GitHub Pages 设置:Setting => Pages => Source: GitHub Actions。
  3. 修改 config/_default/hugo.toml 文件中的 baseURL 为你的站点 URL。
  4. 提交上一步的修改到 main 分支,GitHub Actions 将自动打包并部署站点到 GitHub Pages。

更新主题

之后,你可以使用以下命令升级主题:

# 手动更新主题
hugo mod get -u github.com/hugo-fixit/FixIt@latest
hugo mod tidy
通过 NPM 脚本启动
# 构建博客
npm run build
# 运行带有监视的本地调试服务器
npm run server
# 在生产环境中运行本地调试服务器
npm run server:production
# 更新主题子模块
npm run update:theme

故障排除

remote: Permission to git denied to github-actions[bot]. 转到 Setting => Actions => General => Workflow permissions => 选中 "Read and write permissions"。

Popular repositories Loading

  1. nlrvana.github.io nlrvana.github.io Public

    HTML 6 2

  2. codes codes Public

    HTML

  3. ShortPayload ShortPayload Public

    Forked from freeFV/ShortPayload

    如何将Java反序列化Payload极致缩小

    Java

  4. JNDI-Injection-Exploit-Plus JNDI-Injection-Exploit-Plus Public

    Forked from cckuailong/JNDI-Injection-Exploit-Plus

    80+ Gadgets(30 More than ysoserial). JNDI-Injection-Exploit-Plus is a tool for generating workable JNDI links and provide background services by starting RMI server,LDAP server and HTTP server.

    Java

  5. Nlrvana Nlrvana Public

    N1Rvana's New Blog

    JavaScript