By Frank Apa October 2, 2020
`Chess Openings Giuoco Piano
In honour of those who like to venture the path less travelled, I am releasing my version of an OSW - Open Sim Wheel:
[Event “?"]
[Site “?"] [Date “????.??.??"] [Round “?"] [White “?"] [Black “?"] [Result “*"]
-
e4 e5
-
Nf3 Nc6
-
Bc4 Bc5
-
c3 Nf6
-
d4 exd4
-
cxd4 Bb4+
-
Bd2 Bxd2+
-
Nbxd2 d5
-
exd5 Nxd5
-
Qb3 Na5
-
Qa4+ Nc6
-
Bb5 Qe7+
-
Ne5 Bd7
-
O-O Nxd4 *
You’ll have everything you need to machine or print your own !! LINK IS ABOVE
should become
▾ <root>/
▾ static/
▾ images/
logo.png
Additionally, you’ll want any files that should reside at the root (such as CNAME
) to be moved to static
.
Create your Hugo configuration file
Hugo can read your configuration as JSON, YAML or TOML. Hugo supports parameters custom configuration too. Refer to the Hugo configuration documentation for details.
Set your configuration publish folder to _site
The default is for Jekyll to publish to _site
and for Hugo to publish to public
. If, like me, you have [_site
mapped to a git submodule on the gh-pages
git submodule deinit _site
git rm _site
git submodule add -b gh-pages git@github.com:your-username/your-repo.git public
-
Or, change the Hugo configuration to use
_site
instead ofpublic
.{ .. "publishdir": "_site", .. }
Convert Jekyll templates to Hugo templates
That’s the bulk of the work right here. The documentation is your friend. You should refer to Jekyll’s template documentation if you need to refresh your memory on how you built your blog and Hugo’s template to learn Hugo’s way.
As a single reference data point, converting my templates for heyitsalex.net took me no more than a few hours.
Convert Jekyll plugins to Hugo shortcodes
Jekyll has plugins; Hugo has shortcodes. It’s fairly trivial to do a port.
Implementation
As an example, I was using a custom image_tag
plugin to generate figures with caption when running Jekyll. As I read about shortcodes, I found Hugo had a nice built-in shortcode that does exactly the same thing.
is written as this Hugo shortcode:
<!-- image -->
<figure {{ with .Get "class" }}class="{{.}}"{{ end }}>
{{ with .Get "link"}}<a href="{{.}}">{{ end }}
<img src="{{ .Get "src" }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}"{{ end }} />
{{ if .Get "link"}}</a>{{ end }}
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
<figcaption>{{ if isset .Params "title" }}
{{ .Get "title" }}{{ end }}
{{ if or (.Get "caption") (.Get "attr")}}<p>
{{ .Get "caption" }}
{{ with .Get "attrlink"}}<a href="{{.}}"> {{ end }}
{{ .Get "attr" }}
{{ if .Get "attrlink"}}</a> {{ end }}
</p> {{ end }}
</figcaption>
{{ end }}
</figure>
<!-- image -->