Arriving from another tool
From Hugo
What statac import reads from a Hugo site, and what each
part becomes.
What it reads
| Hugo’s | In the new site |
|---|---|
hugo.toml, hugo.yaml or hugo.json; a config.toml, config.yaml or config.json that sets baseURL; or config/_default/ |
Tells Statac the site is Hugo’s, and holds the settings, read in any capitals. |
Another environment’s settings, such as config/production/ |
Listed, and left |
.md, .markdown and .html files in content/ |
The same place under content/, front matter read in YAML between ---, TOML between +++, or as a JSON object |
A folder’s _index.md |
The folder’s own page, index.md |
A page kept as a folder, index.md with its pictures and files beside it |
That folder, whole, as a folder’s own page |
static/ |
static/ |
data/ |
data/, TOML written as YAML |
layouts/, themes/, assets/, archetypes/, i18n/, resources/ |
Not converted, and listed once each |
| A page in another format, such as AsciiDoc | Listed |
The built output, public/ or where publishDir says |
Read, to check the old addresses |
Where the settings declare more than one language, the main one’s pages
stand at the top of content/, and each other’s in a folder of its own,
content/fr/, whether Hugo had them in folders or named, as
about.fr.md.
Settings
| Hugo’s | Statac’s |
|---|---|
baseURL |
url. Where it gives no web address, the address is asked for. |
title |
title |
languageCode |
language |
timeZone |
timezone |
[params] |
Values of your own |
pagerSize under [pagination], or paginate |
posts_per_page, unless it is 10. On the home page it sets nothing. |
path under [pagination], or paginatePath, where it isn’t page |
later_pages, as "{list}p/{n}/" for a path of p |
The feeds Hugo makes unless disableKinds holds RSS |
feed_ids_before, the day of the import, so feed readers see no old post as new |
[frontmatter] |
Which field, or the file’s name, gives a page its date |
[permalinks], uglyURLs |
Addresses |
theme, [menus] and every other setting with no equal |
Listed |
| Always | date_format, the shorter dates and a new feed_key. |
Front matter
Hugo’s own fields are read in any capitals and written in small
letters: Title as title.
| Hugo’s | Statac’s |
|---|---|
draft, tags |
The same |
date, or where [frontmatter] says |
date, taken from the file’s name where it says so |
lastmod |
updated |
description |
summary, where the page has none |
slug, url |
The page’s address, as below |
aliases |
redirect_from |
categories |
Tags, such as category_linux |
Another list under [taxonomies], such as authors |
Tags, the list’s plural name in small letters first: authors_Name 1 |
weight |
The folder’s order:, where its pages are ordered by it |
translationKey |
translation_key |
Fields under params |
Fields of the page’s own |
type, layout |
Taken off, and counted |
publishDate, expiryDate |
Taken off, and listed. A page past its expiryDate gets draft: true. |
Template tags
Hugo’s template tags in the writing, {{< name >}} or {{% name %}},
alone or around writing up to {{< /name >}}:
| Hugo’s | Becomes |
|---|---|
{{< figure src="photo-1.jpg" caption="Caption 1" >}} |
@figure('photo-1.jpg', caption='Caption 1'), where the file is one of the site’s photographs: a JPEG, PNG or WebP that doesn’t move. A class, width or height is taken off. Any other figure, one inside HTML, or one asking for a link is written as the HTML Hugo made, and listed. |
{{< youtube abcdefghijk >}}, {{< vimeo 123456789 >}} |
@youtube('abcdefghijk'), @vimeo('123456789') |
{{< ref "post-1.md" >}}, {{< relref "post-1.md" >}} |
The page’s address, with the site’s path in front: whole for ref, https://example.org/blog/posts/post-1/, and from the top of the domain for relref, /blog/posts/post-1/. {{< baseurl >}} in front of one adds no second path or host. One naming no page is left, and listed. |
{{< highlight go >}} to {{< /highlight >}} |
A fenced code block, ```go, its options taken off, as are those on a fence, ```go {linenos=true} |
{{< details summary="More" >}} |
<details>, with its <summary> |
{{< param "author" >}} |
The page’s value, or the site’s |
{{</* figure */>}} |
The template tag as text, {{< figure >}} |
One of the site’s own whose file shows only one of the site’s values, such as {{ .Site.BaseURL }} or {{ .Site.Params.author }} |
The value, the site’s address given as its path: [Post 1]({{< baseurl >}}/posts/post-1/) becomes [Post 1](/blog/posts/post-1/) under /blog |
| Any other inside a link’s address | Left as written, and listed |
gist, instagram, tweet, x, qr, and the site’s own in layouts/shortcodes/ |
A snippet call, such as @old_note(kind='tip') |
What isn’t converted
The report lists each of these:
- HTML in the writing where the settings left HTML out
:emoji:names where the settings showed emoji{.class}below a block- an excerpt Hugo cut by a count of words, where Statac takes the first paragraph
Hugo’s ways
A page’s address is worked out by Hugo’s rules: its folder and file name,
or its slug, with capitals made small and spaces made hyphens; its
url; the settings’ uglyURLs; and a pattern in [permalinks], filled
in as Hugo fills it. In hugo.toml:
[permalinks]
posts = "/:year/:month/:slug/"
keeps the posts where they were with, in content/posts/index.md:
pages.permalink: /{year}/{month}/{slug}/
| Hugo | What Statac does |
|---|---|
| A post whose name Hugo made differently | Gives it its own permalink |
A tag at another address than Statac’s, such as /tags/c++/ |
Gives it its own in tags.slugs |
A [permalinks] pattern for tags |
Writes it as tags.permalink |
Each list’s feed, index.xml beside the list |
Keeps it there, with feed: index.xml on the list’s page. Hugo’s feeds were RSS; Statac’s are Atom. |
| A feed for each tag | Counts them: a tag’s list has a feed only where a page of yours at its address asks for one |
/tags/, the page listing every tag |
Has no equal, and says so |
| Maths | The old site set maths where passthrough is on with $ or $$ among its delimiters |
Where next?
- Arriving from another tool: addresses, dates, categories and the report, for every tool
- Addresses:
permalinkpatterns andredirect_from - Lists, tags and series: tag addresses, feeds and later pages
- Snippets: write the snippets that stand for Hugo’s template tags
Something unclear or wrong? Open an issue on GitHub.