commit e4115c1ae2c9e40ac34edfa03d6d6842e77535df
parent 7ed3d0090497aea1450475f35c5da9fe3dbf1132
Author: erai <erai@omiltem.net>
Date: Tue, 16 Apr 2024 23:09:51 -0400
dumb makefile
Diffstat:
6 files changed, 127 insertions(+), 94 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -0,0 +1 @@
+build/
diff --git a/Makefile b/Makefile
@@ -0,0 +1,32 @@
+SOURCES:=$(shell \
+ find . -not \( \
+ \( \
+ -name .git \
+ -or -name build \
+ \) -prune \
+ \) \( \
+ -name '*.ico' \
+ -or -name '*.png' \
+ -or -name '*.jpg' \
+ -or -name '*.css' \
+ -or -name '*.html' \
+ \) \
+ -printf '%P\n' \
+)
+TARGETS:=$(SOURCES:%=build/%)
+
+all: $(TARGETS)
+
+clean:
+ rm -rf build/
+
+.PHONY: all clean
+.SUFFIXES:
+
+build/%.html: %.html render.sh
+ @mkdir -p $(dir $@)
+ ./render.sh $< > $@
+
+build/%: %
+ @mkdir -p $(dir $@)
+ cp $< $@
diff --git a/about/index.html b/about/index.html
@@ -1,54 +1,20 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <title>About — Omiltem</title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta name="twitter:card" content="summary">
- <meta name="twitter:site" content="@erai271">
- <meta property="og:image" content="https://omiltem.net/about/pfp.jpg">
- <meta property="og:type" content="article">
- <meta property="og:title" content="About — Omiltem">
- <meta property="og:description" content="Hello, I'm erai and this is my website!">
- <meta name="description" content="Hello, I'm erai and this is my website!">
- <link rel="stylesheet" href="/css/style.css">
- <link rel="icon" href="/favicon.png">
- <link rel="me" href="https://furry.engineer/@erai">
- <link rel="me" href="https://bsky.app/profile/erai.gay">
- <link rel="me" href="https://github.com/erai271">
- <link rel="me" href="https://twitter.com/erai271">
- <link rel="me" href="https://t.me/erai271">
- </head>
- <body>
- <header>
- <p class="title">Omiltem</p>
- <nav>
- <ul class="links">
- <li><a href="/">HOME</a></li>
- <li><a href="https://github.com/erai271">CODE</a></li>
- <li><a href="/about">ABOUT</a></li>
- </ul>
- </nav>
- </header>
- <main>
- <article>
- <header>
- <p class="c">
- <img src="./pfp.jpg" class="pfp" alt="erai bunny profile picture">
- </p>
- <h2>Links</h2>
- </header>
- <ul>
- <li><p><a href="mailto:erai+blog@omiltem.net">email (erai+blog@omiltem.net)</a></p></li>
- <li><p><a href="https://github.com/erai271">github (erai271)</a></p></li>
- <li><p><a href="https://bsky.app/profile/erai.gay">bluesky (@erai.gay)</a></p></li>
- <li><p><a href="https://furry.engineer/@erai">mastodon (@erai@furry.engineer)</a></p></li>
- <li><p><a href="https://t.me/erai271">telegram (@erai271)</a></p></li>
- </ul>
- </article>
- </main>
- <footer>
- © 2024 erai
- </footer>
- </body>
-</html>
+title="About"
+description="Hello, I'm erai and this is my website!"
+
+<head>
+<link rel="me" href="https://furry.engineer/@erai">
+<link rel="me" href="https://bsky.app/profile/erai.gay">
+<link rel="me" href="https://github.com/erai271">
+<link rel="me" href="https://twitter.com/erai271">
+<link rel="me" href="https://t.me/erai271">
+</head>
+
+<p class="c"><img src="./pfp.jpg" width="200" height="200" class="pfp" alt="erai bunny profile picture"></p>
+<h2>Links</h2>
+<ul>
+ <li><p><a href="mailto:erai+blog@omiltem.net">email (erai+blog@omiltem.net)</a></p></li>
+ <li><p><a href="https://github.com/erai271">github (erai271)</a></p></li>
+ <li><p><a href="https://bsky.app/profile/erai.gay">bluesky (@erai.gay)</a></p></li>
+ <li><p><a href="https://furry.engineer/@erai">mastodon (@erai@furry.engineer)</a></p></li>
+ <li><p><a href="https://t.me/erai271">telegram (@erai271)</a></p></li>
+</ul>
diff --git a/css/style.css b/css/style.css
@@ -128,7 +128,12 @@ blockquote {
margin: 1em 0px;
}
+img {
+ display: inline-block;
+}
+
.pfp {
+ display: inline-block;
margin: 1em;
width: 200px;
height: 200px;
diff --git a/index.html b/index.html
@@ -1,40 +1,4 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <title>Omiltem</title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta name="twitter:card" content="summary">
- <meta name="twitter:site" content="@erai271">
- <meta property="og:image" content="https://omiltem.net/about/pfp.jpg">
- <meta property="og:type" content="article">
- <meta property="og:title" content="Omiltem">
- <meta property="og:description" content="Hello, I'm erai and this is my website!">
- <meta name="description" content="Hello, I'm erai and this is my website!">
- <link rel="stylesheet" href="/css/style.css">
- <link rel="icon" href="/favicon.png">
- </head>
- <body>
- <header>
- <p class="title">Omiltem</p>
- <nav>
- <ul class="links">
- <li><a href="/">HOME</a></li>
- <li><a href="https://github.com/erai271">CODE</a></li>
- <li><a href="/about">ABOUT</a></li>
- </ul>
- </nav>
- </header>
- <main>
- <article>
- <header>
- <h1>Home</h1>
- </header>
- <p>Hello, I'm erai and this is my website!</p>
- </article>
- </main>
- <footer>
- © 2024 erai
- </footer>
- </body>
-</html>
+title="Home"
+description="Hello, I'm erai and this is my website!"
+
+<p>Hello, I'm erai and this is my website!</p>
diff --git a/render.sh b/render.sh
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+set -ue
+
+if [ $# -ne 1 ]; then
+ echo "usage: ./render.sh <page.html>" >&2
+ exit 1
+fi
+
+title="asdf — Omiltem"
+style="/css/style.css?t=$(date -r css/style.css +%s)"
+thumbnail="https://omiltem.net/about/pfp.jpg"
+description=""
+copyright="2024"
+
+eval "$(sed -e '/^$/,$d' "$1")"
+
+if [ -z "${description}" ]; then
+ echo "error: no description" >&2
+ exit 1
+fi
+
+cat << EOF
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <title>${title}</title>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="twitter:card" content="summary">
+ <meta name="twitter:site" content="@erai271">
+ <meta property="og:image" content="${thumbnail}">
+ <meta property="og:type" content="article">
+ <meta property="og:title" content="${title}">
+ <meta property="og:description" content="${description}">
+ <meta name="description" content="${description}">
+ <link rel="stylesheet" href="${style}">
+ <link rel="icon" href="/favicon.png">
+$(sed -ne '/<head>/,/<\/head>/p' "$1" | sed -e '1d;$d')
+ </head>
+ <body>
+ <header>
+ <p class="title">Omiltem</p>
+ <nav>
+ <ul class="links">
+ <li><a href="/">HOME</a></li>
+ <li><a href="https://github.com/erai271">CODE</a></li>
+ <li><a href="/about">ABOUT</a></li>
+ </ul>
+ </nav>
+ </header>
+ <main>
+ <article>
+ <header>
+ <h1>${title}</h1>
+ </header>
+$(sed -e '1,/^$/d' -e '/<head>/,/<\/head>/d' "$1")
+ </article>
+ </main>
+ <footer>
+ © ${copyright} erai
+ </footer>
+ </body>
+</html>
+EOF