From 03282dba0228b4270a1aba844de91df350e2e714 Mon Sep 17 00:00:00 2001 From: m1kadev <67912368+m1kadev@users.noreply.github.com> Date: Thu, 11 Dec 2025 11:55:32 +0100 Subject: [PATCH] ADD FXG INTEGRATIONNNN --- build.exs | 91 ++++++++++++++++++++++++----------------------- src/index.fxg | 18 ++++++++++ src/index.html | 66 ---------------------------------- src/template.html | 43 ++++++++++++++++++++++ 4 files changed, 108 insertions(+), 110 deletions(-) create mode 100644 src/index.fxg delete mode 100644 src/index.html create mode 100644 src/template.html diff --git a/build.exs b/build.exs index 7fc4662aa5a3936adfe8e6f7b217d02983afdd1a..dc45c47f11c74fb9e2f9d9e82f712f8c467fcdb3 100644 --- a/build.exs +++ b/build.exs @@ -6,52 +6,61 @@ Mix.install([ require EEx +# hello + Calendar.put_time_zone_database(Tzdata.TimeZoneDatabase) defmodule Builders do binfo_template = """ - commit=<%= commit %> - lightningcss=<%= lightningcss %> - html_minifer_next=<%= html_minifier_next %> - uglifyjs=<%= uglifyjs %> - build_time=<%= build_time %> + commit=<%= commit %>lightningcss=<%= lightningcss %>html_minifer_next=<%= html_minifier_next %>uglifyjs=<%= uglifyjs %>build_time=<%= build_time %> """ def html(input_path) do output_path = String.replace_prefix(input_path, "src", "build") - System.cmd("html-minifier-next", [ - "--preset", - "conservative", - "-o", - output_path, - input_path - ]) + {_, 0} = + System.cmd("html-minifier-next", [ + "--preset", + "conservative", + "-o", + output_path, + input_path + ]) end def css(input_path) do output_path = String.replace_prefix(input_path, "src", "build") - System.cmd("lightningcss", [ - "-m", - "-o", - output_path, - input_path - ]) + {_, 0} = + System.cmd("lightningcss", [ + "-m", + "-o", + output_path, + input_path + ]) end def js(input_path) do output_path = String.replace_prefix(input_path, "src", "build") - System.cmd("uglifyjs", [ - "-c", - "-o", - output_path, - input_path - ]) + {_, 0} = + System.cmd("uglifyjs", [ + "-c", + "-o", + output_path, + input_path + ]) end - # TODO: js support :) + def fxg(input_path, template) do + output_path = + String.replace_prefix(input_path, "src", "build") + |> String.replace_suffix("fxg", "html") + + {output, 0} = System.cmd("fxg", [input_path]) + output = String.replace(template, "", output) + File.write(output_path, output) + end EEx.function_from_string( :def, @@ -67,25 +76,13 @@ defmodule Builders do ) end -commit = - System.cmd("git", ["rev-parse", "HEAD"]) - |> elem(0) - |> String.trim() +{commit, 0} = System.cmd("lightningcss", ["-V"]) -lightningcss = - System.cmd("lightningcss", ["-V"]) - |> elem(0) - |> String.trim() +{lightningcss, 0} = System.cmd("lightningcss", ["-V"]) -html_minifier_next = - System.cmd("html-minifier-next", ["-V"]) - |> elem(0) - |> String.trim() +{html_minifier_next, 0} = System.cmd("html-minifier-next", ["-V"]) -uglifyjs = - System.cmd("uglifyjs", ["-V"]) - |> elem(0) - |> String.trim() +{uglifyjs, 0} = System.cmd("uglifyjs", ["-V"]) File.rm_rf("build") @@ -94,9 +91,11 @@ case File.mkdir_p("build/static") do _ -> raise "Couldn't create the build file structure (/build/static)" end -Path.wildcard("src/**/*.html") -|> Task.async_stream(fn file -> Builders.html(file) end) -|> Enum.to_list() +# Path.wildcard("src/**/*.html") +# |> Task.async_stream(fn file -> Builders.html(file) end) +# |> Enum.to_list() + +{:ok, main_template} = File.read("src/template.html") Path.wildcard("src/**/*.css") |> Task.async_stream(fn file -> Builders.css(file) end) @@ -106,6 +105,10 @@ Path.wildcard("src/**/*.js") |> Task.async_stream(fn file -> Builders.js(file) end) |> Enum.to_list() +Path.wildcard("src/**/*.fxg") +|> Task.async_stream(fn file -> Builders.fxg(file, main_template) end) +|> Enum.to_list() + Path.wildcard("static/**/*") |> Task.async_stream(fn file -> File.cp(file, "build/" <> file) end) |> Enum.to_list() diff --git a/src/index.fxg b/src/index.fxg new file mode 100644 index 0000000000000000000000000000000000000000..8f9cefcc25fc058fcb770e14a0e6ebb44bf574b9 --- /dev/null +++ b/src/index.fxg @@ -0,0 +1,18 @@ += haii :3 i'm mika = + +haiii!!! i'm mika (also //m1ka//, //m1kadev//). i'm a (mostly backend) developer from <#https://en.wikipedia.org/wiki/Nederland 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 <#https://www.github.com/m1kadev/fxg fxg>, a markup language written in <#https://rust-lang.org/ Rust>. also, i've been playing around with functional programming (mostly in <#https://elixir-lang.org Elixir>). + +Together with 3 other friends, we run <#https://dupunkto.org/ {du}punkto> + +=== contact === +feel free to reach out to me! you can reach me at m1kadev on <#https://discord.com/ discord>, or on my email address at + + +format!("{2}@{0}.{1}", "dupunkto", "org", "mika") + + +this code is to filter out all non-<>format! users \ No newline at end of file diff --git a/src/index.html b/src/index.html deleted file mode 100644 index 74f669a7ff4190f1647bbbf279c70500d3cce390..0000000000000000000000000000000000000000 --- a/src/index.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - home - m1kadev.nl - - - - - - -
-

.nl

-

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 -
-
-
-

Deployed from commit , on

-
-
- - GitHub logo - -
-
-
-
- - - - \ No newline at end of file diff --git a/src/template.html b/src/template.html new file mode 100644 index 0000000000000000000000000000000000000000..7fce82b75e6abd05a8675dd390ed974dcc3f22b4 --- /dev/null +++ b/src/template.html @@ -0,0 +1,43 @@ + + + + + + + home - m1kadev.nl + + + + + + +
+

.nl

+

m1kadev

+ +
+
+
+ +
+ +
+
+ + + + \ No newline at end of file