Skip to content

Commit c40f484

Browse files
committed
feat: add site meta and og images
Signed-off-by: sarthakjdev <jsarthak448@gmail.com>
1 parent 6bec1d8 commit c40f484

8 files changed

Lines changed: 159 additions & 10 deletions

File tree

apps/wapijs.co/public/doc-og.png

723 KB
Loading

apps/wapijs.co/public/og.png

721 KB
Loading

apps/wapijs.co/src/app/docs/[version]/layout.tsx

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,69 @@ import { ApiModel } from '@microsoft/api-extractor-model'
33
import { resolveItemUri } from '~/reusable-function'
44
import { notFound } from 'next/navigation'
55
import { addPackageToModel, fetchDocumentationJsonDataFromSlug } from '~/utils/api-extractor'
6+
import type { Metadata } from 'next'
7+
import {
8+
MetaTitle,
9+
CANONICAL_SITE_DOMAIN,
10+
META_CATEGORY,
11+
ProductDescription,
12+
META_KEYWORDS,
13+
META_CLASSIFICATION
14+
} from '~/constant'
615

716
export const revalidate = 60 * 60 * 24 * 30
817
export const dynamicParams = true
918

19+
export const metadata: Metadata = {
20+
title: `Docs | ${MetaTitle}`,
21+
description: ProductDescription,
22+
applicationName: 'Wapijs',
23+
authors: [{ name: 'Sarthak Jain', url: `https://github.com/sarthakjdev` }],
24+
generator: 'Next.js',
25+
referrer: 'origin-when-cross-origin',
26+
keywords: META_KEYWORDS,
27+
publisher: 'Softlancer - Ideate. Innovate. Elevate',
28+
robots: 'index, follow',
29+
creator: 'Softlancer',
30+
manifest: `${CANONICAL_SITE_DOMAIN}/manifest.json`,
31+
openGraph: {
32+
type: 'website',
33+
url: CANONICAL_SITE_DOMAIN,
34+
title: MetaTitle,
35+
description: ProductDescription,
36+
images: [{ url: `${CANONICAL_SITE_DOMAIN}/doc-og.png` }],
37+
siteName: 'Wapijs'
38+
},
39+
twitter: {
40+
card: 'summary_large_image',
41+
site: '@sarthakjdev',
42+
description: ProductDescription,
43+
title: MetaTitle,
44+
creator: '@sarthakjdev',
45+
images: `${CANONICAL_SITE_DOMAIN}/doc-og.png`
46+
},
47+
verification: {
48+
google: 'mrOKVGMry1NOe6Hrn1lXqy0dYcuAqNVbiDr5HeSfRWo'
49+
},
50+
formatDetection: { telephone: false },
51+
appleWebApp: true,
52+
assets: `${CANONICAL_SITE_DOMAIN}/assets`,
53+
category: META_CATEGORY.join(', '),
54+
classification: META_CLASSIFICATION.join(', '),
55+
other: {
56+
'X-UA-Compatible': 'IE=edge,chrome=1',
57+
'mobile-web-app-capable': 'yes'
58+
},
59+
metadataBase: new URL(CANONICAL_SITE_DOMAIN),
60+
alternates: {
61+
canonical: new URL(CANONICAL_SITE_DOMAIN)
62+
},
63+
icons: [
64+
{ rel: 'icon', url: `${CANONICAL_SITE_DOMAIN}/favicon.ico` },
65+
{ rel: 'apple-touch-icon', url: `${CANONICAL_SITE_DOMAIN}/apple-icon.png` }
66+
]
67+
}
68+
1069
export default async function VersionHomeLayout({
1170
children,
1271
params

apps/wapijs.co/src/app/layout.tsx

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,78 @@
1-
import type { Metadata } from 'next'
1+
import type { Metadata, Viewport } from 'next'
22
import { Inter } from 'next/font/google'
33
import './globals.css'
44
import 'overlayscrollbars/overlayscrollbars.css'
55
import { clsx } from 'clsx'
66
import { GoogleTagManager } from '@next/third-parties/google'
7-
import { IS_PRODUCTION } from '~/constant'
7+
import {
8+
CANONICAL_SITE_DOMAIN,
9+
IS_PRODUCTION,
10+
META_CATEGORY,
11+
META_CLASSIFICATION,
12+
META_KEYWORDS,
13+
MetaTitle,
14+
ProductDescription
15+
} from '~/constant'
816

917
const inter = Inter({ subsets: ['latin'] })
1018

19+
export const viewport: Viewport = {
20+
themeColor: {
21+
color: '#25D366'
22+
},
23+
colorScheme: 'light',
24+
width: 'device-width',
25+
initialScale: 1
26+
}
27+
1128
export const metadata: Metadata = {
12-
title: 'Build whatsapp chat bot with ease - Wapi.js'
29+
title: MetaTitle,
30+
description: ProductDescription,
31+
applicationName: 'Wapijs',
32+
authors: [{ name: 'Sarthak Jain', url: `https://github.com/sarthakjdev` }],
33+
generator: 'Next.js',
34+
referrer: 'origin-when-cross-origin',
35+
keywords: META_KEYWORDS,
36+
publisher: 'Softlancer - Ideate. Innovate. Elevate',
37+
robots: 'index, follow',
38+
creator: 'Softlancer',
39+
manifest: `${CANONICAL_SITE_DOMAIN}/manifest.json`,
40+
openGraph: {
41+
type: 'website',
42+
url: CANONICAL_SITE_DOMAIN,
43+
title: MetaTitle,
44+
description: ProductDescription,
45+
images: [{ url: `${CANONICAL_SITE_DOMAIN}/og.png` }],
46+
siteName: 'Wapijs'
47+
},
48+
twitter: {
49+
card: 'summary_large_image',
50+
site: '@sarthakjdev',
51+
description: ProductDescription,
52+
title: MetaTitle,
53+
creator: '@sarthakjdev',
54+
images: `${CANONICAL_SITE_DOMAIN}/og.png`
55+
},
56+
verification: {
57+
google: 'G7K6qtaRxHsmA5TSwlNyM4iOi9J3J4WeqdPCFoqKAY4'
58+
},
59+
formatDetection: { telephone: false },
60+
appleWebApp: true,
61+
assets: `${CANONICAL_SITE_DOMAIN}/assets`,
62+
category: META_CATEGORY.join(', '),
63+
classification: META_CLASSIFICATION.join(', '),
64+
other: {
65+
'X-UA-Compatible': 'IE=edge,chrome=1',
66+
'mobile-web-app-capable': 'yes'
67+
},
68+
metadataBase: new URL(CANONICAL_SITE_DOMAIN),
69+
alternates: {
70+
canonical: new URL(CANONICAL_SITE_DOMAIN)
71+
},
72+
icons: [
73+
{ rel: 'icon', url: `${CANONICAL_SITE_DOMAIN}/favicon.ico` },
74+
{ rel: 'apple-touch-icon', url: `${CANONICAL_SITE_DOMAIN}/apple-icon.png` }
75+
]
1376
}
1477

1578
export default function RootLayout({

apps/wapijs.co/src/app/manifest.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import { metaDescription } from '~/constant'
33

44
export default function manifest(): MetadataRoute.Manifest {
55
return {
6-
name: 'Softlancer',
7-
short_name: 'Softlancer',
6+
name: 'Wapi.js',
7+
short_name: 'Wapi',
88
description: metaDescription,
99
start_url: '/',
1010
display: 'standalone',
1111
background_color: '#fff',
12-
theme_color: '#f16232',
12+
theme_color: '#25D366',
1313
icons: [
1414
{
1515
src: '/favicon.ico',

apps/wapijs.co/src/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function Home() {
88
<main className="my-auto flex min-h-screen flex-row items-center justify-center gap-5 pl-10">
99
<div className="flex flex-1 flex-col gap-6">
1010
<div
11-
className="flex w-fit flex-row mx-auto items-center justify-center gap-5 py-4"
11+
className="mx-auto flex w-fit flex-row items-center justify-center gap-5 py-4"
1212
id="launch-banners"
1313
>
1414
<div className="flex-1">

apps/wapijs.co/src/constant.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,29 @@ export const IS_PRODUCTION = process.env.NODE_ENV === 'production'
99
export const IS_DEVELOPMENT = process.env.NODE_ENV === 'development'
1010

1111
export const IS_STAGING = !IS_DEVELOPMENT && !IS_PRODUCTION
12+
13+
export const MetaTitle = 'Build WhatsApp business apps with ease and faster - Wapi.js'
14+
15+
export const ProductDescription =
16+
'Wapi.js is a node library built for developing WhatsApp cloud API based app in a user friendly way. It provides a single client to handle all the operations, listen to user and system notification via event listeners and integrated webhook server.'
17+
18+
export const CANONICAL_SITE_DOMAIN = 'https://www.wapijs.co'
19+
20+
export const META_KEYWORDS = [
21+
'nodejs',
22+
'typescript',
23+
'whatsapp chat bot',
24+
'whatsapp bot',
25+
'cloud api',
26+
'whatsapp chatbot',
27+
'cloud api sdk',
28+
'whatsapp cloud api',
29+
'whatsappjs',
30+
'whatsapp business app',
31+
'whatsapp business platform',
32+
'meta business platform'
33+
]
34+
35+
export const META_CATEGORY = []
36+
37+
export const META_CLASSIFICATION = []

packages/create-wapi-app/src/create-bot.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import chalk from "chalk";
1515
import { installPackages } from "./reusable-function.js";
1616
import { PackageManagerEnum } from "./type.js";
1717

18-
const glob = fastGlob.glob
18+
const glob = fastGlob.glob;
1919

2020
export async function createWhatsappBot(options: {
2121
directory: string;
@@ -62,7 +62,7 @@ export async function createWhatsappBot(options: {
6262
const deno = packageManagerInUse === PackageManagerEnum.Deno;
6363
await cp(
6464
new URL(
65-
`../../template/${deno ? "Deno" : isTypescriptEnabled ? "typescript" : 'javascript'}`,
65+
`../../template/${deno ? "Deno" : isTypescriptEnabled ? "typescript" : "javascript"}`,
6666
import.meta.url,
6767
),
6868
root,
@@ -76,7 +76,8 @@ export async function createWhatsappBot(options: {
7676
if (bun) {
7777
await cp(
7878
new URL(
79-
`../template/Bun/${isTypescriptEnabled ? "typescript" : "javascript"
79+
`../template/Bun/${
80+
isTypescriptEnabled ? "typescript" : "javascript"
8081
}/package.json`,
8182
import.meta.url,
8283
),

0 commit comments

Comments
 (0)