Arriving from another tool
Arriving from another tool
statac import reads a site that Jekyll, Hugo, Zola or Eleventy made and
writes a new Statac site beside it, leaving the old one as it was.
Warning:
statac import is a best effort. The writing, its front matter, its
pictures and files, its settings and its addresses come across. The old
site’s templates and theme don’t: the new site starts from Statac’s
starter, so it looks like a new Statac site, not like the
old one. Where Statac has no equal for something in the writing, it is
left as written, and the report says where. Read the new site and the
report before you publish it.
What comes across, and what doesn’t
It brings across:
- the writing and its front matter, the old tool’s field names put into Statac’s words
- dates, from the front matter or from a file’s name
- common template tags, as snippet calls
- pictures, other files and data files
- the settings Statac has an equal for
- each old address it can, kept or redirected
It leaves behind:
- layouts, includes, stylesheets and the theme
- plugins: Statac does their work itself only for feeds, sitemaps, old addresses and later pages
- running template tags: Statac runs none in the writing
The new site has the starter’s templates, snippets and stylesheet, with the old site’s pages in place of a new site’s samples.
The later pages of a Jekyll site’s home page, such as /page2/, become
redirects to the posts’ own pages.
Nothing answers the later pages of a Hugo, Zola or Eleventy site’s home
page.
The old site is only read, and nothing is fetched.
Import a site
statac import old
Imported the Jekyll site `old` into `old-statac`. This is a best effort: read `old-statac/IMPORT.md` before you publish.
Converted: 95 posts, 5 drafts, 4 pages, 120 other files.
Addresses: 104 kept, 2 that nothing answers now.
Left for you: 14 things of 5 kinds.
Next: `cd old-statac`, then `statac check`.
The new site goes beside the old one, its name ending -statac. To put
it elsewhere, name the folder, as statac import old new-site: it must
be empty or not there yet, and neither folder inside the other. If
anything stops the import part way, the new folder is left as it was
found.
Statac knows the tool by its settings file. Where it can’t tell, say which:
statac import old --from=jekyll
| Tool | --from= |
What comes across from it |
|---|---|---|
| Jekyll | jekyll |
From Jekyll |
| Hugo | hugo |
From Hugo |
| Zola | zola |
From Zola |
| Eleventy | eleventy |
From Eleventy |
--today=2026-10-04 is the day the import checks the new site on.
Where the old site’s settings give no web address, Statac asks for it before it writes anything:
What is the site's address?
The old site's settings don't say.
Enter for none yet.
>
The answer is written as the new site’s url. Enter leaves url out,
for you to add later. Where the old settings give only a path,
Eleventy’s pathPrefix or Jekyll’s baseurl, the path is added to the
answer: https://example.org gives url: https://example.org/blog.
Run with no terminal, the import takes the first line on standard input as the answer.
What happens to old addresses?
Statac keeps or redirects each old address it can, and the report lists every one it can’t. Where most pages beneath a folder moved the same way, a pattern in the folder’s own page keeps them, as for Jekyll’s posts:
---
title: Posts
pages.layout: post
pages.permalink: /{year}/{month}/{day}/{slug}.html
---
| Old address | In the new site |
|---|---|
| Where most pages beneath a folder were | One pages.permalink pattern, in the highest folder’s own page it fits |
| A page the pattern doesn’t fit | Its own permalink |
| A page’s other old addresses | Its redirect_from |
| A page in another language’s folder | A permalink written without that folder |
| A site under a path | The whole address as its url: see a site in a folder of its domain. Where the old settings give the path alone, the address is asked for. |
One holding a character no address takes, such as ?, or one the new site publishes something else at |
Left out, and listed with why |
Where the old site’s built output is beside it, Statac checks its pages too, and lists each one nothing answers now.
Front matter
Each tool’s fields become Statac’s where they mean the same: each tool’s page has the table.
| In the old front matter | In the new |
|---|---|
layout |
Taken off |
| A field Statac has no word for | Kept as it is |
A field named as one of Statac’s words that means something else, such as order or slug |
old_ before its name, and listed |
One of Statac’s words holding no text, such as summary: "" |
Left out |
Dates
| Old date | Written |
|---|---|
2026-10-04 |
2026-10-04 |
2026-10-04 09:30 |
2026-10-04T09:30 |
2026-10-04 09:30:00 +0100 |
2026-10-04T09:30:00+01:00 |
October 4, 2026 09:30 +0100 |
2026-10-04T09:30+01:00 |
04/10/2026 |
Left as written, and listed |
None, in 2026-10-04-post-1.md |
date: 2026-10-04, in post-1.md |
Each date is written year first, keeping what the old date held and no more: seconds and an offset only where it had them. Jekyll’s dates have a rule of their own.
Categories and other lists
tags: [rust]
categories: [linux, Home Lab]
becomes
tags:
- rust
- category_linux
- category_Home Lab
Each category becomes a tag, category_ and its name as spelt, after
the page’s own tags. Other lists the settings declare, such as
authors, give tags the same way. A page in more than one series
keeps the first, and each other becomes a tag, series_ and its name.
Where the old site published a page for each category, a small page at
the top of content/ sends its readers on to the tag’s page:
---
permalink: /categories/linux/
redirect_to: /tags/category-linux/
---
Template tags in the writing
{{< note kind="tip" >}}
The writing.
{{< /note >}}
becomes
@old_note(kind='tip')
The writing.
@end
Each template tag with an equal is converted, as each tool’s page lists. Any other is left as written, and listed at its line.
A helper giving an address inside the site, such as Jekyll’s
relative_url, becomes the address from the top of the domain with the
site’s path in front: /blog/photo-1.jpg on a site under /blog.
An include, or a template tag of the site’s own, becomes a snippet call.
A name one of the starter’s snippets has already, such as
note, gets old_ before it. The snippet written for it, here
snippets/old_note.html, shows only a comment saying it wasn’t
converted: write it as Snippets describes, or take its
calls out.
Other changes to the writing
| In the old writing | In the new |
|---|---|
@name( outside code |
\@name(, shown as written |
| A dollar sign Statac would read as opening maths, where the old site set none | \$, shown as written |
<!--more--> on a line of its own inside HTML |
A blank line each side, so the excerpt ends where it did |
<!--more--> inside a line, a list or a quotation |
Taken out, and listed |
Pictures and files
Most files the old site published as they are go into static/ at the
same path, so their addresses stay.
| File | In the new site |
|---|---|
| A photograph a page shows | Published as its copies, not as itself, unless a page links to it or it is left as it is. Its old address no longer answers. |
One whose name can’t be published, such as Plan%201.pdf |
Renamed, as Plan 1.pdf. Links to it are changed, and its old address is listed. |
The old site’s own 404.html or robots.txt |
In place of the starter’s page |
Symbolic links and other folders
Statac reads nothing outside the old site’s folder. A symbolic link is followed only where it leads to something inside the same old site that the site published. The report lists each one it didn’t follow, with why.
Read the report
IMPORT.md, at the top of the new site, says what came across, the
settings written and how each address was kept, then each kind of thing
left for you, with what to do and every place. Statac never reads it, so
delete it once nothing in it is left to do.
Statac checks the new site as statac check does, and lists each error
in the report. The command then says:
The new site doesn't build yet: 2 errors, listed in `old-statac/IMPORT.md`.
After the import
- Work through
IMPORT.md, a kind at a time. - In the new site, run
statac checkuntil it shows no errors. - Choose how the site looks: it has the starter’s templates, yours to
change or replace, with
statac serveshowing each save.
Where next?
- Templates: give the new site the look you want
- The starter: what each of the starter’s files is, and the words its pages show
- Addresses:
permalinkpatterns and redirects - Snippets: write the snippets the import left for you
Something unclear or wrong? Open an issue on GitHub.