From 247b4cb05a2e54e0b0144cb081f26e545b8c68fc Mon Sep 17 00:00:00 2001 From: Eli <88557639+lishaduck@users.noreply.github.com> Date: Mon, 18 Dec 2023 12:50:57 -0600 Subject: [PATCH] feat(web): metas A centralization of data, then dispersion. --- src/components/Footer.tsx | 7 +-- src/components/Header.tsx | 3 +- src/components/Meta.tsx | 35 ++++++++++++++ src/components/Title.tsx | 12 +++++ src/islands/HeaderMenu.tsx | 14 +++--- src/routes/_404.tsx | 9 ++-- src/routes/_500.tsx | 9 ++-- src/routes/_app.tsx | 58 ++++++++++++++++++------ src/routes/about.tsx | 7 ++- src/routes/green/index.tsx | 5 +- src/routes/index.tsx | 8 +++- src/routes/monies/guarantees-in-life.tsx | 7 ++- src/routes/monies/index.tsx | 5 +- src/site.ts | 24 ++++++++++ src/static/manifest.webmanifest | 7 +++ src/static/sitemap.xml | 7 +++ 16 files changed, 177 insertions(+), 40 deletions(-) create mode 100644 src/components/Meta.tsx create mode 100644 src/components/Title.tsx create mode 100644 src/site.ts create mode 100644 src/static/manifest.webmanifest create mode 100644 src/static/sitemap.xml diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index 0fe896c6..fd4b1cd1 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -4,6 +4,7 @@ import IconSolarPanel2 from "tabler_icons_tsx/solar-panel-2.tsx"; import IconBrandTailwind from "tabler_icons_tsx/brand-tailwind.tsx"; import IconBrandReact from "tabler_icons_tsx/brand-react.tsx"; import type { FunctionalComponent } from "preact"; +import { siteName, slogan } from "../site.ts"; const Footer: FunctionalComponent = () => { const menus = [ @@ -55,10 +56,10 @@ const Footer: FunctionalComponent = () => { class="inline-block dark:text-white" aria-hidden="true" /> -
The page you were looking for doesn't exist.
diff --git a/src/routes/_500.tsx b/src/routes/_500.tsx index 67e97879..e4277e92 100644 --- a/src/routes/_500.tsx +++ b/src/routes/_500.tsx @@ -2,19 +2,20 @@ import { Head } from "$fresh/runtime.ts"; import type { PageProps } from "$fresh/server.ts"; import Logo from "../components/Logo.tsx"; import type { FunctionalComponent } from "preact"; +import Meta from "../components/Meta.tsx"; const Error500: FunctionalComponentAn internal server error occurred.
diff --git a/src/routes/_app.tsx b/src/routes/_app.tsx index eab27894..782d5ce8 100644 --- a/src/routes/_app.tsx +++ b/src/routes/_app.tsx @@ -1,25 +1,55 @@ import type { PageProps } from "$fresh/server.ts"; -import { Partial } from "$fresh/runtime.ts"; +import { Head, Partial } from "$fresh/runtime.ts"; import type { FunctionalComponent } from "preact"; +import { description as desc, faviconPngUrl, faviconSvgUrl } from "../site.ts"; + +const metas = ( + <> + + + + + + + + + + + + + + + + + > +); const App: FunctionalComponentIt's us, man!
diff --git a/src/routes/green/index.tsx b/src/routes/green/index.tsx index 9b7be836..04209949 100644 --- a/src/routes/green/index.tsx +++ b/src/routes/green/index.tsx @@ -1,12 +1,15 @@ import { Head } from "$fresh/runtime.ts"; import type { PageProps } from "$fresh/server.ts"; import type { FunctionalComponent } from "preact"; +import Meta from "../../components/Meta.tsx"; const Green: FunctionalComponent
diff --git a/src/routes/index.tsx b/src/routes/index.tsx
index 224e3028..8047e03c 100644
--- a/src/routes/index.tsx
+++ b/src/routes/index.tsx
@@ -2,17 +2,21 @@ import { Head } from "$fresh/runtime.ts";
import type { FunctionalComponent } from "preact";
import Logo from "../components/Logo.tsx";
import type { PageProps } from "$fresh/server.ts";
+import { siteName } from "../site.ts";
+import Meta from "../components/Meta.tsx";
const Home: FunctionalComponent
Looking for information about solar power? You've come to the right
place!
diff --git a/src/routes/monies/guarantees-in-life.tsx b/src/routes/monies/guarantees-in-life.tsx
index 022cbbe2..cfb97af7 100644
--- a/src/routes/monies/guarantees-in-life.tsx
+++ b/src/routes/monies/guarantees-in-life.tsx
@@ -2,17 +2,20 @@ import { Head } from "$fresh/runtime.ts";
import type { PageProps } from "$fresh/server.ts";
import Logo from "../../components/Logo.tsx";
import type { FunctionalComponent } from "preact";
+import Meta from "../../components/Meta.tsx";
const Taxes: FunctionalComponent
Looking for information about tax rebates and incentives for green
energy?
diff --git a/src/routes/monies/index.tsx b/src/routes/monies/index.tsx
index 34d0f313..30e10cd0 100644
--- a/src/routes/monies/index.tsx
+++ b/src/routes/monies/index.tsx
@@ -1,12 +1,15 @@
import { Head } from "$fresh/runtime.ts";
import type { PageProps } from "$fresh/server.ts";
import type { FunctionalComponent } from "preact";
+import Title from "../../components/Title.tsx";
const Monies: FunctionalComponent
diff --git a/src/site.ts b/src/site.ts
new file mode 100644
index 00000000..156c6010
--- /dev/null
+++ b/src/site.ts
@@ -0,0 +1,24 @@
+const slogan = "The Truth About Going Green";
+const description =
+ "Why Switch is an informative website about green/green energy.";
+const siteName = "Why Switch?";
+
+function makeTitle(pageTitle: string): string {
+ return `${pageTitle} | ${siteName}`;
+}
+
+const faviconSvgUrl = "/favicon.svg";
+const faviconPngUrl = "/favicon.png";
+const logoSvgUrl = "/logo.svg";
+const logoAlt = `${siteName}'s logo`;
+
+export {
+ description,
+ faviconPngUrl,
+ faviconSvgUrl,
+ logoAlt,
+ logoSvgUrl,
+ makeTitle,
+ siteName,
+ slogan,
+};
diff --git a/src/static/manifest.webmanifest b/src/static/manifest.webmanifest
new file mode 100644
index 00000000..c41403cd
--- /dev/null
+++ b/src/static/manifest.webmanifest
@@ -0,0 +1,7 @@
+{
+ "name": "Why Switch?",
+ "background_color": "#22C55E",
+ "theme_color": "#22C55E",
+ "description": "Why Switch is an informative website about green/green energy.",
+ "display": "standalone"
+}
diff --git a/src/static/sitemap.xml b/src/static/sitemap.xml
new file mode 100644
index 00000000..21785d60
--- /dev/null
+++ b/src/static/sitemap.xml
@@ -0,0 +1,7 @@
+
+Why Switch?
+ {siteName}
Death. And Taxes.
+ {pageTitle}