diff options
author | Runxi Yu <me@runxiyu.org> | 2024-05-14 07:50:22 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2024-05-14 07:50:22 +0800 |
commit | 937fd906d627c5df27d24a1f374804f0fef1f40a (patch) | |
tree | 5cc9472077977903e5bd17425102770aa00ce942 | |
parent | 250d6399a5138bea2f664487d8b498a89f76f793 (diff) | |
download | www-937fd906d627c5df27d24a1f374804f0fef1f40a.tar.gz |
HTML hlog
-rwxr-xr-x | hlog.cgi | 41 |
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/&/\&/g; s/</\</g; s/>/\>/g; s/"/\"/g; s/'"'"'/\'/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 |