Added basic comments.

This commit is contained in:
2023-06-11 05:32:02 +02:00
parent 9a9b92a6b1
commit 0d5744e3ff
26 changed files with 441 additions and 89 deletions

View File

@@ -2,7 +2,7 @@ import { RenderErrorPage } from 'vite-plugin-ssr/RenderErrorPage';
import { fetchShelf } from '../../../src/shelves';
import { fetchShelfPosts } from '../../../src/posts';
async function onBeforeRender(pageContext) {
async function getPageData(pageContext) {
const shelf = await fetchShelf(pageContext.routeParams.id);
const posts = await fetchShelfPosts(pageContext.routeParams.id, { limit: 50 });
@@ -17,13 +17,9 @@ async function onBeforeRender(pageContext) {
}
return {
pageContext: {
pageData: {
shelf,
posts,
},
},
shelf,
posts,
};
}
export { onBeforeRender };
export { getPageData };

View File

@@ -1,10 +1,5 @@
<template>
<div class="content">
<a
href="/"
class="link"
>Go back home</a>
<h3>{{ shelf.slug }}</h3>
<ul class="posts nolist">