安装要求

在开始之前,你需要安装以下软件:

步骤

初始化新的站点

BASH
1hugo new site my-site --format=yaml
点击展开查看更多

将 Hugo Narrow 添加为 Git 子模块

BASH
1cd my-site
2git init
3git submodule add https://github.com/tom2almighty/hugo-narrow.git themes/hugo-narrow
点击展开查看更多

复制示例站点配置

~/themes/hugo-narrow/exampleSite/ 下的内容复制到站点根目录下。

确保 ~/config/_default/hugo.yaml 中主题配置正确: theme: hugo-narrow

本地预览

BASH
1hugo server --buildDrafts --disableFastRender
点击展开查看更多

访问 http://localhost:1313 查看预览站点。

更新主题

更新仓库所有子模块,使用命令:

BASH
1git submodule update --remote --recursive
点击展开查看更多

更新主题子模块,使用命令:

BASH
1git submodule update --remote --recursive themes/hugo-narrow
点击展开查看更多

版权声明

作者: Hugo Narrow

链接: https://hugo-narrow-docs.vercel.app/zh-cn/docs/git-submodule/

许可证: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Please attribute the source, use non-commercially, and maintain the same license.

开始搜索

输入关键词搜索文章内容

↑↓
ESC
⌘K 快捷键