Index

joshstock.in / 81b4469

Source for serving and static templating/compiling of https://joshstock.in.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
9612 Dec 2020 20:23009440aUpdate lua-gitwebJosh Stockin1190G

Blob @ joshstock.in / lua-gitweb / utils / nav.lua

text/plain522 bytesdownload raw
1-- nav.lua
2-- Builds HTML anchors for navigation
3
4-- Copyright (c) 2020 Joshua 'joshuas3' Stockin
5-- <https://joshstock.in>
6
7local _M = function(nav_data, join)
8 join = join or " | "
9 local build = {}
10 for _, link in pairs(nav_data) do
11 local url = link[1]
12 local text = link[2]
13 local f = string.format([[<a class="link" href="%s">%s</a>]], url, text)
14 table.insert(build, f)
15 end
16 return string.format([[<span class="nav">%s</span>]], table.concat(build, join))
17end
18
19return _M
20