From f96a73084b6e1377ef6de64580906ad66466d823 Mon Sep 17 00:00:00 2001 From: m1ka Date: Wed, 8 Apr 2026 20:58:12 +0200 Subject: [PATCH] add link to codeberg repository --- Dockerfile | 3 +- bricks/base-header.thtml | 3 +- bricks/extended-footer.thtml | 5 + bricks/footer.thtml | 10 ++ kethel/lib/bricks.ex | 6 +- kethel/lib/pages.ex | 11 +- pages/colophon.fxg | 10 +- scripts/dyn-codeberg-logo.js | 15 +++ static/.DS_Store | Bin 0 -> 6148 bytes static/codeberg-logo_icon_blue.svg | 164 ++++++++++++++++++++++++++++ static/codeberg-logo_icon_white.svg | 164 ++++++++++++++++++++++++++++ static/github-mark-white.svg | 1 - static/motds | 6 - styles/base.css | 40 ++++++- templates/base.thtml | 6 +- templates/pages/colophon.thtml | 5 +- 16 files changed, 418 insertions(+), 31 deletions(-) create mode 100644 bricks/extended-footer.thtml create mode 100644 bricks/footer.thtml create mode 100644 scripts/dyn-codeberg-logo.js create mode 100644 static/.DS_Store create mode 100644 static/codeberg-logo_icon_blue.svg create mode 100644 static/codeberg-logo_icon_white.svg delete mode 100644 static/github-mark-white.svg delete mode 100644 static/motds diff --git a/Dockerfile b/Dockerfile index a8d2aa18b6482f84c706ed3e53f474b3445d9e09..8657b65e43a74dd2aeb320e858713af77d2a6d2d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ FROM alpine:3 -RUN apk add --no-cache elixir nginx git rust cargo nodejs npm +RUN apk add --no-cache elixir nginx git rust cargo nodejs npm tzdata +RUN ln -s /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime COPY nginx.conf /etc/nginx/nginx.conf # setup folders diff --git a/bricks/base-header.thtml b/bricks/base-header.thtml index bb8dfd9cbb0236e6b409d6ea02dd6f31e6de3170..041d8e7e3c1907739eaa7b22a84407218b6e3c93 100644 --- a/bricks/base-header.thtml +++ b/bricks/base-header.thtml @@ -1,4 +1,3 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/bricks/extended-footer.thtml b/bricks/extended-footer.thtml new file mode 100644 index 0000000000000000000000000000000000000000..930de73c25dd25940dfea74ab28fbfedbd016154 --- /dev/null +++ b/bricks/extended-footer.thtml @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/bricks/footer.thtml b/bricks/footer.thtml new file mode 100644 index 0000000000000000000000000000000000000000..4a8fa9f9e7a1156ac5893abd23ec8d2f2191ae94 --- /dev/null +++ b/bricks/footer.thtml @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/kethel/lib/bricks.ex b/kethel/lib/bricks.ex index 377ae6de1b7e417ad43d6af723ffc6e23a58ed63..9827fc562f18e70044f22a34c9421d98079287f0 100644 --- a/kethel/lib/bricks.ex +++ b/kethel/lib/bricks.ex @@ -25,14 +25,14 @@ defmodule Bricks do {e_build_date, 0} = System.cmd("date", ["+%H:%M:%S %d/%m/%y"]) footer = """ - Built from commit #{git_commit |> binary_slice(0..7)}, on #{build_date} + Built from commit #{git_commit |> binary_slice(0..7)}, on #{build_date}. """ extended_footer = """ Built from commit #{git_commit |> String.trim()}, using lightningcss #{lcss_version}, - html-minifier-next version #{hmn_version}, uglifyjs version #{ujs_version}, on #{e_build_date} + html-minifier-next version #{hmn_version}, uglifyjs version #{ujs_version}, on #{e_build_date}. """ - Map.merge(%{footer: footer, extended_footer: extended_footer}, from_files) + Map.merge(%{build_info: footer, extended_build_info: extended_footer}, from_files) end end diff --git a/kethel/lib/pages.ex b/kethel/lib/pages.ex index 9037a9acc027328ecb58e8ac7697c76f7c23d6c5..93538a9974eab7e0961051a7ff7fc0c2d37ba311 100644 --- a/kethel/lib/pages.ex +++ b/kethel/lib/pages.ex @@ -57,14 +57,21 @@ defmodule Pages do Map.merge(%{fxg_content: invoke_fxg(page_data), location: location}, pages.bricks) page_rendered = Mustache.render(template, mustache_context) - File.write!(output_path, page_rendered) + File.write!(output_path, invoke_hmn(page_rendered)) IO.puts("[COMPILED] #{pages.project_root}/pages#{page_path}.fxg -> #{output_path}") end - # doc "Invokes the fxg compiler, a la `fxg -`, piping `data` into the process stdin, and reading the stdout. " + @doc "Invokes the fxg compiler, a la `fxg -`, piping `data` into the process stdin, and reading the stdout. " @spec invoke_fxg(binary()) :: binary() defp invoke_fxg(data) do {:ok, res} = Rambo.run("fxg", ["-"], in: data) res.out end + + @doc "Invokes the fxg compiler, a la `fxg -`, piping `data` into the process stdin, and reading the stdout. " + @spec invoke_hmn(binary()) :: binary() + defp invoke_hmn(data) do + {:ok, res} = Rambo.run("npx", ["html-minifier-next", "--preset", "conservative"], in: data) + res.out + end end diff --git a/pages/colophon.fxg b/pages/colophon.fxg index 67abc0cc75e355e1fbf009de34df3f737d987fef..793d16acb3127327b4e1341fcd59eb470941d604 100644 --- a/pages/colophon.fxg +++ b/pages/colophon.fxg @@ -1,10 +1,14 @@ ====== colophon ====== -===== about ===== +you're looking at a <#https://en.wiktionary.org/wiki/beautiful#English beautiful> site, written with 100% non-ai code. -you're looking at a <#https://en.wiktionary.org/wiki/beautiful#English beautiful> site, with <#https://caddyserver.com/ caddy> as its backend. +===== fonts ===== -the site generator is a home-grown non-gmo <#https://github.com/m1kadev/www.m1kadev.nl/tree/main/kethel/ elixir app>. the internal markup language is <#https://github.com/m1kadev/fxg fxg>, made to be more legible than markdown. +this website is intended to be set in //New York//, an <#https://developer.apple.com/fonts/ Apple system font>, with Georgia, and then the CSS standard serif fonts, as fallback fonts for sans-serif fonts, i use //SF Pro//, also an Apple system font, with //Tahoma//, and then the CSS sans-serif as fallback fonts. + +===== technical ===== + +the site generator is a non-gmo <#https://github.com/m1kadev/www.m1kadev.nl/tree/main/kethel/ elixir tool>. the internal markup language is <#https://github.com/m1kadev/fxg fxg>, made to be more legible than markdown. templating the final html is handled by <#https://mustache.github.io mustache>, a stateless templating library. diff --git a/scripts/dyn-codeberg-logo.js b/scripts/dyn-codeberg-logo.js new file mode 100644 index 0000000000000000000000000000000000000000..fcf5b78a84fc2c91086c0f52a1ea89b9c87fe037 --- /dev/null +++ b/scripts/dyn-codeberg-logo.js @@ -0,0 +1,15 @@ +const setCodebergLogo = image => { + const isLight = window.matchMedia("(prefers-color-scheme: light)").matches; + if (isLight) { + image.src = "/static/codeberg-logo_icon_blue.svg"; + } else { + image.src = "/static/codeberg-logo_icon_white.svg"; + } +}; + +addEventListener("DOMContentLoaded", ev => { + const image = document.getElementById("codeberg"); + setCodebergLogo(image); + window.matchMedia("(prefers-color-scheme: light)").addEventListener('change', _ => setCodebergLogo(image)); +}); + diff --git a/static/.DS_Store b/static/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..52c44a06f608edb4873fbb203160a2aba2c25c14 GIT binary patch literal 6148 zcmeHK!AiqG5Ph2#Nzp@&f*yi*1O7oM_25-MKus%AiH$U=Uh@rpqCcW^nR@PLB4K#6ly^pw~C)lp^`y6&_&Vu~7?=8bC`wIFn zA3^+xj5I&(5G{fXPF0ivWk4C&3j;i}MdCw;YLx+HKpE&6knclE70f+$4(+FdCgN1q zhk_y;%detf>M{4&Iphk(xKyG`HU5fWTsr-!kIOxF4qZBo-I;a#&c@$RjNP67)P}?4 z4%I3H%D_4U12;|N{J-3N|6fninKGaZ{3`~`aB?#lvn7AFZZs!nZA!hPib!1NuutK@ h9>t86qxhI=h5l3q#N1=&kRFQu2v{1_C + + Codeberg logo + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Codeberg logo + + + + Robert Martinez + + + + + Codeberg and the Codeberg Logo are trademarks of Codeberg e.V. + + + 2020-04-09 + + + Codeberg e.V. + + + codeberg.org + + + + + + + + + + + + + diff --git a/static/codeberg-logo_icon_white.svg b/static/codeberg-logo_icon_white.svg new file mode 100644 index 0000000000000000000000000000000000000000..74a0fa981335a763d5e232faba1623baa53963e9 --- /dev/null +++ b/static/codeberg-logo_icon_white.svg @@ -0,0 +1,164 @@ + + + Codeberg logo + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Codeberg logo + + + + Robert Martinez + + + + + Codeberg and the Codeberg Logo are trademarks of Codeberg e.V. + + + 2020-04-09 + + + Codeberg e.V. + + + codeberg.org + + + + + + + + + + + + + diff --git a/static/github-mark-white.svg b/static/github-mark-white.svg deleted file mode 100644 index d5e64918546d9dd87c9742239deae2397e634343..0000000000000000000000000000000000000000 --- a/static/github-mark-white.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/static/motds b/static/motds deleted file mode 100644 index 714656562d779d6124411afed3ed6821c3c7958b..0000000000000000000000000000000000000000 --- a/static/motds +++ /dev/null @@ -1,6 +0,0 @@ -"what do you think success is?", asked the boy
"to love", said the mole # from "the boy, the mole, the fox and the horse", by charlie mackesy -let's go down to the bandstand on the pier / watch the drunks and lovers appear # from "sovereign light cafe", by keane, on the album strangeland -just buy cool things, you'll be 30 before you know it # thrift store employee, in spijkenisse, the netherlands -words are very unneccecary / they can only do harm # "enjoy the silence", by depeche mode, on violator -and all the fears you hold so dear / will turn to whisper in your ear # "duvet" by bôa, on twilight -when routine bites hard and ambitions are low # "love will tear us apart" by joy division, on the single of the same name \ No newline at end of file diff --git a/styles/base.css b/styles/base.css index 8d51b05234a1afc349973457485392bfdb834f1a..e1bb85f65c4e8b22746d4ea414910e485fa607aa 100644 --- a/styles/base.css +++ b/styles/base.css @@ -1,9 +1,9 @@ :root { - --serif-font: "Castilo MT", serif; - --sans-serif-font: "SF Pro", "Segoe UI", sans-serif; + --serif-font: "New York", "Georgia", serif; + --sans-serif-font: "SF Pro", "Tahoma", sans-serif; color-scheme: light dark; - --fg-color: light-dark(#121413, #eeeeee); - --bg-color: light-dark(#eeeeee, #121413); + --fg-color: light-dark(#0A0A0A, #FFFFFF); + --bg-color: light-dark(#e9e9e9, #1c1c1d); --accent-color: #ee41b4; } @@ -114,10 +114,25 @@ p { } footer { + width: min(100vw, 450px); +} + +footer>#build-info { + width: min(100vw, 450px); + padding: .5rem; +} + +footer>#links { + border-top: .1rem solid var(--fg-color); padding: .5rem; - width: 450px; } +img#codeberg { + width: 2rem; + height: 2rem; +} + + @media (min-width: 900px) { .link-group { @@ -162,4 +177,19 @@ footer { nav>a { text-align: right; } + + footer { + width: initial; + } + + footer>#build-info { + display: inline; + } + + footer>#links { + border-top: 0 solid transparent; + display: inline; + float: right; + } + } \ No newline at end of file diff --git a/templates/base.thtml b/templates/base.thtml index 9ce74ad5b5b31b17293c6964ecca458f47733573..d3758d4d5edb33f5874a11bb7bafaeed69b60dcc 100644 --- a/templates/base.thtml +++ b/templates/base.thtml @@ -3,7 +3,7 @@ {{ &base_header }} - {{ &highlight }} + {{ location }} - m1kadev {{ &ogp }} @@ -12,9 +12,7 @@ {{ &navbar }}
{{ &fxg_content }} -
- {{ &footer }} -
+ {{ &footer }}
\ No newline at end of file diff --git a/templates/pages/colophon.thtml b/templates/pages/colophon.thtml index 8a6a30d3e81bbfbf868db5b6bfc9369e795e3fd6..4b8aef0f46bbfeff5a1aaa2d4ca2229348cd9713 100644 --- a/templates/pages/colophon.thtml +++ b/templates/pages/colophon.thtml @@ -3,7 +3,6 @@ {{ &base_header }} - {{ &highlight }} {{ location }} - m1kadev {{ &ogp }} @@ -12,9 +11,7 @@ {{ &navbar }}
{{ &fxg_content }} - + {{ &extended_footer }}
\ No newline at end of file