Int*_*nti 7 metadata reactjs next.js
我已经定义了元数据对象,如下所示,但它不会显示在我的 chrome 选项卡中,它只显示“localhost:3000/#home”。我所有的 .jsx 文件都标有“使用客户端”,因为这是我将上传到 Github Pages 的作品集,因此我无法使用服务器组件。我不知道这是否与此有关。
这是我的layout.jsx:
"use client"
import './globals.css'
import { Exo_2, Bruno_Ace } from 'next/font/google'
import Navbar from '@/components/Navbar'
import { AnimatePresence } from 'framer-motion';
const exo_2 = Exo_2({
subsets: ['latin'],
variable: '--font-body',
display: 'swap'
})
const bruno_ace = Bruno_Ace({
subsets: ['latin'],
variable: '--font-nav',
weight: '400',
display: 'swap'
})
export const metadata = {
title: 'Inti Silva',
description: 'Portfolio Front-end Inti Tomas Silva',
}
export default function RootLayout({children}) {
return (
<html lang="en" className={`${exo_2.variable} ${bruno_ace.variable}`}>
<body>
<Navbar />
<AnimatePresence>
{children}
</AnimatePresence>
</body>
</html>
)
}
Run Code Online (Sandbox Code Playgroud)
我尝试将元数据对象放入 page.jsx 中,但它也没有显示。我正在使用新的应用程序目录,它在此版本中应该是稳定的。
我的根page.jsx:
"use client"
import About from '../components/About';
import Contact from '../components/Contact';
import Main from '../components/Main';
import Projects from '../components/Projects';
import Skills from '../components/Skills';
import Transitions from '@/components/Transitions';
export default function Home() {
return (
<>
<Transitions/>
<Main />
<About />
<Skills />
<Projects />
<Contact />
</>
);
};
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
5759 次 |
最近记录: |