Source for serving and static templating/compiling of https://joshstock.in.
{#} | Time | Hash | Subject | Author | # | (+) | (-) | GPG? |
---|---|---|---|---|---|---|---|---|
96 | 12 Dec 2020 20:23 | 009440a | Update lua-gitweb | Josh Stockin | 1 | 23 | 0 | 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 = {} |
10 | |
11 | _M.parse_uri = function() |
12 | local uri = ngx.var.uri |
13 | local split = string.split(string.sub(uri,2),"/") |
14 | |
15 | local parsed = {} |
16 | parsed.uri = uri |
17 | parsed.parts = split |
18 | parsed.repo = split[1] |
19 | |
20 | return parsed |
21 | end |
22 | |
23 | return _M |
24 |