From 8be3434d32d7ed9046000377f7f9e59ef2a971b3 Mon Sep 17 00:00:00 2001 From: Pauline Date: Wed, 10 Jan 2024 19:58:58 -0500 Subject: super unfinished stuff but i was getting yelled at by wybest --- apps/website/src/components/base/Footer.astro | 2 +- apps/website/src/components/shared/BaseHead.astro | 15 ++++ apps/website/src/components/shared/SEO.astro | 89 +++++++++++++++++++++++ apps/website/src/pages/legal/ip.astro | 22 ++++++ apps/website/src/pages/legal/privacy.astro | 22 ++++++ apps/website/src/pages/legal/security.astro | 22 ++++++ apps/website/src/pages/legal/terms.astro | 22 ++++++ apps/website/src/pages/privacy.astro | 22 ------ apps/website/src/pages/tos.astro | 22 ------ apps/website/src/types/smartypants.d.ts | 4 + 10 files changed, 197 insertions(+), 45 deletions(-) create mode 100644 apps/website/src/components/shared/BaseHead.astro create mode 100644 apps/website/src/components/shared/SEO.astro create mode 100644 apps/website/src/pages/legal/ip.astro create mode 100644 apps/website/src/pages/legal/privacy.astro create mode 100644 apps/website/src/pages/legal/security.astro create mode 100644 apps/website/src/pages/legal/terms.astro delete mode 100644 apps/website/src/pages/privacy.astro delete mode 100644 apps/website/src/pages/tos.astro create mode 100644 apps/website/src/types/smartypants.d.ts (limited to 'apps/website/src') diff --git a/apps/website/src/components/base/Footer.astro b/apps/website/src/components/base/Footer.astro index 9463edc..7a9071a 100644 --- a/apps/website/src/components/base/Footer.astro +++ b/apps/website/src/components/base/Footer.astro @@ -41,7 +41,7 @@ const props = Astro.props;

© {new Date().getFullYear()} Polyfrost. All rights reserved.

-

Not affiliated with Mojang Studios.

+

Not an official Minecraft product. Not approved by or affiliated with Mojang Studios.

diff --git a/apps/website/src/components/shared/BaseHead.astro b/apps/website/src/components/shared/BaseHead.astro new file mode 100644 index 0000000..ddb94e3 --- /dev/null +++ b/apps/website/src/components/shared/BaseHead.astro @@ -0,0 +1,15 @@ +--- +import smartypants from 'smartypants'; +import SEO from './SEO.astro'; + +export type Props = { + siteName: string + title?: string + description: string + image: { src: string, alt: string } + canonicalURL?: URL | null + pageType?: 'website' | 'article' +}; + +const twitterHandle = 'polyfrost'; +--- diff --git a/apps/website/src/components/shared/SEO.astro b/apps/website/src/components/shared/SEO.astro new file mode 100644 index 0000000..6169185 --- /dev/null +++ b/apps/website/src/components/shared/SEO.astro @@ -0,0 +1,89 @@ +--- +import smartypants from 'smartypants'; + +type SEOMetadata = { + name?: string + title: string + description: string + image?: { src: string, alt: string } + canonicalURL?: URL | null + locale?: string +}; + +type OpenGraph = Partial & { + type?: string +}; + +type Twitter = Partial & { + handle?: string + card?: 'summary' | 'summary_large_image' +}; + +export type Props = SEOMetadata & { + og?: OpenGraph + twitter?: Twitter +}; + +const { + name, + description, + image, + locale = 'en', + canonicalURL = new URL(Astro.url.pathname, Astro.site), + og: _og = {}, + twitter: _twitter = {}, +} = Astro.props; + +const title = [Astro.props.title, name].filter(Boolean).join(' | '); +const og: OpenGraph = { name, title, description, canonicalURL, image, locale, type: 'website', ..._og }; +const twitter: Twitter = { name, title, description, canonicalURL, image, locale, card: 'summary_large_image', ..._twitter }; +const ensureSlash = (url: string | URL) => `${url.toString().replace(/\/$/, '')}/`; +--- + + + + + + + + + + + + + +<!-- Page Metadata --> +<meta name="generator" content={Astro.generator} /> +{canonicalURL && <link rel="canonical" href={ensureSlash(canonicalURL)} />} +<title>{title} + + + + + +{og.canonicalURL && } + + + +{ + og.image && ( + <> + + + + ) +} + + +{twitter.card && } +{twitter.handle && } + + +{ + twitter.image && ( + <> + + + + ) +} diff --git a/apps/website/src/pages/legal/ip.astro b/apps/website/src/pages/legal/ip.astro new file mode 100644 index 0000000..13cfda5 --- /dev/null +++ b/apps/website/src/pages/legal/ip.astro @@ -0,0 +1,22 @@ +--- +import Header from '@components/base/Header.astro'; +import Paragraph from '@components/base/Paragraph.astro'; +import Section from '@components/base/Section.astro'; +import Layout from '@layouts/Layout.astro'; + +const policy = ` +Currently, we do not offer any services that require a intellectual property policy! +This will be updated in the future, if necessary. +`.trim(); +--- + + +
+
+
+ Intellectual Property Policy +
+ {policy} +
+
+
diff --git a/apps/website/src/pages/legal/privacy.astro b/apps/website/src/pages/legal/privacy.astro new file mode 100644 index 0000000..d3940f2 --- /dev/null +++ b/apps/website/src/pages/legal/privacy.astro @@ -0,0 +1,22 @@ +--- +import Header from '@components/base/Header.astro'; +import Paragraph from '@components/base/Paragraph.astro'; +import Section from '@components/base/Section.astro'; +import Layout from '@layouts/Layout.astro'; + +const policy = ` +Currently, we do not offer any services that require a privacy policy! +This will be updated in the future, if necessary. +`.trim(); +--- + + +
+
+
+ Privacy Policy +
+ {policy} +
+
+
diff --git a/apps/website/src/pages/legal/security.astro b/apps/website/src/pages/legal/security.astro new file mode 100644 index 0000000..a80d3f9 --- /dev/null +++ b/apps/website/src/pages/legal/security.astro @@ -0,0 +1,22 @@ +--- +import Header from '@components/base/Header.astro'; +import Paragraph from '@components/base/Paragraph.astro'; +import Section from '@components/base/Section.astro'; +import Layout from '@layouts/Layout.astro'; + +const tos = ` +Currently, we do not offer any services that require a security notice! +This will be updated in the future, if necessary. +`.trim(); +--- + + +
+
+
+ Security Notice +
+ {tos} +
+
+
diff --git a/apps/website/src/pages/legal/terms.astro b/apps/website/src/pages/legal/terms.astro new file mode 100644 index 0000000..6ed2009 --- /dev/null +++ b/apps/website/src/pages/legal/terms.astro @@ -0,0 +1,22 @@ +--- +import Header from '@components/base/Header.astro'; +import Paragraph from '@components/base/Paragraph.astro'; +import Section from '@components/base/Section.astro'; +import Layout from '@layouts/Layout.astro'; + +const tos = ` +Currently, we do not offer any services that require a terms of service! +This will be updated in the future, if necessary. +`.trim(); +--- + + +
+
+
+ Terms of Service +
+ {tos} +
+
+
diff --git a/apps/website/src/pages/privacy.astro b/apps/website/src/pages/privacy.astro deleted file mode 100644 index d3940f2..0000000 --- a/apps/website/src/pages/privacy.astro +++ /dev/null @@ -1,22 +0,0 @@ ---- -import Header from '@components/base/Header.astro'; -import Paragraph from '@components/base/Paragraph.astro'; -import Section from '@components/base/Section.astro'; -import Layout from '@layouts/Layout.astro'; - -const policy = ` -Currently, we do not offer any services that require a privacy policy! -This will be updated in the future, if necessary. -`.trim(); ---- - - -
-
-
- Privacy Policy -
- {policy} -
-
-
diff --git a/apps/website/src/pages/tos.astro b/apps/website/src/pages/tos.astro deleted file mode 100644 index 6ed2009..0000000 --- a/apps/website/src/pages/tos.astro +++ /dev/null @@ -1,22 +0,0 @@ ---- -import Header from '@components/base/Header.astro'; -import Paragraph from '@components/base/Paragraph.astro'; -import Section from '@components/base/Section.astro'; -import Layout from '@layouts/Layout.astro'; - -const tos = ` -Currently, we do not offer any services that require a terms of service! -This will be updated in the future, if necessary. -`.trim(); ---- - - -
-
-
- Terms of Service -
- {tos} -
-
-
diff --git a/apps/website/src/types/smartypants.d.ts b/apps/website/src/types/smartypants.d.ts new file mode 100644 index 0000000..c61e268 --- /dev/null +++ b/apps/website/src/types/smartypants.d.ts @@ -0,0 +1,4 @@ +declare module 'smartypants' { + type Behavior = 0 | 1 | 2 | 3 | -1 | 'q' | 'b' | 'B' | 'd' | 'D' | 'i' | 'e' | 'w'; + export default function smartypants(text: string, behavior: Behavior): string; +} -- cgit