     res.setHeader 'Content-Type', 'text/html; charset=utf-8'
     res.send 404, html
 
+# Find first heading from lex object
 findTitleFromLex = (lex) ->
   for component in lex
     if component.type is 'heading'
       return component.text
-  null
-
+  null  # not found
+
+# Convert links in HTML to absolute URL
+#   html (string): HTML
+#   params: {
+#     year  (string): entry's year
+#     month (string): entry's month
+#     date  (string): entry's date
+#     absoluteURL (boolean): If true, prepend config.siteURL
+#                            If false, start with /
+#   }
 convertToAbsoluteLinks = (html, params) ->
   html = html.replace /(<a href|<img src)="(.*?)"/g, (match, p1, p2) ->
     p2 = p2.replace /^\.\.\/(?!\.\.)/g, "/#{params.year}/#{params.month}/"

# EJS template for formatting pages
pageTemplateFilename = "#{basedir}/config/page.ejs"

# If this file will be created,
# the index is needed to be generated again.
reindexCheckFilename = "#{basedir}/reindex-needed"


  console.log "#{configFilename} does not exist"
  process.exit 1

# Log message to stdout
logMessage = (str, opts) ->
  buf = ''
  if not opts?.noTime
