Live data from Hacker News

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

wp2hugo.blogdb.org

31–40 of 45 posts

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

#31

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.

Thank you for commenting!

It does put your files into a Hugo directory structure and includes the smol theme. It doesn't recreate your theme, plugins, or process your images, but I also have tried to be very explicit that it just converts your pages and posts and is the starting point for a conversion.

When you put an export file through it, you'll end up on this page: https://imgur.com/a/UUMB6ve where you can download a zip or tgz of the site and you'll clearly understand what you're getting before you can choose if you want to have the remaining pages/posts converted.

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

#32
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…

Plain old markdown image syntax also works, although there is no way to preprocess the file or add any additional HTML attributes beyond what you see here:

    ![add a description here](my cat.jpg)

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

#33
post #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 t…

Thank you for saying so!

That's super awesome too, this is not so different under the hood, I used libxml for getting the content and pandoc for converting -- pandoc turned out to be by far the best of the tools I tried for that aspect.

It won't necessarily keep the URLs stable, they'll be made based on the title of the post.

That's a cool solution for the ?p= issues, this doesn't handle it but when I've done it for for sites I host I usually use nginx's rewrite rules. I think for query rewriting you need to additionally use the map directive, but I was only handling directory vs .html and things like that.

Thank you again for commenting, I like your site!

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

#34
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.

I’m not sure about the OP, but I’d choose Hugo over Astro because of the simplicity of the single binary, and the lack of necessity for a JavaScript package manager just to run the thing.

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

#35
post #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 t…

> so I wound up putting some JS in my index page template that checks for that kind of thing.

If we are going to use JS, then you might as well put the redirects themselves in JS. Have a tiny stub of JS that detects the "/?p=xxx" case, which can then load the (presumably very large) list of redirects from a separate file and do the redirecting. That'll save you maintaining the extra service.

As for me, I moved from a Django app I made to a Hugo site, but it's pretty much the same deal. Because my Hugo site is on a "real" server (rather than e.g. GitHub Pages) I just have a giant pile of 500+ redirects in the nginx config file for the site (which is checked into the same repo as my Hugo site). It works for me.

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

#37
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…

Why did your person want to migrate? Out of curiosity.

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

#38
post #23
post #12

Earlier quoted context omitted.

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

The vast majority use plugins not available outside of wordpress.

The vast majority use no plugins at all.

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

#39
post #23

Earlier quoted context omitted.

The vast majority use plugins not available outside of wordpress.

The vast majority use no plugins at all.

They probably use plugins but they dont need them. Like Yoast for SEO etc
Post reply on HN