Prerequisites

You should install the following softwares before start:

Steps

Init a new site

BASH
1hugo new site my-site --format=yaml
Click to expand and view more

Add hugo narrow as a git submodule

BASH
1cd my-site
2git init
3git submodule add https://github.com/tom2almighty/hugo-narrow.git themes/hugo-narrow
Click to expand and view more

Copy example site files

Copy all files of ~/themes/hugo-narrow/exampleSite/ to the root folder of the site.

Make sure the configuration at ~/config/_default/hugo.yaml is right: theme: hugo-narrow.

Localhost preview

BASH
1hugo server --buildDrafts --disableFastRender
Click to expand and view more

Visit http://localhost:1313 see your new site.

Update theme

To update ALL submodule, use the command:

BASH
1git submodule update --remote --recursive
Click to expand and view more

To update theme submodule, use the command:

BASH
1git submodule update --remote --recursive themes/hugo-narrow
Click to expand and view more

Copyright Notice

Author: Hugo Narrow

Link: https://hugo-narrow-docs.vercel.app/docs/git-submodule/

License: 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.

Start searching

Enter keywords to search articles

↑↓
ESC
⌘K Shortcut