Skip to content

Commit

Permalink
better meta
Browse files Browse the repository at this point in the history
  • Loading branch information
nichtsam committed Jan 9, 2025
1 parent dfc068a commit 9051a5f
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 7 deletions.
25 changes: 21 additions & 4 deletions app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions app/routes/_auth+/onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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)

Expand Down
3 changes: 2 additions & 1 deletion app/routes/_site+/_index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
},
]
}
Expand Down
3 changes: 2 additions & 1 deletion app/routes/_site+/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
},
]
}
Expand Down
6 changes: 5 additions & 1 deletion app/routes/_site+/blog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
},
]
}

Expand Down
18 changes: 18 additions & 0 deletions app/routes/_site+/contact.tsx
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 9051a5f

Please sign in to comment.