/ dev

From postachio to pelican

I've got a bit fed up with the lack of control that I've had when using postachio, there's metadata that I want in my templates that I can't have. Despite promises that they were going to improve things toward the end of last year things have also gone a bit quiet. For this reason I decided to move back to pelican. This was not as trivial as it maybe could have been. Getting evernote posts into markdown with the images where I wanted wasn't simple. However, pelican comes with pelican-import which can import posts from a rss feed into markdown. Postachio only puts the last 50 posts into the rss feed so I had to do an import, move posts into a different notebook, do an import etc...
Once I had that done I had to grab the images and put them in the right place. Luckily all of the posts in the rss appeared to have my images hosted on a postachio cdn. Using a simple regex I was able to write a script to locate image tags in the markdown files and then download the images from the urls. As a part of this the script also had to update the image url to be the new, correct, relative url. I also had to tweak pelican-import to look for published date rather than updated date in the feed.
Great, loads of markdown files and images. Next job, alter my old theme and then setup github pages. It's still far from being right but it's a start that'll do for now, I also need to create an automation process so that I don't have to manually publish, I'm not sure how I'll do that yet. It'd be easy if it wasn't for the images.
Anyway, new (kinda) site, woo! I also haven't forgotten photo a day. I'm still taking the photos but I want to work out my posting workflow before posting more as the images are a pain. Hopefully I'll get that nailed soon.

From postachio to pelican
Share this