lonekorean / wordpress-export-to-markdown

Converts a WordPress export XML file into Markdown files.
MIT License
1.14k stars 227 forks source link

Adds support for slug from wordpress link in frontmatter section #63

Closed AvantaR closed 8 months ago

AvantaR commented 3 years ago

Hi!

While moving my blog from WordPress to Hugo, I ran to issue with slug. This tool doesn't export slug from WordPress link section, so if you have a different slug than your post title, some URLs could not work after migration.

In this PR, I've added support for it: – slug is pulled out from link attribute in post object – it's optional (default it's disabled) – to turn it on, just add --slug=true argument in CLI, or proper answer to wizard question ;)

I needed to change a bit your map function, hope it's still clear to read.

I think it can be quite helpful feature for other developers.

Thank you for this tool, it's awesome and speeds up migration so much!

AvantaR commented 3 years ago

@lonekorean any chance to look at my PR? :smile:

arryanggaputra commented 3 years ago

@AvantaR is this work on your side?

AvantaR commented 3 years ago

@AvantaR is this work on your side?

It did.

lonekorean commented 8 months ago

Hello @AvantaR ! Sorry it took me 3 years to respond.

I think getting a slug out of post.link may have worked for you, but would not work for everyone (for example, if someone has year/month in their post link paths, they would be included in the "slug").

I have rearchitected things a bit and added support for slug here: https://github.com/lonekorean/wordpress-export-to-markdown/pull/111

Just wanted to let you know why I'm closing this PR and to say thank you. 🙏