Skip to content

Commit 7baa728

Browse files
committed
Add layout metadata, favicon, manifest and sitemap
1 parent 549aa0d commit 7baa728

15 files changed

+175
-2
lines changed

app/(home)/layout.tsx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
import { HomeLayout } from 'fumadocs-ui/layouts/home';
2-
import { baseOptions } from '@/lib/layout.shared';
2+
import { homeOptions } from '@/lib/layout.shared';
3+
4+
export const metadata = {
5+
title: 'Riven',
6+
description: 'Riven - The Ultimate Media Management Solution',
7+
manifest: '/manifest.webmanifest',
8+
keywords: ['Riven', 'Media', 'Debrid', 'Streaming'],
9+
metadataBase: new URL(process.env.NEXT_PUBLIC_BASE_URL ?? "https://riven.tv"),
10+
robots: {
11+
index: true,
12+
follow: true,
13+
noimageindex: false,
14+
"max-video-preview": -1,
15+
"max-image-preview": "large",
16+
"max-snippet": -1,
17+
},
18+
};
319

420
export default function Layout({ children }: LayoutProps<'/'>) {
5-
return <HomeLayout {...baseOptions()}>{children}</HomeLayout>;
21+
return <HomeLayout {...homeOptions()}>{children}</HomeLayout>;
622
}

app/favicon.ico

15 KB
Binary file not shown.

app/manifest.webmanifest

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"theme_color": "#020817",
3+
"background_color": "#020817",
4+
"display": "standalone",
5+
"scope": "/",
6+
"start_url": "/",
7+
"name": "Riven",
8+
"short_name": "Riven",
9+
"description": "Riven - The Ultimate Media Management Solution",
10+
"icons": [
11+
{
12+
"src": "/icons/icon-48x48.png",
13+
"sizes": "48x48",
14+
"type": "image/png"
15+
},
16+
{
17+
"src": "/icons/icon-72x72.png",
18+
"sizes": "72x72",
19+
"type": "image/png"
20+
},
21+
{
22+
"src": "/icons/icon-96x96.png",
23+
"sizes": "96x96",
24+
"type": "image/png"
25+
},
26+
{
27+
"src": "/icons/icon-128x128.png",
28+
"sizes": "128x128",
29+
"type": "image/png"
30+
},
31+
{
32+
"src": "/icons/icon-144x144.png",
33+
"sizes": "144x144",
34+
"type": "image/png"
35+
},
36+
{
37+
"src": "/icons/icon-152x152.png",
38+
"sizes": "152x152",
39+
"type": "image/png"
40+
},
41+
{
42+
"src": "/icons/icon-192x192.png",
43+
"sizes": "192x192",
44+
"type": "image/png"
45+
},
46+
{
47+
"src": "/icons/icon-256x256.png",
48+
"sizes": "256x256",
49+
"type": "image/png"
50+
},
51+
{
52+
"src": "/icons/icon-384x384.png",
53+
"sizes": "384x384",
54+
"type": "image/png"
55+
},
56+
{
57+
"src": "/icons/icon-512x512.png",
58+
"sizes": "512x512",
59+
"type": "image/png"
60+
}
61+
],
62+
"shortcuts": [
63+
{
64+
"name": "Riven Docs",
65+
"short_name": "Docs",
66+
"description": "Read the docs for the Riven application",
67+
"url": "/docs"
68+
},
69+
{
70+
"name": "Getting Started",
71+
"short_name": "Getting Started",
72+
"description": "Learn how to set up and use Riven",
73+
"url": "/docs#getting-started"
74+
}
75+
]
76+
}

app/sitemap.ts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import { source } from '@/lib/source';
2+
import type { MetadataRoute } from 'next'
3+
4+
export const revalidate = false;
5+
6+
const baseUrl = "https://riven.tv";
7+
8+
const getFullUrl = (url: string) => {
9+
if (url.startsWith('http://') || url.startsWith('https://')) {
10+
return url;
11+
}
12+
return baseUrl + url;
13+
}
14+
15+
function getAllPagesUrls(tree: any): string[] {
16+
let urls: string[] = [];
17+
18+
if (tree.children && tree.children.length > 0) {
19+
for (const child of tree.children) {
20+
urls = urls.concat(getAllPagesUrls(child));
21+
}
22+
}
23+
24+
if (tree.type === 'folder') {
25+
console.log(tree)
26+
if (tree.index && tree.index.url) {
27+
urls.push(getFullUrl(tree.index.url));
28+
} else if (tree.children?.length > 0) {
29+
for (const child of tree.children) {
30+
urls = urls.concat(getAllPagesUrls(child));
31+
}
32+
}
33+
} else if (tree.type === 'page') {
34+
urls.push(getFullUrl(tree.url));
35+
}
36+
37+
return urls;
38+
}
39+
40+
export default function sitemap(): MetadataRoute.Sitemap {
41+
42+
const tree = source.getPageTree();
43+
const pageUrls = getAllPagesUrls(tree);
44+
const sitemapEntries = pageUrls.map(url => ({
45+
url,
46+
lastModified: new Date(),
47+
}));
48+
49+
return [
50+
{
51+
url: 'https://riven.tv/',
52+
lastModified: new Date(),
53+
changeFrequency: 'yearly',
54+
priority: 1,
55+
},
56+
{
57+
url: 'https://riven.tv/docs',
58+
lastModified: new Date(),
59+
changeFrequency: 'monthly',
60+
priority: 0.8,
61+
},
62+
...sitemapEntries,
63+
]
64+
}

lib/layout.shared.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,20 @@ export function baseOptions(): BaseLayoutProps {
3030
links: [],
3131
};
3232
}
33+
34+
export function homeOptions(): BaseLayoutProps {
35+
return {
36+
nav: {
37+
title: (
38+
<>
39+
<Image src="/logo.png" alt="Logo" width={24} height={24} />
40+
Riven
41+
</>
42+
),
43+
},
44+
// see https://fumadocs.dev/docs/ui/navigation/links
45+
links: [
46+
{ url: '/docs', text: 'Docs', type: 'main' },
47+
],
48+
};
49+
}

public/icons/icon-128x128.png

31.9 KB
Loading

public/icons/icon-144x144.png

39.7 KB
Loading

public/icons/icon-152x152.png

43.4 KB
Loading

public/icons/icon-192x192.png

64.7 KB
Loading

public/icons/icon-256x256.png

107 KB
Loading

0 commit comments

Comments
 (0)