summaryrefslogtreecommitdiff
path: root/repo/www/convert-internal-links.lua
blob: 21054d1cf1bde3e4ee8f4eee9ca13b6fe063d2a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
local config = require 'config'

function Link(link)
  if link.target:match("^[%w]+://")
  then
    return link
  end

  for _, ext in pairs(config.EXTENSIONS)
  do
    link.target = link.target:gsub("%."..ext.."$", ".html")
  end

  return link
end