recycled.cloud/page-template.sh

59 lines
1.5 KiB
Bash
Raw Normal View History

#!/bin/sh
# Most general template template for nyll.
CURRENT_PAGE=$(echo "$1" | cut -d. -f 1)
if_page () {
if [ "$CURRENT_PAGE" = "$1" ]; then
echo "$2"
fi
}
cat << EOF
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>${TITLE:?}</title>
<link rel="stylesheet" href="assets/css/bootstrap-reboot.min.css">
<link rel="stylesheet" href="assets/css/bootstrap-grid.min.css">
<link rel="stylesheet" href="assets/css/main.css">
</head>
<body>
<div id="section-nav">
<div class="container">
<div class="row">
<div class="col-4">
<img src="assets/images/logo.png" id="nav-logo" />
</div>
<div class="col-6">
<nav>
<a href="index.html" class="$(if_page index nav-current)">Home</a>
<a href="services.html" class="$(if_page services nav-current)">Services</a>
<a href="manifesto.html" class="$(if_page manifesto nav-current)">Manifesto</a>
<a href="contact.html" class="$(if_page contact nav-current)">Contact</a>
</nav>
</div>
<div class="col-2">
<a href="/" class="nav-current">EN</a>
</div>
</div>
</div>
</div>
$(cat "$1")
<footer>
<div class="container">
<div class="row">
<div class="col-5">
<p><a href="/terms">Terms of Usage & Privacy Policy</a></p>
</div>
<div class="col-7">
<p>CC-BY e-Durable SA | <a href="https://e-durable.ch">More about e-Durable SA<a/></p>
</div>
</div>
</div>
</footer>
</body>
</html>
EOF