Skip to content

Commit 0bd8930

Browse files
committed
favicons and og meta added
1 parent 04c658d commit 0bd8930

36 files changed

+480
-9
lines changed

app/layout.tsx

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Banner from "../components/banner";
66
import Footer from "../components/footer";
77
import { Logo } from "../components/logo";
88
import UserProfile from "../components/user-profile";
9+
import metainfo from "../meta-info";
910
import "../styles/globals.scss";
1011

1112
const navigation: { path: string; title: string }[] = [
@@ -74,6 +75,102 @@ export default function RootLayout({
7475

7576
return (
7677
<html lang="en">
78+
<head>
79+
<link rel="icon" type="image/x-icon" href="/favicons/favicon.ico" />
80+
<link
81+
rel="icon"
82+
type="image/png"
83+
sizes="16x16"
84+
href="/favicons/favicon-16x16.png"
85+
/>
86+
<link
87+
rel="icon"
88+
type="image/png"
89+
sizes="32x32"
90+
href="/favicons/favicon-32x32.png"
91+
/>
92+
<link
93+
rel="icon"
94+
type="image/png"
95+
sizes="48x48"
96+
href="/favicons/favicon-48x48.png"
97+
/>
98+
<link rel="manifest" href="/favicons/manifest.webmanifest" />
99+
<meta name="mobile-web-app-capable" content="yes" />
100+
<meta name="theme-color" content="#fff" />
101+
<meta name="application-name" content="BONSE" />
102+
<link
103+
rel="apple-touch-icon"
104+
sizes="57x57"
105+
href="/favicons/apple-touch-icon-57x57.png"
106+
/>
107+
<link
108+
rel="apple-touch-icon"
109+
sizes="60x60"
110+
href="/favicons/apple-touch-icon-60x60.png"
111+
/>
112+
<link
113+
rel="apple-touch-icon"
114+
sizes="72x72"
115+
href="/favicons/apple-touch-icon-72x72.png"
116+
/>
117+
<link
118+
rel="apple-touch-icon"
119+
sizes="76x76"
120+
href="/favicons/apple-touch-icon-76x76.png"
121+
/>
122+
<link
123+
rel="apple-touch-icon"
124+
sizes="114x114"
125+
href="/favicons/apple-touch-icon-114x114.png"
126+
/>
127+
<link
128+
rel="apple-touch-icon"
129+
sizes="120x120"
130+
href="/favicons/apple-touch-icon-120x120.png"
131+
/>
132+
<link
133+
rel="apple-touch-icon"
134+
sizes="144x144"
135+
href="/favicons/apple-touch-icon-144x144.png"
136+
/>
137+
<link
138+
rel="apple-touch-icon"
139+
sizes="152x152"
140+
href="/favicons/apple-touch-icon-152x152.png"
141+
/>
142+
<link
143+
rel="apple-touch-icon"
144+
sizes="167x167"
145+
href="/favicons/apple-touch-icon-167x167.png"
146+
/>
147+
<link
148+
rel="apple-touch-icon"
149+
sizes="180x180"
150+
href="/favicons/apple-touch-icon-180x180.png"
151+
/>
152+
<link
153+
rel="apple-touch-icon"
154+
sizes="1024x1024"
155+
href="/favicons/apple-touch-icon-1024x1024.png"
156+
/>
157+
<meta name="apple-mobile-web-app-capable" content="yes" />
158+
<meta
159+
name="apple-mobile-web-app-status-bar-style"
160+
content="black-translucent"
161+
/>
162+
<meta name="apple-mobile-web-app-title" content="BONSE" />
163+
<link
164+
rel="yandex-tableau-widget"
165+
href="/favicons/yandex-browser-manifest.json"
166+
/>
167+
168+
<meta property="og:title" content={metainfo.title} />
169+
<meta property="og:description" content={metainfo.description} />
170+
171+
<meta name="twitter:title" content={metainfo.title} />
172+
<meta name="twitter:description" content={metainfo.description} />
173+
</head>
77174
<body>
78175
<header className="border-b border-gray-300 rounded-b-2xl">
79176
<Banner />

app/page.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
import { Metadata } from "next";
22
import Home from "../components/home";
3+
import metainfo from "../meta-info";
34

4-
export const metadata: Metadata = {
5-
title: "Optimize Your Website for Search Engines with BONSE",
6-
description:
7-
"Discover how BONSE can help you optimize your website for search engines and improve your online visibility. Learn more about our SEO tool and start boosting your rankings today!",
8-
keywords: "website optimization,SEO success,BONSE,search engine optimization",
9-
};
5+
export const metadata: Metadata = metainfo;
106

117
export default () => {
128
return <Home />;

fav.png

539 KB
Loading

gen-favicons.mjs

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import { favicons } from "favicons";
2+
import { mkdirSync, writeFileSync } from "fs";
3+
import { basename, join } from "path";
4+
5+
export async function generateFavicons(
6+
metaDesc,
7+
version,
8+
baseImage = "fav.png",
9+
appName = basename(process.cwd()),
10+
basepath = join(process.cwd(), "public"),
11+
faviconsPath = "favicons",
12+
devName = "Darsan",
13+
devWebsite = "https://darsan.in"
14+
) {
15+
const options = {
16+
path: faviconsPath,
17+
18+
appName: appName,
19+
appDescription: metaDesc,
20+
version: version,
21+
22+
developerName: devName,
23+
developerURL: devWebsite,
24+
25+
background: "#fff",
26+
theme_color: "#fff",
27+
appleStatusBarStyle: "black-translucent",
28+
29+
display: "fullscreen",
30+
orientation: "natural",
31+
32+
start_url: "/",
33+
34+
manifestMaskable: true,
35+
36+
icons: {
37+
android: true,
38+
appleIcon: true,
39+
favicons: true,
40+
yandex: true,
41+
appleStartup: false,
42+
windows: false,
43+
},
44+
45+
shortcuts: {},
46+
};
47+
48+
try {
49+
const { images, files, html } = await favicons(baseImage, options);
50+
51+
const rootPath = join(basepath, faviconsPath);
52+
mkdirSync(rootPath, { recursive: true });
53+
54+
/* write images */
55+
images.forEach((image) => {
56+
writeFileSync(join(rootPath, image.name), image.contents, {
57+
encoding: "binary",
58+
});
59+
});
60+
61+
/* write config files */
62+
files.forEach((file) => {
63+
writeFileSync(join(rootPath, file.name), file.contents, {
64+
encoding: "utf8",
65+
});
66+
});
67+
68+
const faviconsHtmlLinks = html.join("");
69+
writeFileSync(join(basepath, "links.html"), faviconsHtmlLinks);
70+
} catch (err) {
71+
console.error(err);
72+
process.exit(1);
73+
}
74+
}
75+
76+
generateFavicons(
77+
"Discover how BONSE can help you optimize your website for search engines and improve your online visibility. Learn more about our SEO tool and start boosting your rankings today!",
78+
"0.0.1"
79+
);

meta-info.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const metainfo = {
2+
title: "Optimize Your Website for Search Engines with BONSE",
3+
description:
4+
"Discover how BONSE can help you optimize your website for search engines and improve your online visibility. Learn more about our SEO tool and start boosting your rankings today!",
5+
keywords: "website optimization,SEO success,BONSE,search engine optimization",
6+
};
7+
export default metainfo;

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"@radix-ui/react-avatar": "^1.1.0",
1717
"@radix-ui/react-tabs": "^1.1.0",
1818
"autoprefixer": "^10.4.19",
19+
"favicons": "^7.2.0",
1920
"next": "^14.2.5",
2021
"postcss": "^8.4.39",
2122
"react": "^18.3.1",
@@ -33,4 +34,4 @@
3334
"ts-node": "10.9.2",
3435
"typescript": "5.4.5"
3536
}
36-
}
37+
}
5 KB
Loading
6.96 KB
Loading
9.62 KB
Loading
1.1 KB
Loading
15.4 KB
Loading
1.51 KB
Loading
21.7 KB
Loading
2.34 KB
Loading
3.26 KB
Loading
12.2 KB
Loading
911 Bytes
Loading
947 Bytes
Loading
1.2 KB
Loading
1.28 KB
Loading
1.42 KB
Loading
1.58 KB
Loading
407 Bytes
Loading
462 Bytes
Loading
544 Bytes
Loading
577 Bytes
Loading
1.58 KB
Loading

public/favicons/apple-touch-icon.png

1.58 KB
Loading

public/favicons/favicon-16x16.png

448 Bytes
Loading

public/favicons/favicon-32x32.png

971 Bytes
Loading

public/favicons/favicon-48x48.png

1.51 KB
Loading

public/favicons/favicon.ico

32.5 KB
Binary file not shown.

public/favicons/manifest.webmanifest

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"name": "BONSE",
3+
"short_name": "BONSE",
4+
"description": "Discover how BONSE can help you optimize your website for search engines and improve your online visibility. Learn more about our SEO tool and start boosting your rankings today!",
5+
"dir": "auto",
6+
"lang": "en-US",
7+
"display": "fullscreen",
8+
"orientation": "natural",
9+
"start_url": "/",
10+
"background_color": "#fff",
11+
"theme_color": "#fff",
12+
"icons": [
13+
{
14+
"src": "/favicons/android-chrome-36x36.png",
15+
"sizes": "36x36",
16+
"type": "image/png",
17+
"purpose": "any maskable"
18+
},
19+
{
20+
"src": "/favicons/android-chrome-48x48.png",
21+
"sizes": "48x48",
22+
"type": "image/png",
23+
"purpose": "any maskable"
24+
},
25+
{
26+
"src": "/favicons/android-chrome-72x72.png",
27+
"sizes": "72x72",
28+
"type": "image/png",
29+
"purpose": "any maskable"
30+
},
31+
{
32+
"src": "/favicons/android-chrome-96x96.png",
33+
"sizes": "96x96",
34+
"type": "image/png",
35+
"purpose": "any maskable"
36+
},
37+
{
38+
"src": "/favicons/android-chrome-144x144.png",
39+
"sizes": "144x144",
40+
"type": "image/png",
41+
"purpose": "any maskable"
42+
},
43+
{
44+
"src": "/favicons/android-chrome-192x192.png",
45+
"sizes": "192x192",
46+
"type": "image/png",
47+
"purpose": "any maskable"
48+
},
49+
{
50+
"src": "/favicons/android-chrome-256x256.png",
51+
"sizes": "256x256",
52+
"type": "image/png",
53+
"purpose": "any maskable"
54+
},
55+
{
56+
"src": "/favicons/android-chrome-384x384.png",
57+
"sizes": "384x384",
58+
"type": "image/png",
59+
"purpose": "any maskable"
60+
},
61+
{
62+
"src": "/favicons/android-chrome-512x512.png",
63+
"sizes": "512x512",
64+
"type": "image/png",
65+
"purpose": "any maskable"
66+
}
67+
]
68+
}
1.57 KB
Loading
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"version": "0.0.1",
3+
"api_version": 1,
4+
"layout": {
5+
"logo": "/favicons/yandex-browser-50x50.png",
6+
"color": "#fff",
7+
"show_title": true
8+
}
9+
}

0 commit comments

Comments
 (0)