feat: add embed to log
This commit is contained in:
parent
3d951a673a
commit
ab4c3eea97
@ -26,10 +26,11 @@ export const load = ({ url }) => {
|
||||
page = Math.max(page, 1)
|
||||
|
||||
// get the notes from the chosen page
|
||||
const notes =
|
||||
const notes = new Map(
|
||||
notesList.slice((page - 1) * notesPerPage, page * notesPerPage)
|
||||
.map(
|
||||
(id) => { return { noteId: id, note: readNote(id) } }
|
||||
(id) => { return [id, readNote(id)] }
|
||||
)
|
||||
)
|
||||
|
||||
return { notes, highlightedNote: noteId, page }
|
||||
|
@ -13,8 +13,17 @@
|
||||
minute: "2-digit",
|
||||
})
|
||||
}
|
||||
|
||||
const highlightedNote = data.notes.get(data.highlightedNote ?? '') ?? null
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
{#if highlightedNote !== null}
|
||||
<meta property="og:description" content={highlightedNote.content} />
|
||||
<meta property="og:title" content="log #{data.highlightedNote}" />
|
||||
{/if}
|
||||
</svelte:head>
|
||||
|
||||
<div class="pl-16 pt-16">
|
||||
<Window title="terminal" removePadding>
|
||||
<div
|
||||
@ -30,11 +39,11 @@
|
||||
<Token v="[" punct/>gazesystems <Token v="/log/" keywd/><Token v="]$" punct/> <Token v="ls" funct/> log <Token v="|" punct/> <Token v="each" funct/> <Token v="{" punct/><Token v="|" punct/>file<Token v="|" punct/> <Token v="render" funct/> <Token v="(" punct/><Token v="open" funct/> $file.name<Token v=")" punct/><Token v="}" punct/>
|
||||
<br>
|
||||
<br>
|
||||
{#each data.notes as { noteId, note }, index}
|
||||
{#each data.notes as [noteId, note], index}
|
||||
<div class="text-wrap break-words max-w-[70ch] leading-none">
|
||||
<Token v={renderDate(note.published)} small/> <Token v={noteId} keywd small/><Token v="#" punct/> <Token v={note.content} str/>
|
||||
</div>
|
||||
{#if index < data.notes.length - 1}
|
||||
{#if index < data.notes.size - 1}
|
||||
<div class="mt-3"/>
|
||||
{/if}
|
||||
{/each}
|
||||
|
Loading…
Reference in New Issue
Block a user