From f2dff80262b301dac7452f4a9494b5ba5e9c558b Mon Sep 17 00:00:00 2001 From: m1kadev <67912368+m1kadev@users.noreply.github.com> Date: Fri, 26 Dec 2025 13:18:19 +0100 Subject: [PATCH] redo folder structure --- bricks/base-header.html | 4 +-- build.exs | 36 +++++++++++--------- {src => pages}/colophon.fxg | 0 pages/colophon.html | 52 +++++++++++++++++++++++++++++ {src => pages}/index.fxg | 0 pages/index.html | 53 ++++++++++++++++++++++++++++++ {src => pages}/projects.fxg | 0 pages/projects.html | 52 +++++++++++++++++++++++++++++ {static => scripts}/ldbuilddata.js | 0 {static => styles}/base.css | 0 styles/index.css | 15 +++++++++ templates/base.html | 2 -- templates/pages/index.html | 32 ++++++++++++++++++ 13 files changed, 226 insertions(+), 20 deletions(-) rename {src => pages}/colophon.fxg (100%) create mode 100644 pages/colophon.html rename {src => pages}/index.fxg (100%) create mode 100644 pages/index.html rename {src => pages}/projects.fxg (100%) create mode 100644 pages/projects.html rename {static => scripts}/ldbuilddata.js (100%) rename {static => styles}/base.css (100%) create mode 100644 styles/index.css create mode 100644 templates/pages/index.html diff --git a/bricks/base-header.html b/bricks/base-header.html index 977000f158b7d804481dab457017febd06e55186..e2af40ec5056850f102afdc37cd65a4c0ee1cc56 100644 --- a/bricks/base-header.html +++ b/bricks/base-header.html @@ -1,4 +1,4 @@ - - \ No newline at end of file + + \ No newline at end of file diff --git a/build.exs b/build.exs index 1ccc004c7be174429a4fc9a7327e45502d21f028..4fb01ee84a9ed1da8d03909dea67f43a7099c27c 100644 --- a/build.exs +++ b/build.exs @@ -64,7 +64,7 @@ defmodule Builders do end def css(input_path) do - output_path = String.replace_prefix(input_path, "src", "build") + output_path = "build/" <> input_path {_, 0} = System.cmd("lightningcss", [ @@ -76,7 +76,7 @@ defmodule Builders do end def js(input_path) do - output_path = String.replace_prefix(input_path, "src", "build") + output_path = "build/" <> input_path {_, 0} = System.cmd("uglifyjs", [ @@ -131,13 +131,14 @@ defmodule Builders do defp _fxg(input_path, template, bricks) do output_path = - String.replace_prefix(input_path, "src", "build") + String.replace_prefix(input_path, "pages", "build") |> String.replace_suffix("fxg", "html") {content, 0} = System.cmd("fxg", [input_path]) output = Mustache.render(template, Map.merge(%{fxg_content: content}, bricks)) - File.write(output_path, output) + IO.inspect(output_path) + :ok = File.write(output_path, output) end def thought(path, unix) do @@ -184,10 +185,7 @@ end File.rm_rf("build") -case File.mkdir_p("build/static") do - :ok -> {} - _ -> raise "Couldn't create the build file structure (/build/static)" -end +File.mkdir_p!("build") bricks = Path.wildcard("bricks/*.html") @@ -195,20 +193,26 @@ bricks = {:ok, main_template} = File.read("templates/base.html") -Path.wildcard("src/**/*.css") -|> Task.async_stream(fn file -> Builders.css(file) end) +Path.wildcard("pages/**/*.fxg") +|> Task.async_stream(fn file -> Builders.fxg(file, main_template, bricks) end) |> Enum.to_list() -Path.wildcard("src/**/*.js") -|> Task.async_stream(fn file -> Builders.js(file) end) +File.mkdir_p!("build/static") + +Path.wildcard("static/**/*") +|> Task.async_stream(fn file -> File.cp(file, "build/" <> file) end) |> Enum.to_list() -Path.wildcard("src/**/*.fxg") -|> Task.async_stream(fn file -> Builders.fxg(file, main_template, bricks) end) +File.mkdir_p!("build/scripts") + +Path.wildcard("scripts/**/*.js") +|> Task.async_stream(fn file -> Builders.js(file) end) |> Enum.to_list() -Path.wildcard("static/**/*") -|> Task.async_stream(fn file -> File.cp(file, "build/" <> file) end) +File.mkdir_p!("build/styles") + +Path.wildcard("styles/**/*.css") +|> Task.async_stream(fn file -> Builders.css(file) end) |> Enum.to_list() File.mkdir_p("build/pastes") diff --git a/src/colophon.fxg b/pages/colophon.fxg similarity index 100% rename from src/colophon.fxg rename to pages/colophon.fxg diff --git a/pages/colophon.html b/pages/colophon.html new file mode 100644 index 0000000000000000000000000000000000000000..ad3e85b7248bb7a3334d7be5ad985e67a4d5fbf6 --- /dev/null +++ b/pages/colophon.html @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + home - m1kadev + + + +
+
+

colophon

about

you're looking at a beautiful site, with caddy as its backend. all source pages are written in my own markup language, fxg. site generation is done by a homebrewn elixir script. all code (including fxg) is licenced under the MIT licence. +
+ +
+
+ +
+

.nl

+

m1kadev

+ +
+ + + + \ No newline at end of file diff --git a/src/index.fxg b/pages/index.fxg similarity index 100% rename from src/index.fxg rename to pages/index.fxg diff --git a/pages/index.html b/pages/index.html new file mode 100644 index 0000000000000000000000000000000000000000..9167ad3477d4401dd38392f96a2e790e4b397bb6 --- /dev/null +++ b/pages/index.html @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + home - m1kadev + + + +
+
+

haii :3 i'm mika

haiii!!! i'm mika (also m1ka, m1kadev). i'm a (mostly backend) developer from The Netherlands. i'm also a big fan of making drinks & cooking.

about me

i do VWO (dutch A-levels) phyiscs in the greater rotterdam area. i've been working on fxg, a markup language written in Rust. also, i've been playing around with functional programming (mostly in Elixir).
Together with 3 other friends, we run {du}punkto

contact

feel free to reach out to me! you can reach me at m1kadev on discord, or on my email address at
format!("{2}@{0}.{1}", "dupunkto", "org", "mika")
+
this code is to filter out all non-format! users +
+ +
+
+ +
+

.nl

+

m1kadev

+ +
+ + + + \ No newline at end of file diff --git a/src/projects.fxg b/pages/projects.fxg similarity index 100% rename from src/projects.fxg rename to pages/projects.fxg diff --git a/pages/projects.html b/pages/projects.html new file mode 100644 index 0000000000000000000000000000000000000000..00c1a8b47e4fe819b4818a2544cd5127424c5dec --- /dev/null +++ b/pages/projects.html @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + home - m1kadev + + + +
+
+

projects

fxg

fxg is my own markup language, written in Rust. it aims to maximise readability in text form, and tries to only have one way to write markup (unlike Markdown). you can view the source of this page, if you'd like to see for yourself.

m1kadev.nl

the site you're on right now! the generator for this site is written in elixir. all code for the generator (besides Tzdata, for the build timestamp) is written by me. +
+ +
+
+ +
+

.nl

+

m1kadev

+ +
+ + + + \ No newline at end of file diff --git a/static/ldbuilddata.js b/scripts/ldbuilddata.js similarity index 100% rename from static/ldbuilddata.js rename to scripts/ldbuilddata.js diff --git a/static/base.css b/styles/base.css similarity index 100% rename from static/base.css rename to styles/base.css diff --git a/styles/index.css b/styles/index.css new file mode 100644 index 0000000000000000000000000000000000000000..a6d7309f174f4c4ac4ccbfac3484dc03f29b20c2 --- /dev/null +++ b/styles/index.css @@ -0,0 +1,15 @@ +#motd { + position: absolute; + color: var(--txt-colour); + width: 100vw; + font-family: "Space Grotesk", sans-serif; +} + +#motd>h2 { + position: relative; + float: right; + writing-mode: vertical-lr; + text-decoration: none; + margin: 0; + padding: .5em; +} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 5693f75348394cf4aba71589e13556a3f011a469..42ac0b858cfd7e92735d773566a087918ab5ec61 100644 --- a/templates/base.html +++ b/templates/base.html @@ -7,8 +7,6 @@ {{ &highlight }} - - home - m1kadev diff --git a/templates/pages/index.html b/templates/pages/index.html new file mode 100644 index 0000000000000000000000000000000000000000..91f302815e80da826609c77e702913883f9ce1e0 --- /dev/null +++ b/templates/pages/index.html @@ -0,0 +1,32 @@ + + + + + + {{ &base_header }} + + {{ &highlight }} + + + + + home - m1kadev + + + +
+

+
+
+
+ {{ &fxg_content }} +
+ {{ &footer }} +
+
+ + {{ &navbar }} + + + + \ No newline at end of file