-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes #7
- Loading branch information
Showing
8 changed files
with
66 additions
and
63 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,14 @@ | ||
import { Helmet } from "react-helmet"; | ||
import Meta from "components/meta"; | ||
import Header from "components/header"; | ||
import Footer from "components/footer"; | ||
|
||
function LayoutDefault({ title, children }) { | ||
export default function Layout({ children, title, description, image }) { | ||
return ( | ||
<> | ||
<Helmet title={title} meta={[{ property: "og:title", content: title }]} /> | ||
|
||
<Meta title={title} description={description} image={image} /> | ||
<Header /> | ||
|
||
{children} | ||
|
||
<Footer /> | ||
</> | ||
); | ||
} | ||
|
||
export default LayoutDefault; |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import Head from "next/head"; | ||
import { META_TITLE, META_OG_IMAGE_URL } from "lib/constants"; | ||
|
||
export default function Meta({ title, description, image }) { | ||
let meta_title = title ? `${title} | ${META_TITLE}` : META_TITLE; | ||
let meta_image = image | ||
? `${image} | ${META_OG_IMAGE_URL}` | ||
: META_OG_IMAGE_URL; | ||
|
||
return ( | ||
<Head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta charSet="utf-8" /> | ||
{/* search */} | ||
<title>{meta_title}</title> | ||
{description && <meta name="description" content={description} />} | ||
{/* og/facebook */} | ||
<meta property="og:locale" content="en_US" /> | ||
<meta property="og:title" content={title ? title : META_TITLE} /> | ||
{description && <meta property="og:description" content={description} />} | ||
<meta property="og:image" content={meta_image} />} | ||
<meta property="og:site_name" content={META_TITLE} /> | ||
<meta property="og:image" content={meta_image} /> | ||
<meta property="og:image:width" content="1200" /> | ||
<meta property="og:image:height" content="600" /> | ||
{/* twitter */} | ||
<meta name="twitter:card" content="summary_large_image" /> | ||
<meta property="twitter:title" content={title ? title : META_TITLE} /> | ||
{description && ( | ||
<meta property="twitter:description" content={description} /> | ||
)} | ||
<meta property="twitter:image" content={meta_image} /> | ||
{/* favicons */} | ||
<link rel="icon" href="/cropped-favicon-32x32.png" sizes="32x32" /> | ||
<link rel="icon" href="/cropped-favicon-192x192.png" sizes="192x192" /> | ||
<link rel="apple-touch-icon" href="/cropped-favicon-180x180.png" /> | ||
</Head> | ||
); | ||
} |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const DOMAIN = "https://" + process.env.VERCEL_URL || ""; | ||
export const META_TITLE = "Bubs Next"; | ||
export const META_DESCRIPTION = "Next.js starter for headless WP"; | ||
export const META_OG_IMAGE_URL = `${DOMAIN}/og-default.png`; |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,10 @@ | ||
import { Helmet } from "react-helmet"; | ||
|
||
import "styles/global.scss"; | ||
|
||
// You can set sitewide <head> tags in the <Helmet> below | ||
function MyApp({ Component, pageProps }) { | ||
export default function App({ Component, pageProps }) { | ||
return ( | ||
<> | ||
<Helmet | ||
htmlAttributes={{ lang: "en" }} | ||
title="Hello next.js!" | ||
meta={[ | ||
{ | ||
name: "viewport", | ||
content: "width=device-width, initial-scale=1", | ||
}, | ||
]} | ||
link={[ | ||
{ | ||
rel: "stylesheet", | ||
href: | ||
"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css", | ||
}, | ||
]} | ||
/> | ||
<Component {...pageProps} /> | ||
</> | ||
); | ||
} | ||
|
||
export default MyApp; |
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
95c55f6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: