diff --git a/sitegin/gitInfo.js b/sitegin/gitInfo.js
index fed2ed2f36fed27e5adb1f60a814137080046c8d..3d02d80e41a12bd1ce7bee50a04bb131a28ff45a 100644
--- a/sitegin/gitInfo.js
+++ b/sitegin/gitInfo.js
@@ -191,10 +191,6 @@ module.exports = function(obj) {
           }
 
           article.metadata.date.modification = newestCommit.date;
-          var sameDay = function(a,b) {
-            return a.getYear()==b.getYear() && a.getMonth() == b.getMonth() && a.getDate() == b.getDate();
-          }
-          article.metadata.date.modified = !sameDay(newestCommit.date, oldestCommit.date);
 
           if(article.metadata.author === undefined)
             article.metadata.author = {}
diff --git a/sitegin/image.js b/sitegin/image.js
new file mode 100644
index 0000000000000000000000000000000000000000..545618bd8dfec4866e1585de2970d8ab21471d5a
--- /dev/null
+++ b/sitegin/image.js
@@ -0,0 +1,92 @@
+'use strict';
+
+var youtube = require('./utils/youtube.js');
+var path = require('path');
+
+var paramInHrefParser = function(href) {
+  var sepIndex = href.indexOf(' =');
+  var ret = {
+    href: href,
+    options: {}
+  }
+  if(sepIndex < 0) {
+    return ret;
+  } else {
+    ret.href = href.substr(0, sepIndex);
+    var options = href.substr(sepIndex+2);
+    options = options // split by ',' but not '\,'
+      .replace('a,','\u0007')
+      .split(',')
+      .map(function(e) {return e.replace('\u0007','a,')});
+    options.forEach(function(option) {
+      var index = option.indexOf('=');
+      if(index < 0) {
+        ret.options[option] = true;
+      } else {
+        var key = option.substr(0,index);
+        var value = option.substr(index+1);
+        ret.options[key] = value;
+      }
+    });
+    return ret;
+  }
+}
+
+var renderYoutube = function(href, options) {
+  var info = youtube.info(href);
+  let out = '<div class="video-container"><div class="videodiv">';
+  out += '<iframe src="https://www.youtube.com/embed/'+info.videoid+
+  '?modestbranding&start='+info.time+'" frameborder="0" allowfullscreen></iframe>'
+  out += '</div></div>'
+
+  return out;
+}
+
+module.exports = function(href, title, text, curFilename) {
+  var parsed = paramInHrefParser(href);
+  href = parsed.href;
+  var options = parsed.options;
+
+  for(let option in options) {
+    if( !options.hasOwnProperty(option) ) continue;
+
+    if(option.match(/x[0-9]+/) || option.match(/[0-9]+x[0-9]*/)) { // 123x or x123 or 123x123
+      options.size = option.split('x');
+      if(options.size !== undefined) {
+        if(options.size[0].length > 0) {
+          options.width = options.size[0];
+        }
+        if(options.size.length > 1 && options.size[1].length > 0) {
+          options.height = options.size[1];
+        }
+      }
+    }
+  }
+
+  if(youtube.isVideo(href)) {
+    return renderYoutube(href, options);
+  } else {
+    var rel = path.relative(process.cwd(),path.resolve(curFilename,href));
+
+    var out = '<img src="' + href + '" alt="' + text + '"';
+    if(options.width) {
+      out += ' width="' + options.width + '"';
+    }
+    if(options.height) {
+      out += ' height="' + options.height + '"';
+    }
+    if (title) {
+      out += ' title="' + title + '"';
+    }
+
+    out += '>';
+    if(!options.nolightbox) { // if lightbox
+      var a = '<a href="'+href+'"';
+      a += ' data-lightbox="group"';
+      a += ' data-title="' + text + '"';
+      a += '>';
+      out = a+out+'</a>';
+    }
+    return out;
+  }
+}
diff --git a/sitegin/markdown.js b/sitegin/markdown.js
index 7a04c7588ddeb1e5ab59d59ba6384fa0bed8623c..e6482e157ce8629375388f44bc2dd1493763c5eb 100644
--- a/sitegin/markdown.js
+++ b/sitegin/markdown.js
@@ -6,14 +6,44 @@
 var marked = require('marked');
 var renderer = new marked.Renderer();
 var highlightjs = require('highlight.js');
-var path = require('path');
 var jobs = require('./jobs');
-var youtube = require('./utils/youtube.js');
+
+var lang;
+
+var opts = {
+  highlight: function (code) {
+    var h;
+    if(lang) {
+      if(highlightjs.getLanguage(lang))
+        h = highlightjs.highlight(lang, code, true);
+      else
+        h = highlightjs.highlight(code);
+    } else {
+      h = highlightjs.highlightAuto(code);
+    }
+    return h.value;
+  },
+  renderer: renderer,
+  gfm: true,
+  tables: true,
+  breaks: false,
+  pedantic: false,
+  sanitize: false,
+  smartLists: true,
+  smartypants: false,
+};
+
+var parser = new marked.Parser(opts);
+var lexer = new marked.Lexer(opts);
 
 var toURL = function(url) {
   return jobs.run('toURL', url);
 }
 
+var renderImage = function(href, title, text, curFilename) {
+  return jobs.run('image', href, title, text, curFilename);
+}
+
 renderer.heading = function(text, level, raw) {
   return '<h'  +
     (level+2)  +
@@ -31,107 +61,8 @@ renderer.paragraph = function(text) {
   else return '<p>'+text+'</p>\n';
 }
 
-var paramInHrefParser = function(href) {
-  var sepIndex = href.indexOf(' =');
-  var ret = {
-    href: href,
-    options: {}
-  }
-  if(sepIndex < 0) {
-    return ret;
-  } else {
-    ret.href = href.substr(0, sepIndex);
-    var options = href.substr(sepIndex+2);
-    options = options // split by ',' but not '\,'
-      .replace('a,','\u0007')
-      .split(',')
-      .map(function(e) {return e.replace('\u0007','a,')});
-    options.forEach(function(option) {
-      var index = option.indexOf('=');
-      if(index < 0) {
-        ret.options[option] = true;
-      } else {
-        var key = option.substr(0,index);
-        var value = option.substr(index+1);
-        ret.options[key] = value;
-      }
-    });
-    return ret;
-  }
-}
-
-var renderYoutube = function(href, options) {
-  var info = youtube.info(href);
-  let out = '<div class="video-container"><div class="videodiv">';
-  out += '<iframe src="https://www.youtube.com/embed/'+info.videoid+
-  '?modestbranding&start='+info.time+'" frameborder="0" allowfullscreen></iframe>'
-  out += '</div></div>'
-
-  return out;
-}
-
-var renderImage = function(href, title, text, curFilename) {
-  var parsed = paramInHrefParser(href);
-  href = parsed.href;
-  var options = parsed.options;
-
-  for(let option in options) {
-    if( !options.hasOwnProperty(option) ) continue;
-
-    if(option.match(/x[0-9]+/) || option.match(/[0-9]+x[0-9]*/)) { // 123x or x123 or 123x123
-      options.size = option.split('x');
-      if(options.size !== undefined) {
-        if(options.size[0].length > 0) {
-          options.width = options.size[0];
-        }
-        if(options.size.length > 1 && options.size[1].length > 0) {
-          options.height = options.size[1];
-        }
-      }
-    }
-  }
-
-  if(youtube.isVideo(href)) {
-    return renderYoutube(href, options);
-  } else {
-    var rel = path.relative(process.cwd(),path.resolve(curFilename,href));
-
-    var out = '<img src="' + href + '" alt="' + text + '"';
-    if(options.width) {
-      out += ' width="' + options.width + '"';
-    }
-    if(options.height) {
-      out += ' height="' + options.height + '"';
-    }
-    if (title) {
-      out += ' title="' + title + '"';
-    }
-
-    out += '>';
-    if(!options.nolightbox) { // if lightbox
-      var a = '<a href="'+href+'"';
-      a += ' data-lightbox="group"';
-      a += ' data-title="' + text + '"';
-      a += '>';
-      out = a+out+'</a>';
-    }
-    return out;
-  }
-}
-
 renderer._link = renderer.link;
 
-marked.setOptions({
-  renderer: renderer,
-  gfm: true,
-  tables: true,
-  breaks: false,
-  pedantic: false,
-  sanitize: false,
-  smartLists: true,
-  smartypants: false,
-});
-
 module.exports = function(obj) {
   console.log('Build step: Markdown');
   var options = obj.config.options;
@@ -152,24 +83,8 @@ module.exports = function(obj) {
     renderer.image = function(href, title, text) {
       return renderImage(href, title, text, article.filename);
     };
-
-    article.content = marked(article.content, {
-      highlight: function (code) {
-        var h;
-        if(highlightjs.getLanguage(article.metadata.lang))
-          h = highlightjs.highlight(article.metadata.lang, code, true);
-        else
-          h = highlightjs.highlightAuto(code);
-        return h.value;
-      },
-      renderer: renderer
-    });
+    lang = article.metadata.lang;
+    article.content = parser.parse(lexer.lex(article.content));
   });
   return Promise.resolve(obj);
 }
-
-module.exports._test = {
-  renderImage: renderImage,
-  paramInHrefParser: paramInHrefParser,
-  renderYoutube: renderYoutube
-};
diff --git a/sitegin/sitegin.js b/sitegin/sitegin.js
index 68387c57ff50483530312f91e5a7c03e65847b78..9ab6fbc1edde413f41925b33fb4904cb4e454fb7 100644
--- a/sitegin/sitegin.js
+++ b/sitegin/sitegin.js
@@ -18,6 +18,7 @@ module.exports = function(config) {
     ['resetJobs', './resetJobs'],
     ['sitemap', './sitemap'],
     ['parseRedirects','./parseRedirects'],
+    ['image', './image'],
 
     ['pipeline','./pipeline']
   )
diff --git a/theme/templates/article.html.nunj b/theme/templates/article.html.nunj
index ae611c97bfdcdc0e70c0f1939a248b8f0d69b7c3..a4b88712e49248fd9f2ef19ced8166dd491b4334 100644
--- a/theme/templates/article.html.nunj
+++ b/theme/templates/article.html.nunj
@@ -40,7 +40,7 @@
             <span style="color: #626262">{{ metadata.date.creation | date("D. M. YYYY") }}</span>
             napsal
             <span style="color: #626262">{{ metadata.author.name }}</span>
-            {% if metadata.date.modified %}
+            {% if (metadata.date.modification | date("D. M. YYYY")) != (metadata.date.creation | date("D. M. YYYY")) %}
               naposledy upraveno <span style="color: #626262">{{ metadata.date.modification | date("D. M. YYYY") }}</span>
             {% endif %}
           {% else %}