diff --git a/src/webpage/home.html b/src/webpage/home.html index 5153b29..505f7fc 100644 --- a/src/webpage/home.html +++ b/src/webpage/home.html @@ -56,6 +56,14 @@
+
+

Fermi Blog

+

Read or subscribe to the blog for updates on Fermi!

+
+ Blog +
+
+

Translate Fermi

You can help translate Fermi into your own language!

diff --git a/src/webpage/home.ts b/src/webpage/home.ts index 3a12380..b801527 100644 --- a/src/webpage/home.ts +++ b/src/webpage/home.ts @@ -17,6 +17,10 @@ const serverbox = document.getElementById("instancebox") as HTMLDivElement; const box4title = document.getElementById("box4title"); const box4description = document.getElementById("box4description"); const translate = document.getElementById("translate"); + + const box5title = document.getElementById("box5title"); + const box5description = document.getElementById("box5description"); + const blog = document.getElementById("blog"); if ( openClient && welcomeJank && @@ -27,8 +31,15 @@ const serverbox = document.getElementById("instancebox") as HTMLDivElement; box1Items && box4title && box4description && - translate + translate && + box5title && + box5description && + blog ) { + blog.textContent = I18n.blog.blog(); + box5title.textContent = I18n.blog.fermi(); + box5description.textContent = I18n.blog.desc(); + openClient.textContent = I18n.getTranslation("htmlPages.openClient"); welcomeJank.textContent = I18n.getTranslation("htmlPages.welcomeJank"); box1title.textContent = I18n.getTranslation("htmlPages.box1title"); @@ -60,7 +71,26 @@ const serverbox = document.getElementById("instancebox") as HTMLDivElement; ); } })(); - +const recent = document.getElementById("recentBlog"); +if (recent) { + fetch("https://blog.fermi.chat/feed_json_created.json") + .then((_) => _.json()) + .then( + (json: { + items: { + url: string; + title: string; + }[]; + }) => { + for (const thing of json.items) { + const a = document.createElement("a"); + a.href = thing.url; + a.textContent = thing.title; + recent.append(a); + } + }, + ); +} fetch("/instances.json") .then((_) => _.json()) .then( diff --git a/src/webpage/style.css b/src/webpage/style.css index a334eed..fd39503 100644 --- a/src/webpage/style.css +++ b/src/webpage/style.css @@ -81,6 +81,10 @@ body { .traceBars { height: 30px; } +#recentBlog { + padding-top: 12px; + gap: 12px; +} .flexttb { min-width: 0; display: flex; diff --git a/translations/en.json b/translations/en.json index a0a42f0..6e7cdb1 100644 --- a/translations/en.json +++ b/translations/en.json @@ -27,6 +27,11 @@ "composer": "Composer: $1", "length": "Length: $1 minutes and $2 seconds" }, + "blog": { + "blog": "Blog", + "fermi": "Fermi Blog", + "desc": "You can help translate Fermi into your own language!" + }, "permissions": { "descriptions": { "CREATE_INSTANT_INVITE": "Allows the user to create invites for the guild",