Skip to content

Commit

Permalink
💄 style(meta): Fix and add metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Sep 25, 2023
1 parent 0faa22f commit c872522
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 17 deletions.
Binary file removed public/icons/icon-192x192.png
Binary file not shown.
Binary file removed public/icons/icon-512x512.png
Binary file not shown.
Binary file removed public/icons/icon-72x72.png
Binary file not shown.
Binary file removed public/icons/icon-96x96.png
Binary file not shown.
18 changes: 7 additions & 11 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
{
"background_color": "#fff",
"background_color": "#000000",
"display": "fullscreen",
"icons": [
{
"src": "icons/icon-72x72.png",
"sizes": "72x72",
"type": "image/png"
},
{
"src": "icons/icon-96x96.png",
"sizes": "96x96",
"src": "https://registry.npmmirror.com/@lobehub/assets-favicons/1.1.0/files/assets/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/icon-192x192.png",
"sizes": "192x192",
"src": "https://registry.npmmirror.com/@lobehub/assets-favicons/1.1.0/files/assets/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
Expand All @@ -23,5 +18,6 @@
"scope": "/",
"short_name": "LobeChat",
"splash_pages": null,
"start_url": "/"
"start_url": "/",
"theme_color": "#000000"
}
1 change: 1 addition & 0 deletions src/app/StyleRegistry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const StyleRegistry = ({ children }: PropsWithChildren) => {

isInsert.current = true;

// @ts-ignore
return extractStaticStyle().map((item) => item.style);
});

Expand Down
8 changes: 2 additions & 6 deletions src/app/layout.page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Analytics } from '@vercel/analytics/react';
import { Metadata } from 'next';
import { cookies } from 'next/headers';
import { PropsWithChildren } from 'react';

Expand All @@ -12,11 +11,6 @@ import Layout from '@/layout/GlobalLayout';

import StyleRegistry from './StyleRegistry';

export const metadata: Metadata = {
manifest: '/manifest.json',
title: 'LobeChat',
};

const RootLayout = ({ children }: PropsWithChildren) => {
// get default theme config to use with ssr
const cookieStore = cookies();
Expand All @@ -43,3 +37,5 @@ const RootLayout = ({ children }: PropsWithChildren) => {
};

export default RootLayout;

export { default as metadata } from './metadata';
62 changes: 62 additions & 0 deletions src/app/metadata.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { Metadata } from 'next';

import { genSiteHeadTitle } from '@/utils/genSiteHeadTitle';

import pkg from '../../package.json';

const title = genSiteHeadTitle();
const description = pkg.description;
const metadata: Metadata = {
appleWebApp: {
statusBarStyle: 'black-translucent',
title: title,
},
description: description,
icons: {
apple:
'https://registry.npmmirror.com/@lobehub/assets-favicons/1.1.0/files/assets/apple-touch-icon.png',
icon: 'https://registry.npmmirror.com/@lobehub/assets-favicons/1.1.0/files/assets/favicon-32x32.png',
other: {
rel: 'mask-icon',
url: 'https://registry.npmmirror.com/@lobehub/assets-favicons/1.1.0/files/assets/safari-pinned-tab.svg',
},
},
manifest: '/manifest.json',
openGraph: {
description: description,
images: [
{
alt: title,
height: 192,
url: 'https://registry.npmmirror.com/@lobehub/assets-favicons/1.1.0/files/assets/android-chrome-192x192.png',
width: 192,
},
{
alt: title,
height: 512,
url: 'https://registry.npmmirror.com/@lobehub/assets-favicons/1.1.0/files/assets/android-chrome-512x512.png',
width: 512,
},
],
locale: 'en_US',
siteName: title,
title: title,
type: 'website',
url: pkg.homepage,
},
themeColor: [
{ color: '#fff', media: '(prefers-color-scheme: light)' },
{ color: '#000', media: '(prefers-color-scheme: dark)' },
],
title: genSiteHeadTitle(),
viewport: {
initialScale: 1,
maximumScale: 1,
minimumScale: 1,
userScalable: false,
viewportFit: 'cover',
width: 'device-width',
},
};

export default metadata;

0 comments on commit c872522

Please sign in to comment.