       return component.text
   null
 
+convertToAbsoluteLinks = (html, params) ->
+  html = html.replace /(<a href|<img src)="(.*?)"/g, (match, p1, p2) ->
+    p2 = p2.replace /^\.\.\/(?!\.\.)/g, "/#{params.year}/#{params.month}/"
+    p2 = p2.replace /^\.\.\/\.\.\/(?!\.\.)/g, "/#{params.year}/"
+    p2 = p2.replace /^\.\.\/\.\.\/\.\.\/(?!\.\.)/g, "/"
+    if p2.indexOf('://') is -1
+      if p2[0] isnt '/'
+        p2 = "/#{params.year}/#{params.month}/#{params.date}/#{p2}"
+      if params.absoluteURL
+        p2 = "#{config.siteURL}#{p2}"
+    "#{p1}=\"#{p2}\""
+  html
+
 # Format Markdown content into HTML
 formatPage = (input, callback) ->
   lex = marked.Lexer.lex(input.markdown)

    title = '(untitled)'

  body = marked.Parser.parse(lex)

  # Date
  if input.year? and input.month? and input.date?

      return
    url = "/#{file.year}/#{file.month}/#{file.datepart}/#{file.slug}"
    formatPage {
      markdown    : markdown
      link        : url
      year        : file.year
      month       : file.month
      date        : file.date
      noTitle     : true
      absolutePath: true
    }, (err, html) ->
      if err
        logMessage err
