Source for serving and static templating/compiling of https://joshstock.in.
{#} | Time | Hash | Subject | Author | # | (+) | (-) | GPG? |
---|---|---|---|---|---|---|---|---|
97 | 12 Dec 2020 21:05 | 8147f6b | Update lua-gitweb | Josh Stockin | 1 | 1 | 3 | G |
1 | -- parse_uri.lua |
2 | -- URI parsing |
3 | |
4 | -- Copyright (c) 2020 Joshua 'joshuas3' Stockin |
5 | -- <https://joshstock.in> |
6 | |
7 | local utils = require("utils/utils") |
8 | |
9 | local _M = function() |
10 | local uri = ngx.var.uri |
11 | local split = string.split(string.sub(uri,2),"/") |
12 | |
13 | local parsed = {} |
14 | parsed.uri = uri |
15 | parsed.parts = split |
16 | parsed.repo = split[1] |
17 | |
18 | return parsed |
19 | end |
20 | |
21 | return _M |
22 |