summaryrefslogtreecommitdiffstats
path: root/plugins/meta.lua
blob: 23013ca5cd12c882cc587d1ed36e210f9b15d142 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
description = HTML.select_one(page, "#meta-tags .description")

if description then
  description_contents = HTML.strip_tags(description)
  head = HTML.select_one(page, "head")
  HTML.append_child(head, HTML.parse('<meta type="description" content="' .. description_contents .. '">'))
else
  Log.warning("Missing description in " .. page_file)
end

HTML.delete(description)

timestamps = HTML.select_one(page, "#timestamps")

if timestamps then
  HTML.delete(timestamps)
  target = HTML.select_one(page, "#whoami")
  HTML.insert_after(target, timestamps)
end