diff --git a/src/routes/blog/+page.server.ts b/src/routes/blog/+page.server.ts new file mode 100644 index 00000000..d86a588a --- /dev/null +++ b/src/routes/blog/+page.server.ts @@ -0,0 +1,21 @@ + +export const load = async ({locals}) => { + const { pb } = locals; + + const getAllBlogPost = async () => { + + + // make the POST request to the endpoint + const output = await pb.collection("articles").getFullList({ + expand: "user", + sort: "-created", + }); + + return output; + }; + + // Make sure to return a promise + return { + getAllBlogPost: await getAllBlogPost(), + }; +}; \ No newline at end of file diff --git a/src/routes/blog/+page.svelte b/src/routes/blog/+page.svelte new file mode 100644 index 00000000..c22b24d8 --- /dev/null +++ b/src/routes/blog/+page.svelte @@ -0,0 +1,173 @@ + + + + + {$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""} Stock + Analysis Blog · stocknear + + + + + + + + + + + + + + + + + + + + + Home + Stock Analysis Blog + + + + + + + + + + Stock Analysis Blog + + + + + {#if allBlogPosts?.length !== 0} + {#each allBlogPosts as item} + + + + + + + + {item?.title} + + + {item?.abstract.length > 250 + ? item?.abstract?.slice(0, 250) + "..." + : item?.abstract} + + + + + + + + + Lincoln Olson + + + Jan 14, 2025 + + + + + + {/each} + {/if} + + + + + +
+ {item?.abstract.length > 250 + ? item?.abstract?.slice(0, 250) + "..." + : item?.abstract} +
+ Lincoln Olson +