feat: refactor DUMMY to APP and add meta title configuration for improved SEO

This commit is contained in:
Ardeman
2025-02-03 13:03:49 +08:00
parent 25ad73aa9d
commit d9070b1b49
7 changed files with 44 additions and 13 deletions
+16
View File
@@ -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">