     res.setHeader 'Content-Type', 'text/html; charset=utf-8'
     res.send html
 
-# Archives for a year
+# Archives for a year (e.g. /2013/)
 app.get /^\/(\d{4})\/?$/, (req, res) ->
   year = req.params[0]
   months = listMonths year

# 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"


    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  # 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}/"
