website/site/code.sh

58 lines
1.6 KiB
Bash

#!/bin/sh
echo "<h1>Source Code Repositories</h1>"
echo " <p>Stuff I wrote or regularly contribute to</p>"
echo "<table class=\"repotable\">"
echo " <tr>"
echo " <th>Repository</th>"
echo " <th>Description</th>"
echo " </tr>"
curl -s \
"https://git.uugrn.org/api/v1/repos/search?uid=1&sort=updated" \
| jq -r '.data[] | .clone_url, .name, .description' \
| awk '
NR % 3 == 1 { printf(" <tr>\n <td><a href=\"%s\" target=_blank>", $0); }
NR % 3 == 2 { printf("%s</a></td>\n", $0); }
NR % 3 == 0 { printf(" <td>%s</td>\n </tr>\n", $0); }
'
echo "</table>"
# #!/bin/sh
#
# _distpath="$PWD/www/distfiles"
# mkdir -p "$_distpath"
#
# _repopath="/home/sdk/www/repo"
#
# out() { printf ' %s%s\n' "$1"; }
#
#
# repo() {
# NAME="$1"
# LINK="$2"
# DESC="$3"
# out " <tr>"
# out " <td><a href=\"$LINK\">$NAME</a></td>"
# out " <td>$DESC</td>"
# out " </tr>"
# }
#
# out "<table class=\"repotable\">"
# out " <tr>"
# out " <th>Repository</th>"
# out " <th>Description</th>"
# out " </tr>"
#
#
# repo "xpick" "https://github.com/c0dev0id/xpick" "Command line color picker with hex, xterm and rgb support"
# repo "mkpicindex" "https://github.com/c0dev0id/mkpicindex" "Image gallery generator with shell tools (static + js version)"
# repo "luakit" "https://github.com/luakit/luakit" "Fast, small, webkit based browser framework extensible by Lua"
# repo "mystuff" "https://github.com/c0dev0id/mystuff" "My OpenBSD ports"
# repo "dotfiles" "https://github.com/c0dev0id/dotfiles" "My Dotfiles"