diff options
author | June McEnroe <june@causal.agency> | 2020-12-27 18:45:04 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-12-27 18:45:04 -0500 |
commit | 85016e706cd00e527dba3fa83b2783dfb56a4ffa (patch) | |
tree | fc28a97fede3b74ae2cb2e778ffd4c0ae59c637b /filters/owner-example.lua | |
download | src-85016e706cd00e527dba3fa83b2783dfb56a4ffa.tar.gz src-85016e706cd00e527dba3fa83b2783dfb56a4ffa.zip |
Squashed 'www/git.causal.agency/cgit/' content from commit 02221fd3
git-subtree-dir: www/git.causal.agency/cgit git-subtree-split: 02221fd3fe523a3293d64e3359036e3a71d6fd7e
Diffstat (limited to 'filters/owner-example.lua')
-rw-r--r-- | filters/owner-example.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/filters/owner-example.lua b/filters/owner-example.lua new file mode 100644 index 00000000..50fc25a8 --- /dev/null +++ b/filters/owner-example.lua @@ -0,0 +1,17 @@ +-- This script is an example of an owner-filter. It replaces the +-- usual query link with one to a fictional homepage. This script may +-- be used with the owner-filter or repo.owner-filter settings in +-- cgitrc with the `lua:` prefix. + +function filter_open() + buffer = "" +end + +function filter_close() + html(string.format("<a href=\"%s\">%s</a>", "http://wiki.example.com/about/" .. buffer, buffer)) + return 0 +end + +function filter_write(str) + buffer = buffer .. str +end |