forked from tilde.black/ops
gopher using templates in repo
This commit is contained in:
parent
1a4a647618
commit
9e5acde134
|
@ -19,12 +19,12 @@ if [ "$remotesha" != "$localsha" ] || [ "$1" = "force" ]; then
|
|||
git pull -q origin master 2> /dev/null
|
||||
|
||||
# build the web version
|
||||
/usr/local/bin/mkdocs build > /dev/null 2> /dev/null
|
||||
mkdocs build > /dev/null 2> /dev/null
|
||||
|
||||
# clear the gopher version
|
||||
rm /var/gopher/docs/*.md
|
||||
|
||||
# copy files to the gopher version
|
||||
cd "$HOME/docs/docs/" || exit 1
|
||||
cd "${DOC_DIR}/docs/" || exit 1
|
||||
cp ./*.md /var/gopher/docs/
|
||||
fi
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
all_users=$(grep /home < /etc/passwd | awk -F: '{print $1}')
|
||||
|
||||
output="/var/gopher/users.gophermap"
|
||||
current_dir=$(dirname "$(readlink -f "$0")")
|
||||
template_dir="${current_dir}/templates/gopher"
|
||||
output="${template_dir}/users.gophermap"
|
||||
printf "iUsers:\\n" > "$output"
|
||||
printf "%s" "$all_users" | while read -r n; do
|
||||
if [ -f "/var/gopher/users/${n}/gophermap" ]; then
|
||||
|
@ -10,4 +11,4 @@ printf "%s" "$all_users" | while read -r n; do
|
|||
fi
|
||||
done
|
||||
|
||||
cat /var/gopher/head.gophermap /var/gopher/users.gophermap > /var/gopher/gophermap
|
||||
cat "${template_dir}/head.gophermap" "${template_dir}/users.gophermap" > /var/gopher/gophermap
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
i _______ __ __ __ __ __ __ / null 70
|
||||
i | |__| .--| .-----. | |--| .---.-.----| |--. / null 70
|
||||
i |.| | | | | _ | -__|__| _ | | _ | __| < / null 70
|
||||
i `-|. |-|__|__|_____|_____|__|_____|__|___._|____|__|__| / null 70
|
||||
i |: | / null 70
|
||||
i |::.| / null 70
|
||||
i `---' / null 70
|
||||
i / null 70
|
||||
i / null 70
|
||||
1Guides and Documentation /docs
|
||||
i / null 70
|
|
@ -0,0 +1,9 @@
|
|||
iUsers:
|
||||
1~fox /users/fox
|
||||
1~joist /users/joist
|
||||
1~bloat /users/bloat
|
||||
1~brool /users/brool
|
||||
1~tolyl /users/tolyl
|
||||
1~poet /users/poet
|
||||
1~fruit /users/fruit
|
||||
1~betel /users/betel
|
11
webroot.sh
11
webroot.sh
|
@ -2,7 +2,8 @@
|
|||
|
||||
all_users=$(grep /home < /etc/passwd | awk -F: '{print $1}' | sort)
|
||||
current_dir=$(dirname "$(readlink -f "$0")")
|
||||
output="${current_dir}/templates/web/users.partial"
|
||||
template_dir="${current_dir}/templates/web"
|
||||
output="${template_dir}/users.partial"
|
||||
printf "<h3>Users:</h3>\\n" > "$output"
|
||||
printf "<ul>\\n" >> "$output"
|
||||
printf "%s" "$all_users" | while read -r n; do
|
||||
|
@ -12,8 +13,8 @@ printf "%s" "$all_users" | while read -r n; do
|
|||
done
|
||||
printf "</ul>\\n" >> "$output"
|
||||
|
||||
cat "${current_dir}/templates/web/head.partial" \
|
||||
"${current_dir}/templates/web/intro.partial" \
|
||||
"${current_dir}/templates/web/users.partial" \
|
||||
"${current_dir}/templates/web/foot.partial" > "/var/www/htdocs/index.html"
|
||||
cat "${template_dir}/head.partial" \
|
||||
"${template_dir}/intro.partial" \
|
||||
"${template_dir}/users.partial" \
|
||||
"${template_dir}/foot.partial" > "/var/www/htdocs/index.html"
|
||||
|
||||
|
|
Loading…
Reference in New Issue