跳过正文

Getting Started

首次發表:

Prerequisites

  1. Install Hugo extended version, the minimum version is v0.161.0.
  2. Install Git version manager.
  3. (Optional) Install Go if you want to install Yore using Hugo module instead of Git submodule.

Installing Yore

Pick one of these two ways to set up both components.

Git Submodule

This is the recommended method. Start by creating a new site:

hugo new site my-site --format yaml
cd my-site

Then, add both components:

git init
git submodule add https://github.com/ZhenShuo2021/hugo-yore themes/hugo-yore
git submodule add https://github.com/ZhenShuo2021/hugo-knowledge-graph themes/hugo-knowledge-graph

Hugo Module

注释

You must have Go (version 1.25+) installed for this method.

Create your site:

hugo new site my-site --format yaml
cd my-site

Initialize your site as a module:

hugo mod init github.com/yourusername/my-site

Add this to hugo.yaml:

module:
  imports:
    - path: github.com/ZhenShuo2021/hugo-yore
    - path: github.com/ZhenShuo2021/hugo-knowledge-graph

Download both components:

hugo mod get -u

Basic Configuration

The Yore theme can be initialized with a minimal configuration. To enable the theme, add the following line:

hugo.yaml
theme: ["hugo-knowledge-graph", "hugo-yore"]  # this is not required if you use Hugo Module

It is highly recommended starting with the Reference Configuration. It provides preconfigured settings that allow you to focus on content creation immediately, bypassing the need for manual configuration.


Launch Your Site

With the theme installed, let's see how it looks. First, create some sample pages:

hugo new content/en/blog/_index.md
hugo new content/en/blog/first/index.md
hugo new content/en/blog/second/index.md

Start the development server:

hugo server -D

The -D flag includes draft posts. The browser reloads automatically on file save. Press Ctrl+C to stop.

View the site at http://localhost:1313/ and posts at http://localhost:1313/posts/.

Update Yore

Git submodule

git submodule update --remote --merge

Hugo module

hugo mod get -u

文章关联