perfect!!
With some pre-requisites out of the way, lets jump in at the first step in the theme setup:
$ mkdir newProject
$ cd newProject
$ mkdir themes
$ cd themes
$ git clone https://github.com/dldx/hpstr-hugo-theme.git hpstr
and you will see hpster
located in: /web-work/themes/hpstr
.
Once you have the newProject/themes/hpstr
you’ll find the folder exampleSite
in the hpstr
directory.
Just Copy the contents of exampleSite
to the root of newProject
, and test to see if it will run.
$ hugo
It should print something like this:
Started building sites ...
Built site for language en:
0 draft content
0 future content
0 expired content
10 pages created
0 non-page files copied
15 paginator pages created
9 tags created
0 categories created
total in 100 ms
Unless you get that print-out, don’t bother changing your whole sites configuration just yet.
Make sure you placed the contents of exampleSite
into the root of your project directory, and that your directories are structured properly.
If you did everything right and it still won’t build, then I would shop around to different releases in that same time period to see if I could get one to work.
Just to be sure! I’ll test the server, also, and see that I get a website.
$ hugo server
Started building sites ...
Built site for language en:
0 draft content
0 future content
0 expired content
10 pages created
0 non-page files copied
15 paginator pages created
9 tags created
0 categories created
total in 61 ms
Watching for changes in /newProject/ {data,content,static,themes}
Yay!!!
Now, it’s simply moving over the content, and swapping out some frontmatter, and configuration formating.
Posts are stored in the content directory. By default, only content in the
content/posts
will show up in theAll Posts
section, however, you can link to other sections manually. For example, if you create a post atgallery/photo1.md
, your post will appear both under the home page and under /gallery.
In Hugo-HPSTR-Theme, it’s all about your directory structure.
You’ll notice that your root directory mirrors the themes directory structure, because the theme always keeps a backup file of everything necessary to function.
I entered some tags and categories:
web-work/themes/hpstr/archetypes/default.md
+++
Description = ""
Tags = ["resources", "web-work"]
Categories = ["howto", "tools"]
menu = "main"
+++
From YAML to TOML
In the theme
directory is a navigation.yml file, and even awhole exampleSite
that we can copy over to our root data directory and customize.
Be sure to change title:
to title =
and so forth.
[[links]]
title = "web-work-tools.github.io"
url = "/web-work-tools.github.io/"
[[links]]
title = "Services"
url = "/services/"
[[links]]
title = "Mostly Free SEO Tools"
url = "/seo-tools/"
[[links]]
title = "GitHub Pages Starter Pack"
url = "/github-pages-starter-pack/"
[[links]]
title = "Practical Public Key Crypto"
url = "/practical-public-key-crypto/"
[[links]]
title = "InfoMine"
url = "http://infominer.xyz/"
The main differences:
type
rather than layout
date
to signify publication date, rather than hardcoding it into the title.---
layout: post
title: "Sample Code Post"
description: "Examples and code for various HPSTR functions."
tags: [samples, code, snippets]
comments: true
link: http://mademistakes.com
image:
thumb: /images/pgp-og.png
feature: pgp-banner.png
background: triangular.png
modified: 2019-05-30T13:15:59-23:00
permalink: /sample-code/
---
---
type: post
title: Sample Post
description: "Just about everything you'll need to style in the theme: headings, paragraphs, blockquotes, tables, code blocks, and more."
date: 2011-03-10
tags: [sample post]
image:
feature: abstract-3.jpg
credit: dargadgetz
creditlink: http://www.dargadgetz.com/ios-7-abstract-wallpaper-pack-for-iphone-5-and-ipod-touch-retina/
---
Now we are getting places! Next step is to copy the config.toml
from the root of our example site into the root of our repository.
This is the final stretch, and we should be good to go
baseurl = "https://web-work-tools.github.io"
languageCode = "en-gb"
title = "web-work-tools.github.io: Independent Web-Work and Skyscraper Publishing."
theme = "hpstr"
pluralizelisttitles = false
PygmentsCodeFences = true
Paginate = 5
disqusShortname = "hpstrhugo"
publishdir = "docs"
enableEmoji = true
[params]
subtitle = "Digital Tools for a Digital Transformation."
[params.author]
name = "⧉ Infominer"
avatar = "/images/info-id.png"
bio = "Full-Time Crypto-Curation and Histories ⧉ #Bitcoin #Blockchain #DecentralizedID ⧉ Research, Publishing, #WebWork #Indieweb ⧉"
github = "webwork-tools/webwork-tools.github.io"
[params.image]
feature = "/images/web-work-tools.png"
publishdir = "docs"
By setting this in our config.toml, we will be able to ask github pages to publish from the docs folder.
One thing that’s important to note, if you are switching from Jekyll HPSTR to HPSTR Hugo with me. HPSTR Hugo makes all your posts live in the /posts/
directory.
If you used to let your blog live at the root of the site, like me, then add aliases, which are how Hugo does redirects.
aliases:
- /title-goes-here/
- /other-title-too/
It seems like you need to type hugo
to publish to the docs directory, because hugo server
doesn’t do both, it only does the webserving.. I don’t really understand, but that seems to be the case.
For twitter cards, I use the minimal-mistakes - _includes/seo.html as a reference for up to date syntax, and update the code that generates it wherever I need (or simply drop it in the includes of jekyll themes).
I’ve switched over to the Indieweb Hugo Theme, Indigo, a testament to how easy it is, here on Hugo.