summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2024-05-14 07:50:22 +0800
committerRunxi Yu <me@runxiyu.org>2024-05-14 07:50:22 +0800
commit937fd906d627c5df27d24a1f374804f0fef1f40a (patch)
tree5cc9472077977903e5bd17425102770aa00ce942
parent250d6399a5138bea2f664487d8b498a89f76f793 (diff)
downloadwww-937fd906d627c5df27d24a1f374804f0fef1f40a.tar.gz
HTML hlog
-rwxr-xr-xhlog.cgi41
1 files changed, 37 insertions, 4 deletions
diff --git a/hlog.cgi b/hlog.cgi
index 6bf1a0d..ad8e134 100755
--- a/hlog.cgi
+++ b/hlog.cgi
@@ -1,9 +1,42 @@
 #!/bin/sh
 
-printf 'Content-Type: text/plain\r\n\r\n'
+printf 'Content-Type: text/html\r\n\r\n'
 
-TZ='Asia/Shanghai' ls --time-style '+%Y-%m-%d %H:%M:%S %Z' -l /srv/hlog/runxiyu.hlog
 
-printf '\n'
+cat << EOF
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8" />
+    <title>Runxi Yu's Hyperlog</title>
+    <link rel="stylesheet" href="./style.css" />
+    <link rel="icon" href="./favicon.ico" sizes="any" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 
+    <meta name="theme-color" content="#241504" />
+    <meta name="color-scheme" content="light dark">
+</head>
+<body>
+<header>
+    <h1>Runxi Yu's Hyperlog</h1>
+</header>
+<article>
+<pre>
+EOF
+TZ='Asia/Shanghai' ls --time-style '+%Y-%m-%d %H:%M:%S %Z' -l /srv/hlog/runxiyu.hlog
+printf '</pre>'
 
-cat /srv/hlog/runxiyu.hlog
+printf '<pre>'
+sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/"/\&quot;/g; s/'"'"'/\&#39;/g' /srv/hlog/runxiyu.hlog
+cat << EOF
+</pre>
+</article>
+<footer>
+    <ul role="list">
+        <li><a href="./">Home</a></li>
+        <li>Runxi Yu</li>
+        <li><a rel="license" href="./pubdom.html">Public Domain</a></li>
+    </ul>
+</footer>
+</body>
+</html>
+EOF