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 + - - - - - - - - - - - - - - - - Home - Blog Posts - - - - - - - - - - - - - - Stock Analysis Blog - - - - - An investment in knowledge pays the best - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {#if allBlogPosts?.length !== 0} - {#each allBlogPosts as item} - - blogSelector(item?.id)} - class="cursor-pointer" - > - - - - - - - {item?.title} - - - {item?.abstract.length > 250 - ? item?.abstract?.slice(0, 250) + "..." - : item?.abstract} - - - - - - - - - {item?.expand?.user?.username} · {new Date( - item?.created, - )?.toLocaleString("en-US", { - month: "short", - day: "numeric", - year: "numeric", - daySuffix: "2-digit", - })} - - - - - {item?.readingTime} min read - - - - - {/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 - - - - - - - - - - - - - - - - - - Home - All Blog Post - Post - - - - - - - - - - - - - - {@html article?.title} - - - - - - - - mrahimi - - {article?.readingTime} min read · {new Date( - article?.created, - )?.toLocaleString("en-US", { - month: "short", - day: "numeric", - year: "numeric", - daySuffix: "2-digit", - })} - - - - - - - - - {@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" },
- {item?.abstract.length > 250 - ? item?.abstract?.slice(0, 250) + "..." - : item?.abstract} -