Plugin.require_version("1.11") base_path = config["base_path"] if not base_path then base_path = "/tag" end function make_tag_links(tags_elem) tags_string = String.trim(HTML.strip_tags(tags_elem)) if not tags_string then return nil end -- Split the tags string like "foo, bar" into tags tags = Regex.split(tags_string, ",") -- Generate $tag elements for each tag local count = size(tags) local index = 1 tag_links = {} while (index <= count) do tag = String.trim(tags[index]) tag_link = HTML.create_element("a", tag) HTML.set_attribute(tag_link, "href", format("%s/%s.html", base_path, tag)) tag_links[index] = tostring(tag_link) index = index + 1 end links_html = String.join(" ยท ", tag_links) tags_html = [[