I’m migrating my blog https://tonym.us/ from pelican to hugo. I’d like to minimize the manual changes needed.
My pelican content is geared toward a chronological blog with all the posts in a /content/ folder e.g.
./content
- post1.md
- post2.md
- etc
Here are the areas I could use help with:
migrating frontmatter to yaml with Hugo schema – i have a rough script (below)
updating pelican tags & categories hugo to tags & genre – tags are not currently indexing despite using `taxonomy`` frontmatter params
chronological & paginated indexing & blog post previews – using m10c theme i get indexing but not previews. I may need to write a new template to generate blurbs.
migrating pelican single-directory to hugo multiple-directory structure. No solution yet.
preserving slugs / permalinks. i have a solution for post permalinks using hugo.yaml but not a good solution to preserve tags, category & rss permalinks.
questions
Is it possible to simplify hugo config to keep this simple structure?
Are there tools to help with the above migration steps , e.g. frontmatter, tagging, etc.
Here are some scripts I’ve found that I’m working to modify to fit my needs
Check your site configuration to make sure you haven’t excluded “tags” from the taxonomy system . For example, this tells Hugo that the only taxonomy is colors:
[taxonomy]
color = colors
Check your site configuration to make sure you are not disabling the taxonomy or term page kinds. For example, don’t do this:
disableKinds = ['taxonomy','term']
If none of those apply, you’ll need to share your site’s project repository with us.
You may need to override one or more of your theme’s templates. You override a theme template by copying it into the same path relative to the layouts directory in the root of your project.
I don’t know what that means or why it is required.
I think we would need specific examples. You can override URLs by defining permalinks in your site configuration, by setting the url field in front matter, or by setting the slug field in front matter.
I was able to update list.html in my theme to reflect my current directory structure
- {{ range where .Paginator.Pages "Type" "!=" "page" }}
+ {{ range .Paginator.Pages.ByDate.Reverse }}
Tags , categories , etc
Thanks to your guidance, I updated frontmatter with the following and it’s improved the indexing
---
title: Three Pillars
date: 2021-07-14
categories: leadership
tags: management, information
params:
author: Tony Metzidis
---
Permalinks
Thank you for your help with permalinks.
Frontmatter conversion
You’re right sed can help with some of the frontmatter, but there’s still date formatting and other transforms that could benefit from a 1-200 line script. Every little bit helps.
I’m referring to slug generation from the post content . Pelican auto-generates the slugs from the title. I would have liked to config this routine to match the previous behavior.
func dateAndSlugFromBaseFilename(location *time.Location, name string)
I’m trying to be helpful in documenting the migration to make the migration path easier . This is good for the project. Please don’t take this as criticism. It’s been a good experience.