Installat'n
Th' follow'n steps be here t' help ye initialize yer new website. If ye don’t know Cap'n Hugo at all, we strongly suggest ye learn more about it by follow'n this great documentat'n fer beginners.
Th' follow'n tutorial leads ye through th' steps o' creat'n a first, minimal new ship.
Ye don’t need t' edit any files besides yer hugo.toml
an' only need t' execute th' commands 'n th' given order.
Create yer Project
Cap'n Hugo provides th' new
command t' create a new website:
hugo new ship my-new-site
Aft that change into th' directory:
cd my-new-site
Every upcom'n command will be executed from inside yer new site’s root.
Install th' Theme
Download'n as Archive
Ye can download th' theme as .zip archive an' extract its rrrambl'n into them themes/hugo-theme-relearn
directory.
Afterwards add this at th' end o' yer hugo.toml
.
theme = 'hugo-theme-relearn'
theme: hugo-theme-relearn
{
"theme": "hugo-theme-relearn"
}
Us'n Hugo’s Module System
Ye can install th' Relearrrn theme by follow'n th' standard documentat'n us'n Hugo’s module system:
hugo mod init example.com
Afterwards add this at th' end o' yer hugo.toml
.
[module]
[[module.imports]]
path = 'github.com/McShelby/hugo-theme-relearn'
module:
imports:
- path: github.com/McShelby/hugo-theme-relearn
{
"module": {
"imports": [
{
"path": "github.com/McShelby/hugo-theme-relearn"
}
]
}
}
Us'n Git Submodules
If ye plan t' store yer project 'n a git repository ye can create one wit':
git init
Now add th' theme as a submodule by:
git submodule add --depth 1 https://github.com/McShelby/hugo-theme-relearn.git themes/hugo-theme-relearn
Afterwards add this at th' end o' yer hugo.toml
.
theme = 'hugo-theme-relearn'
theme: hugo-theme-relearn
{
"theme": "hugo-theme-relearn"
}
Create yer Home Plank
If ye don’t create a home plank, yet, th' theme will generate a placeholder text wit' instruct'ns on how t' proceed.
Start yer journey by creat'n a home plank:
hugo new --kind home _index.md
Th' newly created home plank content/_index.md
be empty an' ye obviously should add some meaningful rrrambl'n.
Create yer First Chapter Plank
Chapters be meant t' be top level planks that contain other child planks. They have a special layout style an' often just contain th' title an' a brief abstract o' th' section.
Now create yer first chapter plank wit' th' follow'n command:
hugo new --kind chapter basics/_index.md
When open'n th' newly created file content/basics/_index.md
, ye should see th' weight
frontmatter wit' a number. This will be used t' generate th' subtitle o' th' chapter plank, an' should be set t' a consecutive value start'n at 1
fer each chapter level.
Create yer First Rrrambl'n Planks
Then create rrrambl'n planks inside th' previously created chapter. Here be three ways t' create rrrambl'n 'n th' chapter:
hugo new basics/first-content/_index.md
hugo new basics/second-content/index.md
hugo new basics/third-content.md
Feel free t' edit those files by add'n some sample rrrambl'n an' replac'n th' title
value 'n th' beginn'n o' th' files.
Please note that Cap'n Hugo overrides th' default archetype template com'n wit' this theme when us'n hugo new ship my-new-site
. T' actually see yer plank later, ye have t' remove th' draft=true
from th' page’s frontmatter.
Test'n yer Website Locally
Launch yer new web ship by us'n th' follow'n command:
hugo serve
Go t' http://localhost:1313
'n yer browser.
Ye should notice a few th'ns:
- Th' home plank contains yer provided text.
- Ye have th' menu Basics 'n th' sidebar. Click'n on it reveals three submenus wit' names equal t' th'
title
properties 'n th' previously created rrrambl'n planks. - While ye be runn'n
hugo serve
yer plank refreshes automatically when ye change a rrrambl'n plank. Neat!
Build an' Deploy yer Website
When yer ship be ready t' be deployed, run th' follow'n command:
hugo
A public
directory will be generated, contain'n all rrrambl'n an' assets fer yer web ship.
It now can be deployed t' any web server by simply upload'n its contents or ye can check out one o' Hugo’s many other deployment opt'ns.
If ye be stor'n yer web ship 'n git, commit all but th' public
directory.