#!/bin/bash
##inherited from HTTP.sh's /templates/head.sh so that BashTube won't light on fire when I merge it LMAO ~luna
echo '
'
if [[ "${meta[title]}" != "" ]]; then echo "$(html_encode "${meta[title]}") - ${cfg[title]}"; else echo "${cfg[title]}"; fi
if [[ "${meta[author]}" != "" ]]; then echo ""; fi
if [[ "${meta[description]}" != "" ]]; then echo ""; fi
if [[ "${meta[keywords]}" != "" ]]; then echo ""; fi
if [[ "${meta[refresh]}" != "" ]]; then echo ""; fi
if [[ "${meta[redirect]}" != "" ]]; then echo ""; fi
if [[ "${meta[css]}" != "" ]]; then echo ""; fi
if [[ "${meta[title]}" != "" ]]; then echo ""; fi
#if [[ "${meta[og:type]}" != "" ]]; then echo ""; fi
if [[ "${cfg[url]}" != "" ]]; then echo ""; fi
#if [[ "${meta[og:image}" != "" ]]; then echo ""; fi
if [[ "${meta[lang]}" != "" ]]; then echo ""; fi
if [[ "${meta[description]}" != "" ]]; then echo ""; fi
if [[ "${meta[unsafe]}" != "" ]]; then echo "${meta[unsafe]}"; fi
#the CSS part has been moved to /app/webroot/css/style.css :3
#echo "
#"
declare -A strings_
#echo "
# "
if [[ ${cfg[template]} == 'default-v2' ]]; then
echo "
"
else
echo " "
if ! session_verify "${cookies[sh_session]}"; then
echo "Log in | Register"
else
echo "Logged in as ${cookies[username]} | Log out | Your feed | Your favourites"
fi
fi
# TODO: move this to a *real* template
# we'll need to figure out conditional templates first tho
if [[ "$query_nice" != '' ]]; then
strings_[query_nice]="$query_nice"
else
strings_[query_nice]=''
fi
render strings_ "${cfg[namespace]}/templates/themes/${cfg[template]}/elements/top.html"