Live data from Hacker News

Show HN: I made a service to convert WordPress blogs to Hugo

wp2hugo.blogdb.org

21–30 of 45 posts

Re: Show HN: I made a service to convert WordPress blogs to Hugo

#21

The real money is in converting sites with plugins and retaining the functionality which in many cases isn’t static. The copying of data to another tool is the easy part.

I totally agree. This came about because of a pretty expensive quote the person I was talking to got.

Re: Show HN: I made a service to convert WordPress blogs to Hugo

#22
post #20
post #18

Thanks for sharing @symkat, love seeing developer side projects. Was curious why you picked Hugo over something like Astro. I'm migrating a site off of Jekyll and have found Astro has a lot of interesting features if I want to use them but is at its heart a static site generator and seems to be a pretty easy lift to migrate to. Haven't done much evaluation of Hugo yet.

Thank you for commenting! Really the reason I picked Hugo is because that's what the person I was talking to wanted. He'd only found contractors who would charge more than he wanted to pay to do a manual conversion, and said even something that just got his pages and posts over would be worthwhile to him. I have more experience with Jekyll. In fact, I had tried to start a hosted platform with a CMS for it that I open…

I was all about Jekyll 4 or 5 years ago and wouldn't have considered spending time switching but now on modern hardware it is ridiculously difficult to get the jekyll runtime to install and run properly, we've had multiple team members myself included spend hours dealing with hunting down random forum posts or github pull requests outlining the need to downgrade ruby in one way or another to support apple silicon or some other such thing that hasn't been patched in more recent versions. And the Jekyll docker images have been abandoned for a few years and no longer work on arm architectures.

Hopefully moving to a more actively supported static site generator will benefit us but its also a lesson to us that we need to keep track of continued support of apps we rely on. It's easy to just build and forget something and then there's a fire drill when you have to go back and change something that hasn't been re-deployed in a while.

Re: Show HN: I made a service to convert WordPress blogs to Hugo

#23
post #12
post #8

I may be wrong here, but I understood Hugo sites to be static sites, therefore not supporting comments, for example. How does your tool handle migrating a WordPress side with comments to a Hugo site?

The vast majority of WordPress sites are static sites with no use for comments.

The vast majority use plugins not available outside of wordpress.

Re: Show HN: I made a service to convert WordPress blogs to Hugo

#27
That's pretty cool! I ported my own WP blog to a static site generator (my own but with a format inspired by Hugo) a while back and hacked together a script with wpparser and some custom code to spit out markdown (it was a while back but I think just regexes). It got me the bulk of the way there but I still had to go through every page and tweak it to get everything just right. Would happily have paid $150 to avoid that.

Are you keeping URLs stable? That was tricky for me IIRC, along with RSS.

(The very trickiest bit was probably specific to me. I still have inbound links with the page in a "/?p=3" kind of query param, which I think was the WordPress default 20-odd years ago. I didn't want to make the root URL for the site non-static to handle that, so I wound up putting some JS in my index page template that checks for that kind of thing. If it spots it, it changes window.location to a specific URL that is delegated a Flask site that knows where to redirect people. Link in bio if anyone wants to see how it works. I should probably blog about it sometime!)

Re: Show HN: I made a service to convert WordPress blogs to Hugo

#29
Isn't this a bit deceiving to call this "WordPress 2 Hugo"?

Because isn't this just "WordPress 2 Markdown".

Unless I'm mistaken, this does not recreate your WordPress theme/template to be used in Hugo (nor nothing specific to Hugo).

It's just exporting your blog posts from WordPress database into a Markdown file format.

Note: still very useful, I just find the name confusing.

Re: Show HN: I made a service to convert WordPress blogs to Hugo

#30
post #15

And how do I upload an image of my cat to my all new Hugo site? WP lets me drag/drop or upload media very very easily. Has done for years. Hugo? or indeed most SSG's?

You copy it into the same directory as the post you want to put it in, and reference it as a resource from your post. I made a shortcode for this for my own Hugo site, adding auto thumbnailing & WebP support:

https://gist.github.com/lewiscollard/c6651648d1c20144ed89e16...

Copy that into your "layouts/shortcodes/image.html" and use it as

    {{}}
If you just want to upload it to _not_ reference it in a post/page, copy it into your `static` directory and it'll be passed through when the site is built.

Hope that helps!

Post reply on HN