diff options
author | Pauline <git@ethanlibs.co> | 2024-01-22 04:27:34 +0100 |
---|---|---|
committer | Pauline <git@ethanlibs.co> | 2024-01-22 04:27:48 +0100 |
commit | f0e73cf90005709e20b2f16f63d67d6802af3332 (patch) | |
tree | 1fb33d1bf14ada662a9cbdea1728c3f031c06ff0 /apps/website/src/pages | |
parent | e1f6521a78f5c2a873199fd8cded0bc58ac3aa6e (diff) | |
download | Nexus-f0e73cf90005709e20b2f16f63d67d6802af3332.tar.gz Nexus-f0e73cf90005709e20b2f16f63d67d6802af3332.tar.bz2 Nexus-f0e73cf90005709e20b2f16f63d67d6802af3332.zip |
feat(layout): add seo metadata to all pages
Diffstat (limited to 'apps/website/src/pages')
-rw-r--r-- | apps/website/src/pages/about.astro | 2 | ||||
-rw-r--r-- | apps/website/src/pages/blog/index.astro | 8 | ||||
-rw-r--r-- | apps/website/src/pages/branding.astro | 2 | ||||
-rw-r--r-- | apps/website/src/pages/contact.astro | 2 | ||||
-rw-r--r-- | apps/website/src/pages/index.astro | 2 | ||||
-rw-r--r-- | apps/website/src/pages/legal/ip.astro | 2 | ||||
-rw-r--r-- | apps/website/src/pages/legal/privacy.astro | 2 | ||||
-rw-r--r-- | apps/website/src/pages/legal/security.astro | 2 | ||||
-rw-r--r-- | apps/website/src/pages/legal/terms.astro | 2 | ||||
-rw-r--r-- | apps/website/src/pages/mods.astro | 2 | ||||
-rw-r--r-- | apps/website/src/pages/oss.astro | 2 | ||||
-rw-r--r-- | apps/website/src/pages/projects/oneconfig/download.astro | 2 | ||||
-rw-r--r-- | apps/website/src/pages/projects/oneconfig/index.astro | 2 | ||||
-rw-r--r-- | apps/website/src/pages/rss.xml.js | 16 | ||||
-rw-r--r-- | apps/website/src/pages/rss.xml.ts | 30 |
15 files changed, 45 insertions, 33 deletions
diff --git a/apps/website/src/pages/about.astro b/apps/website/src/pages/about.astro index ac51204..5f85a7d 100644 --- a/apps/website/src/pages/about.astro +++ b/apps/website/src/pages/about.astro @@ -7,7 +7,7 @@ import Layout from '@layouts/Layout.astro'; --- -<Layout> +<Layout title="About us" description="Learn about the team!"> <Section class="flex-col justify-center items-center h-screen max-h-4/5-screen md:max-h-[600px] md:min-h-[400px]"> <div class="max-w-[600px] flex flex-col text-center justify-center items-center gap-y-2"> <Header align="center" size="xxl" class="text-navy-peony">Our journey</Header> diff --git a/apps/website/src/pages/blog/index.astro b/apps/website/src/pages/blog/index.astro index 4bccad4..8603764 100644 --- a/apps/website/src/pages/blog/index.astro +++ b/apps/website/src/pages/blog/index.astro @@ -4,9 +4,7 @@ import { getCollection } from 'astro:content'; import FormattedDate from '../../components/base/FormattedDate.astro'; import Layout from '../../layouts/Layout.astro'; -const posts = (await getCollection('blog')).sort( - (a, b) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf(), -); +const posts = await getCollection('blog'); --- <Layout title="Polyfrost Blog" description="Recieve Polyfrost updates here"> @@ -16,10 +14,10 @@ const posts = (await getCollection('blog')).sort( posts.map(post => ( <li> <a href={`blog/${post.slug}/`}> - <img width={720} height={360} src={post.data.heroImage} alt=""/> + <img width={720} height={360} src={post.data.coverImage} alt=""/> <h4 class="title">{post.data.title}</h4> <p class="date"> - <FormattedDate date={post.data.pubDate}/> + <FormattedDate date={post.data.publishDate}/> </p> </a> </li> diff --git a/apps/website/src/pages/branding.astro b/apps/website/src/pages/branding.astro index e367f3b..4b41edd 100644 --- a/apps/website/src/pages/branding.astro +++ b/apps/website/src/pages/branding.astro @@ -12,7 +12,7 @@ function formatModName(name: string): string { } --- -<Layout> +<Layout title="Polyfrost Branding" description="Read about our branding policy"> <Section class="justify-center items-start pt-32"> <div class="flex flex-col justify-start items-start w-full text-navy-peony"> <Header> diff --git a/apps/website/src/pages/contact.astro b/apps/website/src/pages/contact.astro index aac214d..53a6a81 100644 --- a/apps/website/src/pages/contact.astro +++ b/apps/website/src/pages/contact.astro @@ -8,7 +8,7 @@ import Layout from '@layouts/Layout.astro'; --- -<Layout> +<Layout title="Contact us" description="Learn how to reach out to the Polyfrost team and community"> <Section wrapperClass="min-h-screen" class="my-40 md:my-40 xl:my-20 2xl:my-20 justify-center items-center flex-col"> <Header size="xl" class="text-navy-peony text-center">Feeling social? Come chat with us</Header> diff --git a/apps/website/src/pages/index.astro b/apps/website/src/pages/index.astro index 14e59de..c2835ac 100644 --- a/apps/website/src/pages/index.astro +++ b/apps/website/src/pages/index.astro @@ -8,7 +8,7 @@ import Icon from '@components/icons/Icon.astro'; import configConst from '@config'; import Layout from '@layouts/Layout.astro'; --- -<Layout> +<Layout title="Main Page"> <Section wrapperClass="min-h-screen" class="relative isolate px-6 lg:px-8"> <div class="absolute inset-x-0 -top-40 -z-10 transform-gpu overflow-hidden blur-3xl sm:-top-80 opacity-50"> <svg diff --git a/apps/website/src/pages/legal/ip.astro b/apps/website/src/pages/legal/ip.astro index 13cfda5..f0192d1 100644 --- a/apps/website/src/pages/legal/ip.astro +++ b/apps/website/src/pages/legal/ip.astro @@ -10,7 +10,7 @@ This will be updated in the future, if necessary. `.trim(); --- -<Layout> +<Layout title="Intellectual Property Policy"> <Section hFull class="justify-center items-start pt-32"> <div class="flex flex-col justify-start items-start w-full text-navy-peony"> <Header> diff --git a/apps/website/src/pages/legal/privacy.astro b/apps/website/src/pages/legal/privacy.astro index d3940f2..61fbdff 100644 --- a/apps/website/src/pages/legal/privacy.astro +++ b/apps/website/src/pages/legal/privacy.astro @@ -10,7 +10,7 @@ This will be updated in the future, if necessary. `.trim(); --- -<Layout> +<Layout title="Privacy Policy"> <Section hFull class="justify-center items-start pt-32"> <div class="flex flex-col justify-start items-start w-full text-navy-peony"> <Header> diff --git a/apps/website/src/pages/legal/security.astro b/apps/website/src/pages/legal/security.astro index a80d3f9..0bbf50e 100644 --- a/apps/website/src/pages/legal/security.astro +++ b/apps/website/src/pages/legal/security.astro @@ -10,7 +10,7 @@ This will be updated in the future, if necessary. `.trim(); --- -<Layout> +<Layout title="Security Notice"> <Section hFull class="justify-center items-start pt-32"> <div class="flex flex-col justify-start items-start w-full text-navy-peony"> <Header> diff --git a/apps/website/src/pages/legal/terms.astro b/apps/website/src/pages/legal/terms.astro index 6ed2009..e894d76 100644 --- a/apps/website/src/pages/legal/terms.astro +++ b/apps/website/src/pages/legal/terms.astro @@ -10,7 +10,7 @@ This will be updated in the future, if necessary. `.trim(); --- -<Layout> +<Layout title="Terms of Service"> <Section hFull class="justify-center items-start pt-32"> <div class="flex flex-col justify-start items-start w-full text-navy-peony"> <Header> diff --git a/apps/website/src/pages/mods.astro b/apps/website/src/pages/mods.astro index ae1002c..adde3d7 100644 --- a/apps/website/src/pages/mods.astro +++ b/apps/website/src/pages/mods.astro @@ -14,7 +14,7 @@ const modrinthType = configConst.socials.modrinth.type; const modrinthUrl = `https://modrinth.com/${modrinthType}/${modrinthId}`; --- -<Layout> +<Layout title="Mods" description="Learn about our collection of over 16 mods!" > <Section maxWidth="1920px" wFull={true} wrapperClass="h-3/5" class="h-full mt-32 md:mt-28 flex flex-col justify-center items-center max-xl:px-0"> <div class="flex flex-col justify-center items-center max-w-full overflow-hidden"> <div class="flex flex-col justify-between items-center overflow-hidden h-auto lg:h-[290px] max-w-[1920px] relative"> diff --git a/apps/website/src/pages/oss.astro b/apps/website/src/pages/oss.astro index a54d929..b7b2715 100644 --- a/apps/website/src/pages/oss.astro +++ b/apps/website/src/pages/oss.astro @@ -39,7 +39,7 @@ const rightCodeBlock = leftCodeBlock; --- -<Layout> +<Layout title="Open Source" description="Our unwavering commitment to open source"> <Section maxWidth="1920px" wFull class="flex-row justify-center items-center h-screen md:min-h-[600px] relative"> <div class="codeblock_container -left-12"> <Code lang="java" theme="github-light" code={leftCodeBlock}></Code> diff --git a/apps/website/src/pages/projects/oneconfig/download.astro b/apps/website/src/pages/projects/oneconfig/download.astro index b8aee51..07279ba 100644 --- a/apps/website/src/pages/projects/oneconfig/download.astro +++ b/apps/website/src/pages/projects/oneconfig/download.astro @@ -7,7 +7,7 @@ import configConst from '@config'; import Layout from '@layouts/Layout.astro'; --- -<Layout> +<Layout title="Download OneConfig" description="Download OneConfig, our configuration library for Minecraft"> <Section wrapperClass="mt-36 -mb-28"> <div class="text-navy-peony flex flex-col gap-y-2"> diff --git a/apps/website/src/pages/projects/oneconfig/index.astro b/apps/website/src/pages/projects/oneconfig/index.astro index e8283f3..ed018cd 100644 --- a/apps/website/src/pages/projects/oneconfig/index.astro +++ b/apps/website/src/pages/projects/oneconfig/index.astro @@ -13,7 +13,7 @@ import { Code } from 'astro:components'; --- -<Layout> +<Layout title="OneConfig" description="Simple universal Minecraft modding configuration."> <Section class="flex-col justify-center items-center h-screen md:min-h-[600px]"> <div class="flex flex-col justify-center items-center gap-y-4"> <Logo size={56} logo="oneconfig.minimal"/> diff --git a/apps/website/src/pages/rss.xml.js b/apps/website/src/pages/rss.xml.js deleted file mode 100644 index fe05755..0000000 --- a/apps/website/src/pages/rss.xml.js +++ /dev/null @@ -1,16 +0,0 @@ -import rss from '@astrojs/rss'; -import { getCollection } from 'astro:content'; - -export async function GET(context) { - const posts = await getCollection('blog'); - - return rss({ - title: 'Polyfrost Blog', - description: 'Recieve Polyfrost updates here', - site: context.site, - items: posts.map(post => ({ - ...post.data, - link: `/blog/${post.slug}/`, - })), - }); -} diff --git a/apps/website/src/pages/rss.xml.ts b/apps/website/src/pages/rss.xml.ts new file mode 100644 index 0000000..db8cfff --- /dev/null +++ b/apps/website/src/pages/rss.xml.ts @@ -0,0 +1,30 @@ +import rss from '@astrojs/rss'; +import { getCollection } from 'astro:content'; +import type { APIRoute } from 'astro'; + +function sortPosts(a: { data: { publishDate: Date } }, b: { data: { publishDate: Date } }) { + return Number(b.data.publishDate) - Number(a.data.publishDate); +} + +function formatDate(date: Date) { + date.setUTCHours(0); + return date; +} + +export const GET: APIRoute = async (context) => { + const unsortedPosts = [...(await getCollection('blog'))]; + const posts = unsortedPosts.sort((a, b) => sortPosts(a, b)); + + return rss({ + title: 'Polyfrost Blog', + description: 'Recieve Polyfrost updates here', + site: context.site!.href, + items: posts.map(post => ({ + ...post.data, + title: post.data.title, + description: post.data.description, + pubDate: formatDate(post.data.publishDate), + link: `/blog/${post.slug}/`, + })), + }); +}; |