Created
January 3, 2023 10:39
-
-
Save MakStashkevich/23e8059f3b018a3c6e8e811b1a2d59b9 to your computer and use it in GitHub Desktop.
Revisions
-
MakStashkevich created this gist
Jan 3, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ ``` app/ - head.tsx - layout.tsx - page.tsx - blog/[slug]/page.tsx ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ import React from 'react'; export default function RootHead() { return undefined; // Disable root head } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ import React from "react"; import '../styles/globals.scss'; export default function RootLayout({children}: { children: React.ReactNode }) { return ( <html> <body> {children} </body> </html> ) } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ import React from "react"; export default function RootPage() { return ( <div> // Set title & description without <Head/> components <title>Home</title> <meta name="description" content="My homepage"/> // Set page code <p>Other staff...</p> </div> ) } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ import React from "react"; async function getBlogData() { return {title: "About me", description: "Read about me", content: "..."}; // Your blog content } export default async function BlogPage() { const {title, description, content} = await getBlogData(); return ( <div> // Set title & description without <Head/> components <title>{title}</title> <meta name="description" content={description}/> // Set page content <p>{content}</p> </div> ) }