New Blog
Hi All, I usually like to build things almost from scratch, but this time i tired to do an exception,my old blog was written in php, night time, with my limited knowledge of design, it didn't really have an engine behind,it was more a few line of php for merge together a few html(5) hand written posts, it was quite hard to maintain and my focus was more on make it work, than actually put some content in it
So at the end i was not posting at all because it was not working ;).
Now i finally choose to use a tool for build my blog, the choice of the tool was driven by few needs i had, one was i want to write posts in markdown, second i need something quite simple that doesn't need an huge server for run, so i just opened a console and typed "apt-cache search blog markdown", i know that for most people that's not the way to search for new things, but for me it is!
So it come out a list of few options, and checking out the websites (yes i use also the web sometime) i choose nanoc is a simple static site generator written in ruby, it look quite clean and it support markdown, and actually if i don't remember wrong, someone suggested to me this tool while i was in a hack-day, but as i usually do i didn't considered the suggestion straight.
So i just installed the software and look for a first basic tutorial, was quite easy to set up, and i got out with a result in the first 20 minutes, but i struggled a bit refatoring the complex design you see :P.
Another point of struggling was actually for let the engine parse properly the markdown and the code blocks, and at the end i finished with this nanoc Rules:
compile '*' do if item[:extension] == 'md' filter :kramdown, :input => 'GFM' layout 'default' elsif item[:extension] == 'css' # don’t filter stylesheets elsif item.binary? # don’t filter binary items else filter :erb filter :colorize_syntax, :colorizers => {:java => :coderay}, :coderay => {:line_numbers => :inline} layout 'default' end end route '*' do if item[:extension] == 'css' # Write item with identifier /foo/ to /foo.css item.identifier.chop + '.css' elsif item.binary? # Write item with identifier /foo/ to /foo.ext item.identifier.chop + '.' + item[:extension] else # Write item with identifier /foo/ to /foo/index.html item.identifier + 'index.html' end end layout '*', :erb
that is almost the basic Rules generated by default with github style markdown(see :input=> 'GFM'
where GMF= Github Flavored Markdown ) support that is the one i know ;), and some code highlight for html
nothing to complex
after i couple of days playing with nanoc i also discovered that has a few blogging specialised plugins, so i enabled them just creating a file lib/includes.rb
with this content:
include Nanoc::Helpers::Blogging include Nanoc::Helpers::Tagging include Nanoc::Helpers::LinkTo
and what you see now is the final result, I'm quite satisfied, there are some limitations, like is not possible to comment the posts but if you want to comment it feel free to figure out my email address and send me an email, I'll be happy to put your comment here.
and finally all of this written with vim and versioned with git, quite happy, and sorry for eventual Enlgish mistakes ;)