summaryrefslogtreecommitdiff
path: root/cgi-bin/index.sh
diff options
context:
space:
mode:
Diffstat (limited to 'cgi-bin/index.sh')
-rwxr-xr-xcgi-bin/index.sh82
1 files changed, 82 insertions, 0 deletions
diff --git a/cgi-bin/index.sh b/cgi-bin/index.sh
new file mode 100755
index 0000000..3fea5c9
--- /dev/null
+++ b/cgi-bin/index.sh
@@ -0,0 +1,82 @@
+#!/bin/sh
+
+# Generates a site index from posts and pages.
+
+cat << EOH
+content-type: text/html
+
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <link rel="stylesheet" href="/includes/stylesheet.css" />
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <meta
+ property="og:description"
+ content="The World Wide Web pages of Adam Carpenter"
+ />
+ <meta
+ property="og:image"
+ content="https://nextcloud.53hor.net/index.php/s/Nx9e7iHbw4t99wo/preview"
+ />
+ <meta property="og:site_name" content="53hor.net" />
+ <meta property="og:title" content="Home" />
+ <meta property="og:type" content="website" />
+ <meta property="og:url" content="https://www.53hor.net" />
+ <title>53hornet ➙ Home</title>
+ </head>
+
+ <body>
+ <nav>
+ <ul>
+ <li>
+ <a href="/">
+ <img alt="home" src="/includes/icons/home-roof.svg" />
+ Home
+ </a>
+ </li>
+ <li>
+ <a href="/info.html">
+ <img alt="information" src="/includes/icons/information-variant.svg" />
+ Info
+ </a>
+ </li>
+ <li>
+ <a href="https://git.53hor.net">
+ <img alt="git" src="/includes/icons/git.svg" />
+ Repos
+ </a>
+ </li>
+ <li>
+ <a href="/software.html">
+ <img alt="software" src="/includes/icons/floppy-variant.svg" />
+ Software
+ </a>
+ </li>
+ <li>
+ <a type="application/rss+xml" href="/rss.xml">
+ <img alt="rss" src="/includes/icons/rss.svg" />
+ RSS
+ </a>
+ </li>
+ </ul>
+ </nav>
+
+ <header>
+ <noscript>
+ JavaScript? Where we're going we don't need JavaScript.
+ </noscript>
+ </header>
+
+ <article>
+ <h1 style="text-align: center">
+ The World Wide Web pages of Adam Carpenter (53hornet)
+ </h1>
+ <ul>
+EOH
+
+grep '<h1>' posts/*\
+ | sort -r\
+ | sed -e 's#^#<li><a href="/#' -e 's#:# #' -e 's#<h1#"#' -e 's#</h1>#</a></li>#'
+
+echo '</ul></article></body></html>'