From 2bb3769fe4cd11fc2acebea16128350aa5482abb Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Thu, 7 Nov 2024 21:18:12 +0100 Subject: [PATCH] remove blog page --- src/lib/components/Footer.svelte | 3 +- src/routes/blog/+page.svelte | 305 -------------------- src/routes/blog/+page.ts | 30 -- src/routes/blog/article/[slug]/+page.svelte | 293 ------------------- src/routes/blog/article/[slug]/+page.ts | 55 ---- src/routes/sitemap.xml/+server.ts | 2 +- 6 files changed, 3 insertions(+), 685 deletions(-) delete mode 100644 src/routes/blog/+page.svelte delete mode 100644 src/routes/blog/+page.ts delete mode 100644 src/routes/blog/article/[slug]/+page.svelte delete mode 100644 src/routes/blog/article/[slug]/+page.ts diff --git a/src/lib/components/Footer.svelte b/src/lib/components/Footer.svelte index de63b26f..1423e77e 100644 --- a/src/lib/components/Footer.svelte +++ b/src/lib/components/Footer.svelte @@ -142,6 +142,7 @@ Contact Us + - - - - - - - - - - - - -
- - -
-
-
-
-
-
- -
-
-

- Stock Analysis Blog -

-
- - - An investment in knowledge pays the best - - -
- - - -
- - - - - - - - - - - - - -
- logo -
-
- -
-
- -
-
- {#if allBlogPosts?.length !== 0} - {#each allBlogPosts as item} -
- - - -
- {/each} - {/if} -
-
-
- -
-
-
-
diff --git a/src/routes/blog/+page.ts b/src/routes/blog/+page.ts deleted file mode 100644 index 72a432cb..00000000 --- a/src/routes/blog/+page.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { pb } from "$lib/pocketbase"; -import { getCache, setCache } from "$lib/store"; - -export const load = async () => { - const getAllBlogPost = async () => { - let output; - - // Get cached data for the specific tickerID - const cachedData = getCache("allBlogPost", "getAllBlogPost"); - if (cachedData) { - output = cachedData; - } else { - // make the POST request to the endpoint - output = await pb.collection("articles").getFullList({ - expand: "user", - sort: "-created", - }); - - // Cache the data for this specific tickerID with a specific name 'getAllBlogPost' - setCache("allBlogPost", output, "getAllBlogPost"); - } - - return output; - }; - - // Make sure to return a promise - return { - getAllBlogPost: await getAllBlogPost(), - }; -}; diff --git a/src/routes/blog/article/[slug]/+page.svelte b/src/routes/blog/article/[slug]/+page.svelte deleted file mode 100644 index 693aa52d..00000000 --- a/src/routes/blog/article/[slug]/+page.svelte +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - - {$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""} - {article?.title} · stocknear - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
- -

- {@html article?.title} -

- - - - - - -
- {@html article?.description} -
- - - {#if !data?.user} -
- - Stay up to date with the market without the redudant BS - - - Get Started - - - - -
- {/if} -
-
- - - -
-
-
-
- - diff --git a/src/routes/blog/article/[slug]/+page.ts b/src/routes/blog/article/[slug]/+page.ts deleted file mode 100644 index e2ec8aba..00000000 --- a/src/routes/blog/article/[slug]/+page.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { pb } from "$lib/pocketbase"; -import { getCache, setCache } from "$lib/store"; - -export const load = async ({ params }) => { - const getArticle = async () => { - let output; - - // Get cached data for the specific tickerID - const cachedData = getCache(params?.slug, "getArticle"); - if (cachedData) { - output = cachedData; - } else { - // make the POST request to the endpoint - output = await pb - ?.collection("articles") - ?.getOne(params?.slug, { expand: "user" }); - - // Cache the data for this specific tickerID with a specific name 'getArticle' - setCache(params?.slug, output, "getArticle"); - } - - return output; - }; - - /* -const getDiscordWidget = async () => { - let output; - // Get cached data for the specific tickerID - const cachedData = getCache('', 'getDiscordWidget'); - if (cachedData) { - output = cachedData; - } else { - - // make the POST request to the endpoint - const response = await fetch('https://discord.com/api/guilds/1165618982133436436/widget.json', { - method: 'GET', - headers: { - "Content-Type": "application/json", "X-API-KEY": apiKey - }, - }); - - output = await response.json(); - setCache('', output, 'getDiscordWidget'); - } - - return output; -}; -*/ - - // Make sure to return a promise - return { - getArticle: await getArticle(), - //getDiscordWidget: await getDiscordWidget() - }; -}; diff --git a/src/routes/sitemap.xml/+server.ts b/src/routes/sitemap.xml/+server.ts index 2435004f..0e851ba8 100644 --- a/src/routes/sitemap.xml/+server.ts +++ b/src/routes/sitemap.xml/+server.ts @@ -86,7 +86,7 @@ const pages = [ { title: "/imprint" }, { title: "/about" }, { title: "/contact" }, - { title: "/blog" }, + //{ title: "/blog" }, { title: "/politicians" }, { title: "/politicians/flow-data" }, { title: "/analysts" },