From 3782f2e533b0a5e517e2e4074db166c8d65dc8cd Mon Sep 17 00:00:00 2001 From: lemurianmage Date: Sat, 13 Jun 2026 17:24:45 +0200 Subject: buttons --- GNUmakefile | 36 ++++++++++++++++++ README | 77 ++++++++++++++++++++++++++++++++++++++ README.md | 80 ---------------------------------------- makefile | 37 ------------------- src/contact.md | 2 +- src/index.md | 2 +- static/buttons/gentoo-badge.png | Bin 3723 -> 0 bytes static/buttons/girlrot.gif | Bin 5216 -> 0 bytes static/stylesheet.css | 31 ++++++++++------ template.html | 34 +++++++++++++++-- template.pl | 19 ++++++++-- 11 files changed, 180 insertions(+), 138 deletions(-) create mode 100644 GNUmakefile create mode 100644 README delete mode 100644 README.md delete mode 100644 makefile delete mode 100644 static/buttons/gentoo-badge.png delete mode 100644 static/buttons/girlrot.gif diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..b56bf39 --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,36 @@ +build: $(patsubst src/%.md, out/%.html, $(shell find src -type f)) \ + $(patsubst static/%, out/%, $(shell find static -type f)) \ + $(patsubst src/%, out/%, $(shell find src -type f ! -name "*.md")) + +serve: + xdg-open http://localhost:8000/ + python3 -m http.server -d out/ + +watch: + find . -type f ! -path "./out/*" | entr make build + +out/%.html: src/%.md template.html template.pl + @mkdir -p $(dir $@) + ./template.pl $< > $@ + +out/%: src/% + @mkdir -p $(dir $@) + cp $< $@ + +out/%: static/% + @mkdir -p $(dir $@) + cp $< $@ + +compress: build # for gzip-static, check the openbsd httpd.conf(5) man page +# grep -Il skips binary files + find out/ -type f -exec grep -Il . {} \; \ + -exec gzip -k {} \; + +publish: compress build + rsync -rcvP --delete out/ \ + lemurianmage@slimegirl.nexus:/var/www/htdocs/slimegirl.nexus + +clean: + rm -r out/ + +.PHONY: build serve watch compress publish clean diff --git a/README b/README new file mode 100644 index 0000000..d9191fc --- /dev/null +++ b/README @@ -0,0 +1,77 @@ +# slimegirl.nexus + +my website and blog found @ https://slimegirl.nexus. +everything is generated from markdown with md4c and a perl script +that does the templating and html post-processing work (template.pl). + +# dependencies + +build: gnu make, perl5, mojolicious, md2html (md4c) +dev: python3, entr +publish: rsync + +# loicense + +intellectual property is a spook. + _,_ + /7/Y/^\ + vuVV|C)| __ _ + \|^ / .' Y '>, + )| \) / _ _ \ + //)|\\ )(_) (_)(|} + / ^| \ \ { 4A } / + //^| || \\ \uLuJJ/\l +>//||| |\\\| |3 p)/ +| """"" 7/>l__ _____ ____ /nnm_n// +L>_ _-< 7/|_-__,__-)\,__)(". \_>-<_/D +)D" Y "c) 9) //V \_"-._.__G G_c__.-__<"/ ( \ + | | | |(| < "-._"> _.G_.___)\ \7\ + \"=" // | (,"-.__.|\ \<.__.-" ) \ \ + '---' | |,"-.__"| \!"-.__.-".\ \ \ + |_;._/ (_"-.__"'\ \"-.__.-".| \_\ + )(" V \"-.__"'|\ \-.__.-".) \ \ + ( "-.__'"\_\ \.__.-"./ \ l + ) ".__"">>G\ \__.-"> V ) + "" G<\ \_.-" ./7 + G<\ \ /// + ___ GD' + / / )E_>" + _/ ( | \() + / \ / | | + /\\| | | + / '(( | | + / / )\ \ | + / y \y |Y | + / / ( | | + L ." | | / + | \( | | + \_| | | + | \ { "| + | || | | + |x|| \_,/ + } || / \' + | || |_/ + | (| | }\ + | || } || + | || | || + | || |\|| + / || | || + | || ( |! + | |/ ) || + _/ \ | }| + _.-"_ ( )| jjs ! || + c_"-_-"_ ) | || + c,-_-'_--"" { || + "C(_/" \ /| + (! ) + /| \ + / |( + /7||\\ + ()U cUu" diff --git a/README.md b/README.md deleted file mode 100644 index bb3ea8f..0000000 --- a/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# slimegirl.nexus - -my website and blog found @ https://slimegirl.nexus.\ -everything is generated from markdown with md2html and a perl script -that does the templating and html post-processing work (template.pl). - -## dependencies - -build: make, perl5, Mojo::DOM, md2html (md4c)\ -dev: python3, entr\ -publish: rsync\ -a typical linux/bsd system will have most of these already. - -## loicense - -intellectual property is a spook. -``` - _,_ - /7/Y/^\ - vuVV|C)| __ _ - \|^ / .' Y '>, - )| \) / _ _ \ - //)|\\ )(_) (_)(|} - / ^| \ \ { 4A } / - //^| || \\ \uLuJJ/\l ->//||| |\\\| |3 p)/ -| """"" 7/>l__ _____ ____ /nnm_n// -L>_ _-< 7/|_-__,__-)\,__)(". \_>-<_/D -)D" Y "c) 9) //V \_"-._.__G G_c__.-__<"/ ( \ - | | | |(| < "-._"> _.G_.___)\ \7\ - \"=" // | (,"-.__.|\ \<.__.-" ) \ \ - '---' | |,"-.__"| \!"-.__.-".\ \ \ - |_;._/ (_"-.__"'\ \"-.__.-".| \_\ - )(" V \"-.__"'|\ \-.__.-".) \ \ - ( "-.__'"\_\ \.__.-"./ \ l - ) ".__"">>G\ \__.-"> V ) - "" G<\ \_.-" ./7 - G<\ \ /// - ___ GD' - / / )E_>" - _/ ( | \() - / \ / | | - /\\| | | - / '(( | | - / / )\ \ | - / y \y |Y | - / / ( | | - L ." | | / - | \( | | - \_| | | - | \ { "| - | || | | - |x|| \_,/ - } || / \' - | || |_/ - | (| | }\ - | || } || - | || | || - | || |\|| - / || | || - | || ( |! - | |/ ) || - _/ \ | }| - _.-"_ ( )| jjs ! || - c_"-_-"_ ) | || - c,-_-'_--"" { || - "C(_/" \ /| - (! ) - /| \ - / |( - /7||\\ - ()U cUu" -``` \ No newline at end of file diff --git a/makefile b/makefile deleted file mode 100644 index 8c7f1de..0000000 --- a/makefile +++ /dev/null @@ -1,37 +0,0 @@ -all: build - -build: $(patsubst src/%.md, out/%.html, $(shell find src -type f)) \ - $(patsubst static/%, out/%, $(shell find static -type f)) \ - $(patsubst src/%, out/%, $(shell find src -type f ! -name "*.md")) - -serve: - xdg-open http://localhost:8000/ - python3 -m http.server -d out/ - -watch: - find . -type f ! -path "./out/*" | entr make build - -out/%.html: src/%.md template.html template.pl - @mkdir -p $(dir $@) - ./template.pl $< > $@ - -out/%: src/% - @mkdir -p $(dir $@) - cp $< $@ - -out/%: static/% - @mkdir -p $(dir $@) - cp $< $@ - -compress: build # for gzip-static, check the openbsd httpd.conf(5) man page - find out/ -type f \( -name "*.html" -o -name "*.css" \) \ - -exec gzip -k {} \; - -publish: compress build - rsync -rcvP --delete out/ \ - lemurianmage@slimegirl.nexus:/var/www/htdocs/slimegirl.nexus - -clean: - rm -r out/ - -.PHONY: build serve watch compress publish clean diff --git a/src/contact.md b/src/contact.md index 0369b87..0093e25 100644 --- a/src/contact.md +++ b/src/contact.md @@ -7,5 +7,5 @@ ## donations -monero: `83FxBRziyTQWuPKqGTesWGjLfM5Vai8QSbikur5zGHWKFc584cgmbKHjWpQoJzR9Su7NVEX9GVg23iksCKp8doBFCVSsGca` +monero:
83FxBRziyTQWuPKqGTesWGjLfM5Vai8QSbikur5zGHWKFc584cgmbKHjWpQoJzR9Su7NVEX9GVg23iksCKp8doBFCVSsGca
![Monero public address QR code](monero-qr.png) \ No newline at end of file diff --git a/src/index.md b/src/index.md index ac17203..8c275bb 100644 --- a/src/index.md +++ b/src/index.md @@ -3,4 +3,4 @@ ## about This is the personal website of philomena (she/her) also known as lemurianmage and azureazure in other places. My interests include mathematics, philosophy, -C, Unix, Lisp and electrical engineering. My paws are big and my tail is fluffy. \ No newline at end of file +C, UNIX, Lisp and electrical engineering. My paws are big and my tail is fluffy. \ No newline at end of file diff --git a/static/buttons/gentoo-badge.png b/static/buttons/gentoo-badge.png deleted file mode 100644 index 971ffe2..0000000 Binary files a/static/buttons/gentoo-badge.png and /dev/null differ diff --git a/static/buttons/girlrot.gif b/static/buttons/girlrot.gif deleted file mode 100644 index 8e18810..0000000 Binary files a/static/buttons/girlrot.gif and /dev/null differ diff --git a/static/stylesheet.css b/static/stylesheet.css index df916fb..80240d8 100644 --- a/static/stylesheet.css +++ b/static/stylesheet.css @@ -1,11 +1,16 @@ +* +{ + color-scheme: light dark; +} + body { - background-color: white; - color: black; max-width: 80ch; margin: auto; - font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', sans-serif; + font-family: serif; font-size: 1.2em; + overflow: hidden; + padding: 0 1em; } nav { text-align: center; } @@ -16,7 +21,7 @@ hr border-bottom: 1px dashed; } -img +article img { display: block; margin: auto; @@ -24,13 +29,15 @@ img margin-bottom: 1em; } -@media (prefers-color-scheme: dark) +footer { - body - { - background-color: #1e1f21; - color: #eeeff1; - } - :link { color: #bad7ff; } - :visited { color: #f6baff; } + text-align: center; + font-size: 0.9em; } + +pre +{ + overflow: scroll; +} + +a { text-decoration: none; } diff --git a/template.html b/template.html index f85cd94..37f314e 100644 --- a/template.html +++ b/template.html @@ -9,14 +9,42 @@


-
contact
+ + diff --git a/template.pl b/template.pl index 747ac7c..651d7aa 100755 --- a/template.pl +++ b/template.pl @@ -1,15 +1,16 @@ #!/usr/bin/env perl -# this script is generally responsible for all html postprocessing that md2html can't do +# this script is generally responsible for all html postprocessing use v5.39; use utf8; use autodie; use Mojo::DOM; +use File::Basename; my $template = do { - local $/ = undef; + local $/; open my $fh, '<', 'template.html'; <$fh>; }; @@ -17,16 +18,26 @@ my $template = do { my $dom = Mojo::DOM->new($template); my $content = `md2html $ARGV[0]`; + # inject content @
-$dom->at('article')->append_content($content); +$dom->at('article')->content($content); # replace with the contents of the first <h1> +# also append a <hr> after the first <h1> my $title_dom = $dom->at('h1'); $dom->at('title')->content($title_dom->text) if ($title_dom); +$title_dom->append('<hr>'); + +# makes the up button go up a directory +my $parent = dirname $ARGV[0]; +$parent =~ s/^(?:.+?)(\/.*)/$1/; +$parent = dirname $parent if (basename($ARGV[0]) eq 'index.md' or $parent eq "src"); +$dom->at('#go-up')->attr(href => $parent); +# give title the same contents as alt if it exists for my $img ($dom->find('img')->each) { my $alt = $img->attr('alt'); - $img->attr(title => $alt); + $img->attr(title => $alt) if ($alt); } say "$dom"; -- cgit v1.2.3