We offers an example site for getting started with this theme.
Please run these commands from PowerShell or a Linux terminal such as WSL or Git Bash.
Requirements
- Go
- Hugo extended version
- Node.js
16or later
Read more on prerequisites.
Clone the Repository
1git clone --depth 1 https://github.com/hbstack/theme-cards
Copy the Example Site
1cp -r theme-cards/exampleSite mysite
Change Working Directory
1cd mysite
Tweak go.mod
This guide uses
sed command to edit the file, please feel free to open and edit the go.mod with your favorite editor.
Replace Module Path
The module path is the identifier of your site, which typically is your repo URL, take github.com/user/repo as an example, you’ll need to replace the module github.com/hbstack/theme-cards/exampleSite with module github.com/user/repo.
1sed -i '1s/.*/module github.com\/user\/repo/' go.mod
Delete the replace Directive
To build the site successfully, you’ll need to delete the internal used replace directive: replace github.com/hbstack/theme-cards => ../.
1sed -i '/^replace/d' go.mod
Install Dependencies
1npm ci
Hugo Module Proxy (Optional)
A Hugo module proxy is required when the default proxy isn’t accessible from your location, i.e. China.
Preview Locally
1npm run dev
What’s Next?
- Tweak Configurations, such as
baseURL,giscus.*and so on. - Remove testing content.
- Read the documentation.
- Find more modules.