Skip to content

jwalzer/ikiwiki2hugo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ikiwiki2hugo

This script converts the content of an ikiwiki installation to a content directory for a hugo content directory.

It is heavily based on anarcats ikiwiki2hugo script which itself was inspired by https://blog.jak-linux.org/2018/10/25/migrated-website-from-ikiwiki-to-hugo/ and anarcats notes on the matter.

What does it do?

For every ikiwiki *.mdwn or *.html file, it creates a Markdown file with hugo frontmatter. If there is a *.po file with the same name, the script creates a *.XX.md file with the strings translated.

Then the content is converted:

The ikiwiki [!meta directives are being converted to hugo frontmatter. The content of the Markdown files is a copy of the content of the ikiwiki files with the ikiwiki directives replaced by hugo shortcodes. There are a lot of directives out there and I only implemented replacements for some of them. My test ikiwiki instance was the the Tails ikiwiki source, so I mostly implemented directives used there. Merge requests or patches for additional directives are welcome- to add a replacement for a directive, look in the directives folder, all the replacement python modules inherit from the Directive class. The shortcode files are assets/shortcodes folder.

Usage: ./ikiwiki2hugo <ikiwikidirectory> <hugocontentdirectory>

The script wont overwrite an existing hugo content directory.

What it does not do?

Probably the more important question ;)

There are a lot of directives whose replacements are not implemented. Most important probably the [[!inline directive with multiple (and negative) arguments and the [[!map directive.

Also, hugo is more strict regarding Markdown syntax. It does not convert markdown syntax that is embedded in <div>...</div>.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published