From 8e15354c2a9f41349d38429a2462918830f300ed Mon Sep 17 00:00:00 2001 From: Raymonzut <40148684+Raymonzut@users.noreply.github.com> Date: Thu, 26 Nov 2020 23:08:08 +0100 Subject: [PATCH 1/3] Add ExamplePost --- client/posts/.gitkeep | 0 client/posts/ExamplePost | 8 ++++++++ 2 files changed, 8 insertions(+) delete mode 100644 client/posts/.gitkeep create mode 100644 client/posts/ExamplePost diff --git a/client/posts/.gitkeep b/client/posts/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/client/posts/ExamplePost b/client/posts/ExamplePost new file mode 100644 index 0000000..12e9d21 --- /dev/null +++ b/client/posts/ExamplePost @@ -0,0 +1,8 @@ +id +4739537f3d29e1047a45c254 +title +Example post for my new post page! +date +Mon, 11 May 2020 13:25:00 GMT +content +My new posts page is live From 6c31c8752df052a0f3c88716533c3a1ab0d660e3 Mon Sep 17 00:00:00 2001 From: Raymonzut <40148684+Raymonzut@users.noreply.github.com> Date: Fri, 8 Jan 2021 21:33:24 +0100 Subject: [PATCH 2/3] Join date sort order function to one line - Fixes not using year in order calculation --- client/gen.exs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/gen.exs b/client/gen.exs index c1ab456..82bfd5c 100644 --- a/client/gen.exs +++ b/client/gen.exs @@ -38,8 +38,7 @@ index_file = post_contents |> Enum.reverse() # Group by month |> Enum.group_by(fn m -> Map.get(m, :date) |> String.slice(8..15) end) - |> Enum.sort_by(fn {d, _c} -> (length months) * elem(Integer.parse(String.slice(d, 4..7)), 0) - + Enum.find_index(months, &(&1 == String.slice(d, 0..2))) end) + |> Enum.sort_by(fn {d, _c} -> ((length months) * elem(Integer.parse(String.slice(d, 4..7)), 0)) + Enum.find_index(months, &(&1 == String.slice(d, 0..2))) end) |> Enum.reverse() |> Enum.map(fn {month, posts} -> "\n

" <> month <> "

\n" <> (posts |> Enum.map(fn post -> "

" <> (Map.get(post, :date) |> String.slice(0..6)) <> From a0eb56e115cdf32750579aa4fef3206c5a43ecb1 Mon Sep 17 00:00:00 2001 From: Raymonzut <40148684+Raymonzut@users.noreply.github.com> Date: Tue, 19 Jan 2021 17:40:48 +0100 Subject: [PATCH 3/3] Remove dynamic age feature --- client/nginx.conf | 7 ------- client/public/index.html | 5 +---- client/public/index.mjs | 4 ---- client/public/lib/me.mjs | 17 ----------------- 4 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 client/public/index.mjs delete mode 100644 client/public/lib/me.mjs diff --git a/client/nginx.conf b/client/nginx.conf index e2315f3..49252f1 100644 --- a/client/nginx.conf +++ b/client/nginx.conf @@ -7,9 +7,6 @@ events { } http { include /etc/nginx/mime.types; - types { - application/javascript mjs; - } log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' @@ -29,10 +26,6 @@ http { alias /app/assets/styling; } - location /js { - alias /app/lib; - } - location /posts { alias /app/gen/; } diff --git a/client/public/index.html b/client/public/index.html index 9925e9d..06b9db5 100644 --- a/client/public/index.html +++ b/client/public/index.html @@ -8,8 +8,6 @@ Raymon Zutekouw - -

Hi there, good to see you on my website. - My name is Raymon Zutekouw (born on 29-08-2002) + My name is Raymon Zutekouw; Self-thaught programmer by heart.

@@ -48,6 +46,5 @@

- diff --git a/client/public/index.mjs b/client/public/index.mjs deleted file mode 100644 index 38a0082..0000000 --- a/client/public/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -import { age } from "./lib/me.mjs" - -const age_span = document.getElementById("age") -age_span.textContent = age().toString() diff --git a/client/public/lib/me.mjs b/client/public/lib/me.mjs deleted file mode 100644 index 2f9f9b1..0000000 --- a/client/public/lib/me.mjs +++ /dev/null @@ -1,17 +0,0 @@ -export function age() { - let birthdate = new Date("29 August 2002") - let now = new Date() - - let age = now.getFullYear() - birthdate.getFullYear() - - if (now.getMonth() < birthdate.getMonth()) - age-- - - if ( - birthdate.getMonth() === now.getMonth() && - now.getDate() < birthdate.getDate() - ) - age-- - - return age -}