feat: refactor DUMMY to APP and add meta title configuration for improved SEO
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
|
||||
import type { Route } from './+types/root'
|
||||
import './app.css'
|
||||
import { APP, META_TITLE_CONFIG } from './data/dummy'
|
||||
|
||||
export const links: Route.LinksFunction = () => [
|
||||
{ rel: 'preconnect', href: 'https://fonts.googleapis.com' },
|
||||
@@ -23,6 +24,21 @@ export const links: Route.LinksFunction = () => [
|
||||
},
|
||||
]
|
||||
|
||||
export const meta = ({ location }: Route.MetaArgs) => {
|
||||
const { pathname } = location
|
||||
const pageTitle = META_TITLE_CONFIG.find(
|
||||
(meta) => meta.path === pathname,
|
||||
)?.title
|
||||
const metaTitle = APP.title
|
||||
const title = `${pageTitle ? `${pageTitle} - ` : ''}${metaTitle}`
|
||||
|
||||
return [
|
||||
{
|
||||
title,
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
export function Layout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<html lang="en">
|
||||
|
||||
Reference in New Issue
Block a user