diff --git a/pages/blog/second.md b/pages/blog/second.md index 5469b71..a9018ac 100644 --- a/pages/blog/second.md +++ b/pages/blog/second.md @@ -1,6 +1,7 @@ --- title: Second blog post date: 2023-07-09 11:40 AM +updated: 2023-07-12 05:52 AM --- Franzen bodega boys gorpcore disrupt hell of viral wolf man braid food truck VHS yr. Gentrify tumblr meditation, art party try-hard vaporware direct trade echo park helvetica you probably haven't heard of them disrupt fam. Poutine portland gatekeep bespoke. Organic neutra jianbing, occupy distillery 3 wolf moon big mood bitters tumblr actually forage tattooed. DIY messenger bag listicle, sustainable bitters sus portland. Gentrify VHS freegan artisan solarpunk seitan bruh hoodie live-edge drinking vinegar vape iceland palo santo +1. diff --git a/pages/revivals/finobe.md b/pages/revivals/finobe.md index 9a068bf..07abacf 100644 --- a/pages/revivals/finobe.md +++ b/pages/revivals/finobe.md @@ -1,6 +1,7 @@ --- name: Finobe date: 2023-07-09 01:58 PM +updated: 2023-07-12 05:36 AM logo: finobe.png clients: - 2012 diff --git a/src/global.sass b/src/global.sass index 666c861..b47f506 100644 --- a/src/global.sass +++ b/src/global.sass @@ -84,7 +84,6 @@ hr .bg-bg background: #100f0e - .content @apply bg-a p-4 rounded-lg shadow-lg @@ -92,6 +91,11 @@ hr @media (prefers-color-scheme: light) background: white +.logo + filter: drop-shadow(0 0 5px #fffa) invert(0) + @media (prefers-color-scheme: light) + filter: drop-shadow(0 0 5px #000a) + li ul list-style-type: circle margin: 0.3rem 0 0.3rem -1rem diff --git a/src/lib/types.ts b/src/lib/types.ts new file mode 100644 index 0000000..ff2a6f4 --- /dev/null +++ b/src/lib/types.ts @@ -0,0 +1,20 @@ +export type RevivalMetadata = { + name: string + date: Date + updated?: Date + logo?: string + clients: number[] + rating: { + website: number + community: number + clients: number + overall: number + } + overview: string +} + +export type PostMetadata = { + title: string + date: Date + updated?: Date +} diff --git a/src/lib/when.ts b/src/lib/when.ts index f679ab3..2093706 100644 --- a/src/lib/when.ts +++ b/src/lib/when.ts @@ -1,4 +1,7 @@ -export default (date: Date) => { +export default (date: Date, updated = false) => { + const Text = updated ? "Updated" : "Published" + const text = updated ? "updated" : "published" + const d = new Date(date).toLocaleDateString("en-GB", { year: "numeric", month: "long", @@ -6,5 +9,5 @@ export default (date: Date) => { hour: "numeric", minute: "numeric", }) - return d == "Invalid Date" ? "Not yet published" : `Published ${d}` + return d == "Invalid Date" ? `Not yet ${text}` : `${Text} ${d}` } diff --git a/src/routes/about/+page.md b/src/routes/about/+page.md index 746fbc6..f59ba1c 100644 --- a/src/routes/about/+page.md +++ b/src/routes/about/+page.md @@ -7,7 +7,7 @@ # About
-The Revival Archive is dedicated to keeping track of active/defunct old brickbuilding private servers. +The Revival Archive is dedicated to keeping track of active and defunct old brickbuilding private servers. We also review revivals on specific features such as: diff --git a/src/routes/blog/+page.svelte b/src/routes/blog/+page.svelte index 4c8fcbf..ca64c4b 100644 --- a/src/routes/blog/+page.svelte +++ b/src/routes/blog/+page.svelte @@ -17,7 +17,7 @@ @light:hover:text-#555 bg-a rounded-3 durition-500 box-border block text-white transition hover:shadow-xl">
-

{post.title}

+

{post.title}

{when(post.date)}

diff --git a/src/routes/blog/+page.ts b/src/routes/blog/+page.ts index 3bb0f39..e314355 100644 --- a/src/routes/blog/+page.ts +++ b/src/routes/blog/+page.ts @@ -1,3 +1,5 @@ +import type { PostMetadata } from "$lib/types" + export async function load() { const allPostFiles = import.meta.glob("../../../pages/blog/*.md") @@ -7,13 +9,10 @@ export async function load() { const { metadata } = (await allPostFiles[path]()) as any return { - ...(metadata as { - title: string - date: Date - }), + ...(metadata as PostMetadata), path: path.match(/(\w+)\.md/)?.[1], } - }), + }) ), } } diff --git a/src/routes/post/[post]/+page.svelte b/src/routes/post/[post]/+page.svelte index 3a0e877..0e5ab98 100644 --- a/src/routes/post/[post]/+page.svelte +++ b/src/routes/post/[post]/+page.svelte @@ -17,7 +17,13 @@

{data.title}

- Published {when(data.date)} + {when(data.date)} + {#if data.updated} +
+ + {when(data.updated, true)} + + {/if}
@@ -29,6 +35,7 @@
+ {#if data.posts.length > 0}

Other posts

diff --git a/src/routes/post/[post]/+page.ts b/src/routes/post/[post]/+page.ts index dd8c435..bd1559c 100644 --- a/src/routes/post/[post]/+page.ts +++ b/src/routes/post/[post]/+page.ts @@ -1,5 +1,6 @@ import { error } from "@sveltejs/kit" import { load as loadBlog } from "../../blog/+page" +import type { PostMetadata } from "$lib/types" export async function load({ params }) { let data: any @@ -14,14 +15,11 @@ export async function load({ params }) { // remove the current post from the list posts.splice( posts.findIndex(post => post.title == data.metadata.title), - 1, + 1 ) return { - ...(data.metadata as { - title: string - date: Date - }), + ...(data.metadata as PostMetadata), content: data.default, posts, } diff --git a/src/routes/reviews/+page.svelte b/src/routes/reviews/+page.svelte index 13b6502..394432c 100644 --- a/src/routes/reviews/+page.svelte +++ b/src/routes/reviews/+page.svelte @@ -16,11 +16,23 @@ class="txt @light:text-dark hover:text-#ccc @light:hover:text-#555 bg-a rounded-3 durition-500 box-border block text-white transition hover:shadow-xl"> -
-

{review.name}

-

- {when(review.date)} -

+
+ {#if review.logo} + + {/if} +
+

{review.name}

+

+ {when(review.date)} +

+
+
+ Rating: + +
{/each} diff --git a/src/routes/reviews/+page.ts b/src/routes/reviews/+page.ts index 31e4587..86264bb 100644 --- a/src/routes/reviews/+page.ts +++ b/src/routes/reviews/+page.ts @@ -1,3 +1,5 @@ +import type { RevivalMetadata } from "$lib/types" + export async function load() { const allPostFiles = import.meta.glob("../../../pages/revivals/*.md") @@ -7,18 +9,7 @@ export async function load() { const { metadata } = (await allPostFiles[path]()) as any return { - ...(metadata as { - name: string - date: Date - clients: number[] - rating: { - website: number - community: number - clients: number - overall: number - } - overview: string - }), + ...(metadata as RevivalMetadata), path: path.match(/(\w+)\.md/)?.[1], } }) diff --git a/src/routes/revival/[revival]/+page.svelte b/src/routes/revival/[revival]/+page.svelte index 442c049..2d56469 100644 --- a/src/routes/revival/[revival]/+page.svelte +++ b/src/routes/revival/[revival]/+page.svelte @@ -27,6 +27,12 @@

{data.name}

{when(data.date)} + {#if data.updated} +
+ + {when(data.updated, true)} + + {/if}
@@ -42,11 +48,16 @@ {#each Object.keys(ratingCategories) as category} - - +
+ +
{/each}
+ {category.charAt(0).toUpperCase() + category.slice(1)}
@@ -54,6 +65,7 @@
+ {#if data.revivals.length > 0}

Other revivals

@@ -63,11 +75,19 @@ class="txt bg-a @light:text-dark hover:text-#ccc @light:hover:text-#555 rounded-3 durition-500 box-border block text-white transition hover:shadow-xl"> -
-

{revival.name}

- - {when(revival.date)} - +
+ {#if revival.logo} + + {/if} +
+

{revival.name}

+ + {when(revival.date)} + +
{/each} @@ -78,9 +98,4 @@ diff --git a/src/routes/revival/[revival]/+page.ts b/src/routes/revival/[revival]/+page.ts index 703accb..5eaf1bd 100644 --- a/src/routes/revival/[revival]/+page.ts +++ b/src/routes/revival/[revival]/+page.ts @@ -1,5 +1,6 @@ import { error } from "@sveltejs/kit" import { load as loadParent } from "../../revivals/+page" +import type { RevivalMetadata } from "$lib/types" export async function load({ params }) { let data: any @@ -14,23 +15,11 @@ export async function load({ params }) { // remove the current post from the list revivals.splice( revivals.findIndex(revival => revival.name == data.metadata.name), - 1, + 1 ) return { - ...(data.metadata as { - name: string - date: Date - logo?: string - clients: number[] - rating: { - website: number - community: number - clients: number - overall: number - } - overview: string - }), + ...(data.metadata as RevivalMetadata), content: data.default, revivals, } diff --git a/src/routes/revivals/+page.svelte b/src/routes/revivals/+page.svelte index 982f172..9e465d2 100644 --- a/src/routes/revivals/+page.svelte +++ b/src/routes/revivals/+page.svelte @@ -34,16 +34,28 @@ class="txt bg-#1f1c1d @light:bg-white rounded-2 card durition-500 @light:text-black box-border flex flex-col p-5 text-white transition hover:shadow-xl"> -

{revival.name}

-
- {#each revival.clients as year} - - {year} - - {/each} +
+
+

{revival.name}

+
+ {#each revival.clients as year} + + {year} + + {/each} +
+
+ + {#if revival.logo} + + {/if}
+
{@html revival.overview}
diff --git a/src/routes/revivals/+page.ts b/src/routes/revivals/+page.ts index 477c4be..b811e15 100644 --- a/src/routes/revivals/+page.ts +++ b/src/routes/revivals/+page.ts @@ -1,3 +1,5 @@ +import type { RevivalMetadata } from "$lib/types" + export async function load() { const allPostFiles = import.meta.glob("../../../pages/revivals/*.md") @@ -7,21 +9,10 @@ export async function load() { const { metadata } = (await allPostFiles[path]()) as any return { - ...(metadata as { - name: string - date: Date - clients: number[] - rating: { - website: number - community: number - clients: number - overall: number - } - overview: string - }), + ...(metadata as RevivalMetadata), path: path.match(/(\w+)\.md/)?.[1], } - }), + }) ), } }