From 9051a5f887b921e3dfd1fd6c4cbc9600f1548af2 Mon Sep 17 00:00:00 2001 From: Samuel Jensen <44519206+nichtsam@users.noreply.github.com> Date: Thu, 9 Jan 2025 13:24:51 +0100 Subject: [PATCH] better meta --- app/root.tsx | 25 +++++++++++++++++++++---- app/routes/_auth+/onboarding.tsx | 12 ++++++++++++ app/routes/_site+/_index.tsx | 3 ++- app/routes/_site+/about.tsx | 3 ++- app/routes/_site+/blog.tsx | 6 +++++- app/routes/_site+/contact.tsx | 18 ++++++++++++++++++ 6 files changed, 60 insertions(+), 7 deletions(-) diff --git a/app/root.tsx b/app/root.tsx index b6b956b..ba975c0 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -50,10 +50,27 @@ export const links: LinksFunction = () => [ ...faviconLinks, ] -export const meta: MetaFunction = ({ data }) => [ - { title: data ? 'nichtsam.com' : 'Error | nichtsam' }, - { name: 'description', content: `Samuel Jensen, aka nichtsam's website.` }, -] +export const meta: MetaFunction = ({ data }) => { + if (!data) { + return [ + { title: 'Error | nichtsam' }, + { + name: 'description', + content: + "Oops! Something went wrong. We're sorry for the inconvenience. Please try again later, or contact us if the issue persists.", + }, + ] + } + + return [ + { title: 'nichtsam.com' }, + { + name: 'description', + content: + 'Welcome to nichtsam.com! Explore the site to learn more about Samuel, his projects, and ideas.', + }, + ] +} export const headers: HeadersFunction = (args) => { // document has authed personalized content diff --git a/app/routes/_auth+/onboarding.tsx b/app/routes/_auth+/onboarding.tsx index 7a4f5df..80fdfe4 100644 --- a/app/routes/_auth+/onboarding.tsx +++ b/app/routes/_auth+/onboarding.tsx @@ -9,6 +9,7 @@ import { type SEOHandle } from '@nasa-gcn/remix-seo' import { type ActionFunctionArgs, type LoaderFunctionArgs, + type MetaFunction, data, redirect, } from '@remix-run/node' @@ -39,6 +40,17 @@ export const handle: SEOHandle = { getSitemapEntries: () => null, } +export const meta: MetaFunction = () => { + return [ + { title: 'Onboarding | nichtsam' }, + { + name: 'description', + content: + 'Welcome to the onboarding process! Fill in the necessary information and get started with your experience on nichtsam.com!', + }, + ] +} + const requireData = async (request: Request) => { await requireAnonymous(request) diff --git a/app/routes/_site+/_index.tsx b/app/routes/_site+/_index.tsx index 37032ed..c6afb0b 100644 --- a/app/routes/_site+/_index.tsx +++ b/app/routes/_site+/_index.tsx @@ -6,7 +6,8 @@ export const meta: MetaFunction = () => { { title: 'Home | nichtsam' }, { name: 'description', - content: 'nichtsam! Sam! Samuel Jensen! Website! Home Page!', + content: + 'Welcome to nichtsam.com! Explore the site to learn more about Samuel, his projects, and ideas.', }, ] } diff --git a/app/routes/_site+/about.tsx b/app/routes/_site+/about.tsx index fbaba3b..f03fe7c 100644 --- a/app/routes/_site+/about.tsx +++ b/app/routes/_site+/about.tsx @@ -6,7 +6,8 @@ export const meta: MetaFunction = () => { { title: 'About | nichtsam' }, { name: 'description', - content: 'nichtsam! Sam! Samuel Jensen! Website! About Page!', + content: + 'Here are some questions and answers about Samuel. Read through to get to know him a bit better.', }, ] } diff --git a/app/routes/_site+/blog.tsx b/app/routes/_site+/blog.tsx index 7c817f0..33f35da 100644 --- a/app/routes/_site+/blog.tsx +++ b/app/routes/_site+/blog.tsx @@ -7,7 +7,11 @@ import { ServerTiming } from '#app/utils/timings.server.ts' export const meta: MetaFunction = () => { return [ { title: 'Blog | nichtsam' }, - { name: 'description', content: "nichtsam's blog" }, + { + name: 'description', + content: + 'Blog posts written by Samuel, where he shares his thoughts, ideas, and insights on a variety of topics.', + }, ] } diff --git a/app/routes/_site+/contact.tsx b/app/routes/_site+/contact.tsx index 16d6264..47770ee 100644 --- a/app/routes/_site+/contact.tsx +++ b/app/routes/_site+/contact.tsx @@ -1,5 +1,23 @@ +import { type HeadersFunction, type MetaFunction } from '@remix-run/node' +import { pipeHeaders } from '#app/utils/remix.server.ts' import { isUser, useOptionalUser } from '#app/utils/user.tsx' +export const meta: MetaFunction = () => { + return [ + { title: 'Contact | nichtsam' }, + { + name: 'description', + content: + 'Get in touch with Samuel through various channels. Whether it’s via email, social media, or another method, feel free to reach out, and Samuel will respond as soon as possible.', + }, + ] +} + +export const headers: HeadersFunction = (args) => { + args.loaderHeaders.set('Cache-Control', 'max-age=86400') + return pipeHeaders(args) +} + export default function Contact() { const optionalUser = useOptionalUser() const isLoggedIn = isUser(optionalUser)