Compare commits
3 Commits
d7483f0f00
...
632521e7f4
Author | SHA1 | Date | |
---|---|---|---|
632521e7f4 | |||
1670969d4f | |||
0e06457894 |
1
articles
Submodule
1
articles
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 14cf99e3c9651ca1c4199b2a53af9c438e0939f8
|
|
@ -10,10 +10,15 @@
|
|||
position: relative;
|
||||
width: auto;
|
||||
font-size: 2rem;
|
||||
border-bottom: 1px solid var(--color-outline);
|
||||
padding-bottom: 0.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
> *:not(h1) {
|
||||
hr {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: none;
|
||||
border-top: 1px solid var(--color-outline);
|
||||
}
|
||||
> *:not(h1, hr) {
|
||||
margin-left: 2rem;
|
||||
}
|
||||
h2 {
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
import Footer from '$lib/components/footer.svelte';
|
||||
import * as publish from '$lib/publish';
|
||||
import FormattedDate from '$lib/components/formatted_date.svelte';
|
||||
import Head from '$lib/components/head.svelte';
|
||||
|
||||
import type { Article } from '$lib/article';
|
||||
export let data: Article;
|
||||
const isUpdated = data.updated_at.getTime() != data.released_at.getTime();
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
|
@ -18,7 +18,7 @@
|
|||
<meta property="og:image" content={data.image} />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="article:published_time" content={data.released_at.toISOString()} />
|
||||
{#if data.updated_at}
|
||||
{#if isUpdated}
|
||||
<meta property="article:modified_time" content={data.updated_at.toISOString()} />
|
||||
{/if}
|
||||
<meta property="article:author" content="HareWorks" />
|
||||
|
@ -37,7 +37,7 @@
|
|||
<div class="meta">
|
||||
<span>
|
||||
released <FormattedDate date={data.released_at} />
|
||||
{#if data.updated_at}<br />
|
||||
{#if isUpdated}<br />
|
||||
updated <FormattedDate date={data.updated_at} />
|
||||
{/if}
|
||||
</span>
|
||||
|
|
|
@ -119,7 +119,7 @@ export default async function init(db: Postgres) {
|
|||
const category = path.split('/')[3];
|
||||
const tags: string[] = compiled.data.fm.tags;
|
||||
const released_at = new Date(compiled.data.fm.released_at);
|
||||
const updated_at = new Date(compiled.data.fm.updated_at);
|
||||
const updated_at = (compiled.data.fm.updated_at !== null) ? new Date(compiled.data.fm.updated_at) : released_at;
|
||||
const image = compiled.data.fm.image;
|
||||
const publish = compiled.data.fm.publish;
|
||||
const content = compiled.code
|
||||
|
|
|
@ -22,7 +22,7 @@ export const load: PageServerLoad = async ({ params, locals }) => {
|
|||
return data
|
||||
} catch (e) {
|
||||
await db.rollback();
|
||||
error(500, (e as Error).message);
|
||||
error(404, 'Not found');
|
||||
} finally {
|
||||
await db.release();
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ export const load: PageServerLoad = async ({ params, locals }) => {
|
|||
return data
|
||||
} catch (e) {
|
||||
await db.rollback();
|
||||
error(500, (e as Error).message);
|
||||
error(404, 'Not found');
|
||||
} finally {
|
||||
await db.release();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user