feat: move log into entries
All checks were successful
create archive with lfs / tag (push) Successful in 9s
All checks were successful
create archive with lfs / tag (push) Successful in 9s
This commit is contained in:
parent
12a78b4adc
commit
c626a322cb
@ -15,7 +15,6 @@
|
||||
const menuItems: MenuItem[] = [
|
||||
{ href: '', name: 'home', iconUri: '/icons/home.png' },
|
||||
{ href: 'entries', name: 'entries', iconUri: '/icons/entries.png' },
|
||||
{ href: 'log', name: 'log', iconUri: '/icons/entry.png' },
|
||||
{ href: 'guestbook', name: 'guestbook', iconUri: '/icons/guestbook.png' },
|
||||
{ href: 'about', name: 'about', iconUri: '/icons/about.png' }
|
||||
];
|
||||
@ -154,7 +153,7 @@
|
||||
<div class="hidden md:block grow" />
|
||||
<div class="navbox">
|
||||
<a title="previous site" class="hover:underline" href="https://xn--sr8hvo.ws/previous">⮜</a>
|
||||
<a class="hover:underline" href="https://xn--sr8hvo.ws">IndieWeb Webring</a>
|
||||
<a class="hover:underline" href="https://xn--sr8hvo.ws">IndieWeb 🕸💍</a>
|
||||
<a title="next site" class="hover:underline" href="https://xn--sr8hvo.ws/next">⮞</a>
|
||||
</div>
|
||||
<div class="navbox">
|
||||
|
15
src/routes/entries/+page.server.ts
Normal file
15
src/routes/entries/+page.server.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import {_load as load_logs} from '../log/+page.server.ts'
|
||||
|
||||
export const load = (params) => {
|
||||
var url = params.url
|
||||
var log_id = url.searchParams.get("log_id")
|
||||
if (log_id !== null) {
|
||||
url.searchParams.append("id", log_id)
|
||||
}
|
||||
var log_page = url.searchParams.get("log_page")
|
||||
if (log_page !== null) {
|
||||
url.searchParams.append("page", log_page)
|
||||
}
|
||||
var logs_result = load_logs({url})
|
||||
return logs_result
|
||||
}
|
@ -1,32 +1,32 @@
|
||||
<script lang="ts">
|
||||
import Window from '../../components/window.svelte';
|
||||
import type { PostData } from './+layout';
|
||||
import LogPage from '../log/+page.svelte';
|
||||
|
||||
export let data;
|
||||
|
||||
let posts: PostData[] = data.posts as PostData[];
|
||||
</script>
|
||||
|
||||
<div class="flex flex-col lg:flex-row gap-y-4 lg:mx-3 lg:my-4">
|
||||
{#each posts as post, index}
|
||||
{@const x = index % 2 === 0 ? 'lg:ml-8' : 'lg:ml-16'}
|
||||
{@const y = index % 2 === 0 ? 'lg:mt-4' : 'lg:mt-10'}
|
||||
<div class="{x} {y}">
|
||||
<Window title={post.metadata.title} iconUri='/icons/entry.png'>
|
||||
<a
|
||||
href="/entries/{post.path}"
|
||||
title="cd /entries/{post.path}"
|
||||
data-sveltekit-preload-data="off"
|
||||
>
|
||||
<div class="flex flex-col gap-y-1 prose prose-ralsei">
|
||||
<ul>
|
||||
<li>published on: <time datetime="{post.metadata.date} 00:00:00">{post.published}</time></li>
|
||||
<li class="max-w-80 text-wrap">excerpt: {post.metadata.excerpt}</li>
|
||||
</ul>
|
||||
<strong class="place-self-end text-ralsei-green-light"> read more... </strong>
|
||||
</div>
|
||||
</a>
|
||||
</Window>
|
||||
</div>
|
||||
{/each}
|
||||
<div class="mx-auto md:max-w-fit flex flex-col-reverse md:flex-row gap-y-4 gap-x-16">
|
||||
<div class="flex flex-col gap-y-4">
|
||||
{#each posts as post}
|
||||
<Window title={post.metadata.title} iconUri='/icons/entry.png'>
|
||||
<a
|
||||
href="/entries/{post.path}"
|
||||
title="cd /entries/{post.path}"
|
||||
data-sveltekit-preload-data="off"
|
||||
>
|
||||
<div class="flex flex-col prose prose-ralsei leading-5">
|
||||
<ul>
|
||||
<li>published on: <time datetime="{post.metadata.date} 00:00:00">{post.published}</time></li>
|
||||
<li class="max-w-[34ch] text-wrap">excerpt: {post.metadata.excerpt}</li>
|
||||
</ul>
|
||||
<strong class="place-self-end text-ralsei-green-light"> read more... </strong>
|
||||
</div>
|
||||
</a>
|
||||
</Window>
|
||||
{/each}
|
||||
</div>
|
||||
<LogPage {data}/>
|
||||
</div>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<meta property="og:title" content={title} />
|
||||
</svelte:head>
|
||||
|
||||
<article class="flex flex-wrap md:flex-nowrap gap-4 h-entry">
|
||||
<article class="mx-auto max-w-fit flex flex-wrap lg:flex-nowrap gap-4 h-entry">
|
||||
<Window {title} iconUri="/icons/entry.png" entry>
|
||||
<div class="prose prose-ralsei max-w-[80ch] e-content">
|
||||
<slot />
|
||||
|
@ -1,8 +1,12 @@
|
||||
import { noteExists, readNote, readNotesList } from '$lib/notes'
|
||||
|
||||
const notesPerPage: number = 12
|
||||
const notesPerPage: number = 15
|
||||
|
||||
export const load = ({ url }) => {
|
||||
return _load({ url })
|
||||
}
|
||||
|
||||
export const _load = ({ url }: { url: URL }) => {
|
||||
// get the note id to search for and display the page it is in
|
||||
const noteId = url.searchParams.get("id")
|
||||
// get the page no if one is provided, otherwise default to 1
|
||||
|
Loading…
Reference in New Issue
Block a user