From 197aa6eecd7d04d752824a643f4e4db545dcd716 Mon Sep 17 00:00:00 2001 From: mika Date: Mon, 14 Sep 2026 17:22:49 +0200 Subject: [PATCH] generate colophon and default page --- .gitignore | 7 +++++ COPYME.html | 15 ++++++++++ Makefile | 38 ++++++++++++++++++++++++ colophon.html | 31 ++++++++++++++++++++ contrib/mkthought | 8 +++++ include/stdfooter.html | 4 +++ include/stdhead.html | 3 ++ include/stdnav.html | 10 +++++++ index.html | 30 +++++++++++++++++++ mkpage.c | 66 ++++++++++++++++++++++++++++++++++++++++++ schemata.sql | 5 ++++ 11 files changed, 217 insertions(+) create mode 100644 .gitignore create mode 100644 COPYME.html create mode 100644 Makefile create mode 100644 colophon.html create mode 100755 contrib/mkthought create mode 100644 include/stdfooter.html create mode 100644 include/stdhead.html create mode 100644 include/stdnav.html create mode 100644 index.html create mode 100644 mkpage.c create mode 100644 schemata.sql diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..50e25f75389dbdcd37424c676c767016fd1d8a82 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +/mkpage +/mkpage.o +/out +/darkhttpd* + +/kethel.db +/stage.sql diff --git a/COPYME.html b/COPYME.html new file mode 100644 index 0000000000000000000000000000000000000000..632447a0e827ccda42556197ae0e19455bc1fedf --- /dev/null +++ b/COPYME.html @@ -0,0 +1,15 @@ + + + + + PAGETITLE - m1kadev.nl + + + + +
+

your content here

+
+ + + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..64b7fbaef219daaacc36a6be06297514964b504f --- /dev/null +++ b/Makefile @@ -0,0 +1,38 @@ +CC=clang +CFLAGS=-Wall -Wextra -Werror -pedantic -O2 -std=c99 + +DEVSERVER='https://raw.githubusercontent.com/emikulic/darkhttpd/refs/heads/master/darkhttpd.c' + +.PHONY: all serve initdb commitdb + +all: mkpage out/index.html out/colophon.html + +initdb: + @echo "In the sql prompt, use '.read schemata.sql'" + sqlite3 kethel.db + +commitdb: + @echo "In the sql prompt, use '.read stage.sql'" + sqlite3 kethel.db + rm stage.sql + +serve: all darkhttpd + ./darkhttpd out + +darkhttpd: + curl $(DEVSERVER) > darkhttpd.c + $(CC) -O2 darkhttpd.c -o darkhttpd + +mkpage: mkpage.c + $(CC) $(CFLAGS) -c mkpage.c -o mkpage.o + $(CC) $(CFLAGS) mkpage.o -o mkpage + +# list of all pages + +out/index.html: index.html + ./mkpage index.html out/index.html + +out/colophon.html: colophon.html + ./mkpage colophon.html out/colophon.html + +out/thoughts/index.html: kethel.db diff --git a/colophon.html b/colophon.html new file mode 100644 index 0000000000000000000000000000000000000000..f0cac689080d20c99c916118bcbf7fd3f6a0b6e5 --- /dev/null +++ b/colophon.html @@ -0,0 +1,31 @@ + + + + + colophon - m1kadev.nl + + + + +
+

colophon

+
+ [...] start with left-aligned black text on a white background, and to apply styling only to solve a specific problem. +
- Brutalist Web Design +
+

+ The current iteration of m1kadev.nl was an experiment, to see how far one could get by using + as little javascript and css possible, with as little build steps as possible. Which I think + I've succeeded in rather well. This entire site uses only one (!) CSS rule at the moment. +

+

Used technologies:

+ +
+ + + diff --git a/contrib/mkthought b/contrib/mkthought new file mode 100755 index 0000000000000000000000000000000000000000..9a1d2ea4c821029b1e5b001b053277099e61f2dd --- /dev/null +++ b/contrib/mkthought @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +echo -n "Title: " +TITLE=$(cat) +echo -n "Body: " +BODY=$(cat) + +echo "INSERT INTO thoughts VALUES('$TITLE', '$BODY', '$(date "+%Y-%m-%d %H:%M:%S")');" >> ./stage.sql diff --git a/include/stdfooter.html b/include/stdfooter.html new file mode 100644 index 0000000000000000000000000000000000000000..887891d6e9bee7c9004c3973f27063af27e4bc6c --- /dev/null +++ b/include/stdfooter.html @@ -0,0 +1,4 @@ +
+ diff --git a/include/stdhead.html b/include/stdhead.html new file mode 100644 index 0000000000000000000000000000000000000000..c0b32d24ba2712de5d5311337a02720c8f7b383c --- /dev/null +++ b/include/stdhead.html @@ -0,0 +1,3 @@ + + + diff --git a/include/stdnav.html b/include/stdnav.html new file mode 100644 index 0000000000000000000000000000000000000000..fcaf532aeeafb5678dee502495816e602d1cc477 --- /dev/null +++ b/include/stdnav.html @@ -0,0 +1,10 @@ +
+ www.
m1kadev.nl
+ / + +
diff --git a/index.html b/index.html new file mode 100644 index 0000000000000000000000000000000000000000..856bd63e2ec05481f931cbc999fecb5d59b39356 --- /dev/null +++ b/index.html @@ -0,0 +1,30 @@ + + + + + root - m1kadev.nl + + + + +
+

+ Welcome, sit down and + grab a BREW! +

+ +

+ I'm currently in my exam year of highschool + (VWO-NT/NG). + However, this hasn't stopped me from shitposting on main, vagueposting on main, + and livetweeting about the latest game/series/film i've watched. +

+ +

+ Welcome, and enjoy your stay! +
-mika +

+
+ + + diff --git a/mkpage.c b/mkpage.c new file mode 100644 index 0000000000000000000000000000000000000000..cd5d601b342dcde1235bb27a4d735e6d2d1b79c2 --- /dev/null +++ b/mkpage.c @@ -0,0 +1,66 @@ +#include +#include +#include +#include + +int main(int argc, char* argv[]) { + if (argc <= 2) { + fprintf(stderr, "Usage: ./mkpage \n"); + } + FILE* input = fopen(argv[1], "r"); + if (input == NULL) { + fprintf(stderr, "mkpage: fopen: %s does not exist!\n", argv[1]); + return -1; + } + FILE* output = fopen(argv[2], "w"); + if (output == NULL) { + fprintf(stderr, "mkpage: fopen: could not open %s for writing\n", argv[1]); + fclose(input); + return -1; + } + uintptr_t lineno = 0; + char buf[256]; // ! NOTE: lines longer than 255 chars do not process correctly + + while (fgets(buf, sizeof(buf), input) != NULL) { + lineno++; + + if (strncmp("