Squashed commit of the following:

commit 9adb2bbb5bfb1301adca39411607f7d49666ae46
Author: perelesnyk <vasilay@gmail.com>
Date:   Sun Oct 19 22:48:04 2014 +0300

    updated templates for documents and blogs

commit 7b91cf4fe02c5f0e82f07960482993f7ee9c7315
Merge: 9c4d8b8 4a235d7
Author: perelesnyk <vasilay@gmail.com>
Date:   Sun Oct 19 21:02:15 2014 +0300

    Merge remote-tracking branch 'origin/dev' into f.blogs

commit 9c4d8b8a89029fd74418c0edad118b2b766a74e5
Author: perelesnyk <vasilay@gmail.com>
Date:   Sun Oct 19 16:01:48 2014 +0300

    add tags and images into the loop

commit ebdd4cb741ef6e9cf52bbff0be5cd9428adf2279
Author: perelesnyk <vasilay@gmail.com>
Date:   Sun Oct 19 16:01:15 2014 +0300

    add blog archive view with sidebar
Some logic inconsistency in functions fixed