Skip to content

Commit

Permalink
Merge pull request #2 from HohShenYien/dev
Browse files Browse the repository at this point in the history
v0.2.2
  • Loading branch information
HohShenYien authored Aug 9, 2023
2 parents 60fd12e + a8aa7e1 commit 9064381
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ To learn more about the technologies used, refer to their respective documentati

## 🚩 TODO

- [ ] Improve documentation
- [ ] Improve documentation: Was thinking to use [nextra](https://github.com/shuding/nextra-docs-template)

## 🚀 Deploy on Vercel

Expand Down
14 changes: 4 additions & 10 deletions src/components/utils/Meta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ type MetaProps = {
title?: string;
description?: string;
image?: string;
nested?: boolean;
};

const titleGenerator = (title?: string) => {
return title ? `${title} | Next Power Starter` : "Next Power Starter";
};

const Meta = ({ title, description, image, nested = false }: MetaProps) => {
const Meta = ({ title, description, image }: MetaProps) => {
return (
<Head>
<title>{titleGenerator(title)}</title>
Expand All @@ -29,14 +28,9 @@ const Meta = ({ title, description, image, nested = false }: MetaProps) => {
</>
)}

{/* Don't feel like jamming up the header */}
{nested && (
<>
<meta property="og:type" content="website" />
<meta property="twitter:card" content="summary_large_image" />
<link rel="icon" href="/favicon.ico" />
</>
)}
<meta property="og:type" content="website" />
<meta property="twitter:card" content="summary_large_image" />
<link rel="icon" href="/favicon.ico" />

<meta property="og:title" content={titleGenerator(title)} />
<meta property="twitter:title" content={titleGenerator(title)} />
Expand Down
13 changes: 8 additions & 5 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type NextPageWithAttributes<P = {}, IP = P> = NextPage<P, IP> & {
getLayout?: (page: ReactElement) => JSX.Element;
isPublic?: boolean;
title?: string;
customHeader?: boolean;
};

type AppPropsWithAttributes = AppProps & {
Expand All @@ -20,11 +21,13 @@ type AppPropsWithAttributes = AppProps & {
export default function App({ Component, pageProps }: AppPropsWithAttributes) {
return (
<>
<Meta
title={Component.title}
description="A powerful zap starter template with simplicity and flexibility in mind"
image="https://user-images.githubusercontent.com/55322546/256514847-e21721f5-bb92-49e0-9d2d-23dc7f98f30d.png"
/>
{!Component.customHeader && (
<Meta
title={Component.title}
description="A powerful Next starter template with simplicity and flexibility in mind"
image="https://user-images.githubusercontent.com/55322546/256514847-e21721f5-bb92-49e0-9d2d-23dc7f98f30d.png"
/>
)}
<Provider>
<AuthGuard Component={Component} pageProps={pageProps} />
</Provider>
Expand Down

1 comment on commit 9064381

@vercel
Copy link

@vercel vercel bot commented on 9064381 Aug 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.