shithub: hell

ref: 566d628e2c8e1a34fc4ab72a6c6a3be41071460b
dir: /web/links-to-html.lua/

View raw version
-- links-to-html.lua
function Link(el)
  local release_id_file = io.open("release_id", "r")
  local release_id = ""

  if release_id_file then
    -- Read the first line of the file (assuming the ID is there)
    release_id = release_id_file:read("*l")
    io.close(release_id_file)
  end

  if release_id ~= "" then
    -- Replace the placeholder $release_id in the link target
    el.target = string.gsub(el.target, "$release_id", release_id)
  end

  return el
end