Minoru / hakyll-convert

Import from other blog engines to Hakyll
Other
7 stars 0 forks source link

Save in more suitably named files (%Y-%m-%d) #6

Closed magthe closed 8 years ago

magthe commented 10 years ago

I just ran hakyll-convert on my exported WP posts and noticed that the generated files are named based on the wp:post_id. I think it would be better if the file name was based on wp:post_date instead, since it then matches better with the naming scheme suggested for Hakyll posts (statement based on the output of hakyll-init).

kowey commented 10 years ago

Hey! Thanks for trying hakyll-convert (I saw your tweet or blog post float by about potentially switching to Hakyll).

I haven't really touched this since I converted my own blog, but I'd be happy to accept patches and/or new maintainers.

At the risk of misunderstanding the issue, one thing I was motivated by was preserving “cool URIs”, ie. ensuring that my blog posts stayed in the same place even if I switched blog engines (this was broken anyway because I never bothered to work all the redirections), but maybe the intention there was more about getting a stable path across the migration more than respecting the hakyll convention, which I use for my post-conversion posts.

magthe commented 10 years ago

Yeah, not breaking external links to old material would be a nice thing. I'm not quite ready to do the move of old posts just yet, mainly because the contents rely on WP plugins so the files need manual tweaking anyway. When I feel like tackling this I'll look into modifying hakyll-convert and add a command line argument controlling this behaviour.

kowey commented 10 years ago

Thanks! Good luck with your hakyll'ing.

(Off topic: I'm definitely much happier having merged my homepage and multiple blogs into one hakyll site. Only downside is having to relearn the API on the rare occasion I want to change something, and perhaps dealing with API changes as hakyll evolves. Can't have it all.)

magthe commented 10 years ago

There were two modifications I'd have liked to do to hakyll-convert:

  1. Change the filename posts were save in
  2. Extract comments

I had a quick look at the source and came to the conclusion that, due to using the RSS-parsing lib, doing 2 would take a lot longer than I'd like to spend. So I decided to abandon the plan of using hakyll-convert and instead wrote a quick-and-dirty script to do exactly what I want: https://gist.github.com/magthe/744cdda3b59dc9abaa06