Merge branch 'beta' into master

master c3.2.0
Raymonzut 3 years ago
commit 8d5e9c02ad
No known key found for this signature in database
GPG Key ID: 1E9BCC39EDD1DD53
  1. 3
      client/gen.exs
  2. 7
      client/nginx.conf
  3. 0
      client/posts/.gitkeep
  4. 8
      client/posts/ExamplePost
  5. 5
      client/public/index.html
  6. 4
      client/public/index.mjs
  7. 17
      client/public/lib/me.mjs

@ -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<h1>" <> month <> "</h1>\n" <> (posts |>
Enum.map(fn post -> "<h2>" <> (Map.get(post, :date) |> String.slice(0..6)) <>

@ -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/;
}

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

@ -8,8 +8,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Raymon Zutekouw</title>
<link rel="preload" href="./lib/me.mjs" as="script" crossorigin="anonymous" type="application/javascript">
<link rel="preload" href="index.mjs" as="script" crossorigin="anonymous" type="application/javascript">
<link rel="dns-prefetch" href="https://cdn.statically.io">
<link defer
@ -32,7 +30,7 @@
<div>
<p>
Hi there, good to see you on my website.
My name is Raymon Zutekouw (<span id="age">born on 29-08-2002</span>)
My name is Raymon Zutekouw; Self-thaught programmer by heart.
</p>
<p>
@ -48,6 +46,5 @@
</p>
</div>
</div>
<script async type="module" src="index.mjs"></script>
</body>
</html>

@ -1,4 +0,0 @@
import { age } from "./lib/me.mjs"
const age_span = document.getElementById("age")
age_span.textContent = age().toString()

@ -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
}
Loading…
Cancel
Save