Friday, March 15, 2013

Blog posting in github

Ok,
I spent some time playing around with the idea of using github for blog posting - or dump posting.

Note that I am not interested in the features offered by jekyl etc , ie the full cms/static blog generators framework. I want my blog to be as closed to a source repo - as possible.
Here are the features that I am looking forward
 - Anyone should be able to either fork the repo - make a fix/change to a page and issue to me a pull request - that functionality should be ideally available where they read the post.
 - Having access to the inline edit (and automatic fork/pull request) of github would also be very nice
 - I should be able to create/update my blog posts from my laptop with my sublime with minimal extra noise in the file
 - I shouldn't need to do anything beyond a commit / push
 - My folder hierarchy should be ideally similar to my url structure
 - I should be able to save pictures that are embedded in the blog

--
Ok, lets start https://github.com/ogt/otdump.
Just a plain repo. Directory structure 2013/01..03.
Adding the first blog post. I use the blogger's url as the filename - but with .md extension instead of .html. I guess I would need to be manually ctreating my slugs. I may creating a command line utility for that . The blog should have a bin dir with any tools it uses for its writing..

> pip install slugify
> echo "Hello world" | slugify
hello-world

Perfect .. exists already.
I copy paste in my sublime the content of the very first otdump post... hm - I can't preview locally.
Thats not good.. I need to commit push just to do a preview. Looking for offline github markdown preview tools... none that is doing what github is doing (they fail simple GFM things like url auto-linking fail). And the github guys provide an API even for that .. They are good.
Maybe the simplistic solution of having a github online editor open / copy pasting in it and hit the preview button isn't that bad.. but what would happen with all my included pictures...
Darn, so it seems that I would create my blog in sublime and continue any further editing online?
But when I need to add a picture? I would save it in the posts folder, reference it in the post using github's new relative link syntax (thats really nice actually) - I mean doing that locally "blindly", and then commit push to preview..  That is definitely sub-optimal. The reality is that for blog I should think of commit/push as a single command.. just like my online edits..
Maybe thats it - in online-edit  the save + commit+ push+refresh happens in a single command.
Thats what I need then. I need to be able to do just that (all but the refresh I mean) from my sublime editor - it should be feasible.

Ok. Just looked at the post - it looks decent. And it looks nice from my phone too - not sure if its the  recent improvements that github did for mobile rendering (thought I seen it somewhere - can't find it anymore..).
So I think thats a good start for now. I will probably add a utility to generate a home "readme.md" that looks like the blogger home, ie it has a the monthly indexes and the first portion of the the most recent 4-5 posts - maybe links to autogenerated monthly archives... am I recreating the static blog generator here.... maybe I am ... Will have to do the critique later - I am confident that my features aren't available as I ask them with jekyl... and if I find jekyl too much - imagine a random editor/reviewer I hire at OD to make some change fix in my posts. Talking about that - I need to capture the instructions of what I do for a single post, and then hire someone at OD to form my repo and do the same for every post of mine (and there are many by now) - essentially do the blogger -> GFM conversion for me).. and send me a pull request when they are done.. Nice I already feel good about this.


No comments:

Post a Comment