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/docs/package.json | 3 + apps/website/config.ts | 4 +- apps/website/package.json | 7 +- apps/website/public/.well-known/webfinger | 23 ++++++ apps/website/public/favicon.svg | 4 + apps/website/public/robots.txt | 6 +- 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 + apps/website/vercel.json | 3 + 17 files changed, 241 insertions(+), 51 deletions(-) create mode 100644 apps/docs/package.json create mode 100644 apps/website/public/.well-known/webfinger create mode 100644 apps/website/public/favicon.svg 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 create mode 100644 apps/website/vercel.json (limited to 'apps') diff --git a/apps/docs/package.json b/apps/docs/package.json new file mode 100644 index 0000000..da151b4 --- /dev/null +++ b/apps/docs/package.json @@ -0,0 +1,3 @@ +{ + "name": "@polyfrost/docs" +} diff --git a/apps/website/config.ts b/apps/website/config.ts index cb4e515..81f939e 100644 --- a/apps/website/config.ts +++ b/apps/website/config.ts @@ -87,11 +87,11 @@ export const configConst = { links: [ { text: 'Terms of service', - url: '/tos', + url: '/legal/tos', }, { text: 'Privacy policy', - url: '/privacy', + url: '/legal/privacy', }, ], }, diff --git a/apps/website/package.json b/apps/website/package.json index 730f5a5..e8c71c7 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -17,12 +17,15 @@ "@astrojs/tailwind": "^5.1.0", "astro": "^4.1.1", "sass": "^1.69.7", + "smartypants": "^0.2.2", "tailwindcss": "^3.4.1", - "vitest": "^1.1.3" + "vitest": "^1.1.3", + "zod": "^3.22.4", + "zod-form-data": "^2.0.2" }, "devDependencies": { "@polyfrost/config": "workspace:*", - "@types/node": "~20.10.7", + "@types/node": "~20.10.8", "node-html-parser": "^6.1.12", "typescript": "^5.3.3" } diff --git a/apps/website/public/.well-known/webfinger b/apps/website/public/.well-known/webfinger new file mode 100644 index 0000000..598fa4b --- /dev/null +++ b/apps/website/public/.well-known/webfinger @@ -0,0 +1,23 @@ +{ + "subject": 'acct:astro@webtoo.ls', + "aliases": [ + "https://floss.social/@polyfrost", + "https://floss.social/users/polyfrost" + ], + "links": [ + { + "rel": "http://webfinger.net/rel/profile-page", + "type": "text/html", + "href": "https://floss.social/@polyfrost" + }, + { + "rel": "self", + "type": "application/activity+json", + "href": "https://floss.social/users/polyfrost" + }, + { + "rel": "http://ostatus.org/schema/1.0/subscribe", + "template": "https://floss.social/authorize_interaction?uri={uri}" + } + ] +} diff --git a/apps/website/public/favicon.svg b/apps/website/public/favicon.svg new file mode 100644 index 0000000..f949e8d --- /dev/null +++ b/apps/website/public/favicon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/apps/website/public/robots.txt b/apps/website/public/robots.txt index f58dbcb..dcf9571 100644 --- a/apps/website/public/robots.txt +++ b/apps/website/public/robots.txt @@ -1,4 +1,6 @@ -# Example: Allow all bots to scan and index your site. -# Full syntax: https://developers.google.com/search/docs/advanced/robots/create-robots-txt +# I, for one, welcome our new robotic overlords + User-agent: * Allow: / + +Sitemap: https://polyfrost.org/sitemap-index.xml 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; +} diff --git a/apps/website/vercel.json b/apps/website/vercel.json new file mode 100644 index 0000000..0db3279 --- /dev/null +++ b/apps/website/vercel.json @@ -0,0 +1,3 @@ +{ + +} -- cgit