Compare commits

..

No commits in common. "632521e7f4dd6185385406d0e4d9cabe28c08fab" and "d7483f0f0012c3089f4c19cc7720517b042e72cc" have entirely different histories.

6 changed files with 9 additions and 15 deletions

@ -1 +0,0 @@
Subproject commit 14cf99e3c9651ca1c4199b2a53af9c438e0939f8

View File

@ -10,15 +10,10 @@
position: relative; position: relative;
width: auto; width: auto;
font-size: 2rem; font-size: 2rem;
margin-bottom: 0.5rem; border-bottom: 1px solid var(--color-outline);
padding-bottom: 0.5rem;
} }
hr { > *:not(h1) {
padding: 0;
margin: 0;
border: none;
border-top: 1px solid var(--color-outline);
}
> *:not(h1, hr) {
margin-left: 2rem; margin-left: 2rem;
} }
h2 { h2 {

View File

@ -5,10 +5,10 @@
import Footer from '$lib/components/footer.svelte'; import Footer from '$lib/components/footer.svelte';
import * as publish from '$lib/publish'; import * as publish from '$lib/publish';
import FormattedDate from '$lib/components/formatted_date.svelte'; import FormattedDate from '$lib/components/formatted_date.svelte';
import Head from '$lib/components/head.svelte';
import type { Article } from '$lib/article'; import type { Article } from '$lib/article';
export let data: Article; export let data: Article;
const isUpdated = data.updated_at.getTime() != data.released_at.getTime();
</script> </script>
<svelte:head> <svelte:head>
@ -18,7 +18,7 @@
<meta property="og:image" content={data.image} /> <meta property="og:image" content={data.image} />
<meta property="og:type" content="article" /> <meta property="og:type" content="article" />
<meta property="article:published_time" content={data.released_at.toISOString()} /> <meta property="article:published_time" content={data.released_at.toISOString()} />
{#if isUpdated} {#if data.updated_at}
<meta property="article:modified_time" content={data.updated_at.toISOString()} /> <meta property="article:modified_time" content={data.updated_at.toISOString()} />
{/if} {/if}
<meta property="article:author" content="HareWorks" /> <meta property="article:author" content="HareWorks" />
@ -37,7 +37,7 @@
<div class="meta"> <div class="meta">
<span> <span>
released <FormattedDate date={data.released_at} /> released <FormattedDate date={data.released_at} />
{#if isUpdated}<br /> {#if data.updated_at}<br />
updated <FormattedDate date={data.updated_at} /> updated <FormattedDate date={data.updated_at} />
{/if} {/if}
</span> </span>

View File

@ -119,7 +119,7 @@ export default async function init(db: Postgres) {
const category = path.split('/')[3]; const category = path.split('/')[3];
const tags: string[] = compiled.data.fm.tags; const tags: string[] = compiled.data.fm.tags;
const released_at = new Date(compiled.data.fm.released_at); const released_at = new Date(compiled.data.fm.released_at);
const updated_at = (compiled.data.fm.updated_at !== null) ? new Date(compiled.data.fm.updated_at) : released_at; const updated_at = new Date(compiled.data.fm.updated_at);
const image = compiled.data.fm.image; const image = compiled.data.fm.image;
const publish = compiled.data.fm.publish; const publish = compiled.data.fm.publish;
const content = compiled.code const content = compiled.code

View File

@ -22,7 +22,7 @@ export const load: PageServerLoad = async ({ params, locals }) => {
return data return data
} catch (e) { } catch (e) {
await db.rollback(); await db.rollback();
error(404, 'Not found'); error(500, (e as Error).message);
} finally { } finally {
await db.release(); await db.release();
} }

View File

@ -22,7 +22,7 @@ export const load: PageServerLoad = async ({ params, locals }) => {
return data return data
} catch (e) { } catch (e) {
await db.rollback(); await db.rollback();
error(404, 'Not found'); error(500, (e as Error).message);
} finally { } finally {
await db.release(); await db.release();
} }