Skip to content

Commit b620077

Browse files
committed
Merge branch 'feature/song-page-tags'
2 parents 1c5ef50 + 3d0b7e1 commit b620077

File tree

16 files changed

+97
-28
lines changed

16 files changed

+97
-28
lines changed

web/public/docs/guidelines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> Last updated: October 7, 2024
44
5-
Welcome to **Note Block World**! We strive to be the best online community for everyone to create, share, and listen to note block music from around the world, no matter your level of experience!
5+
Welcome to **Note Block World**! We strive to be the best online community for everyone to discover, share, and listen to note block music from around the world, no matter your level of experience!
66

77
In this page, you’ll find a few guidelines that we’ve put in place to help keep Note Block World a healthy, safe, and positive space for all of our members. We kindly ask that you read these Guidelines carefully and follow them closely when contributing to the community!
88

web/src/app/(content)/(info)/about/page.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,7 @@ import { NoteBlockWorldLogo } from '@web/src/modules/shared/components/NoteBlock
66
import About from './about.mdx';
77

88
export const metadata: Metadata = {
9-
title: {
10-
template: '%s | Help',
11-
default: 'Note Block World',
12-
},
13-
openGraph: {
14-
title: 'Create, share and listen to note block music',
15-
description: 'Note Block World',
16-
siteName: 'Note Block World',
17-
},
9+
title: 'About',
1810
};
1911

2012
const AboutPage = () => {

web/src/app/(content)/(info)/blog/page.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ import Link from 'next/link';
55

66
import { getSortedPostsData } from '@web/src/lib/posts';
77
import type { PostType } from '@web/src/lib/posts';
8+
import { Metadata } from 'next';
89

10+
export const metadata: Metadata = {
11+
title: 'Blog',
12+
};
913
async function BlogPage() {
1014
const allPostsData = getSortedPostsData('blog', 'date');
1115
return <BlogPageComponent posts={allPostsData}></BlogPageComponent>;

web/src/app/(content)/(info)/contact/page.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,7 @@ import BackButton from '@web/src/modules/shared/components/client/BackButton';
55
import Contact from './contact.mdx';
66

77
export const metadata: Metadata = {
8-
title: {
9-
template: '%s | Help',
10-
default: 'Note Block World',
11-
},
12-
openGraph: {
13-
title: 'Create, share and listen to note block music',
14-
description: 'Note Block World',
15-
siteName: 'Note Block World',
16-
},
8+
title: 'Contact',
179
};
1810

1911
const AboutPage = () => {

web/src/app/(content)/(info)/help/[id]/page.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,11 @@ export function generateMetadata({ params }: HelpPageProps): Metadata {
1818
const publicUrl = process.env.NEXT_PUBLIC_URL;
1919

2020
return {
21-
title: {
22-
template: '%s | Help',
23-
default: 'Note Block World',
24-
},
21+
title: post.title,
2522
authors: [{ name: post.author }],
2623
openGraph: {
2724
url: publicUrl + '/help/' + id,
2825
title: post.title,
29-
description: 'Create, share and listen to note block music',
3026
siteName: 'Note Block World',
3127
images: [
3228
{

web/src/app/(content)/(info)/help/page.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ import Link from 'next/link';
55

66
import { getSortedPostsData } from '@web/src/lib/posts';
77
import type { PostType } from '@web/src/lib/posts';
8+
import { Metadata } from 'next';
9+
10+
export const metadata: Metadata = {
11+
title: 'Help Center',
12+
};
813

914
async function HelpPage() {
1015
const allPostsData = getSortedPostsData('help', 'id');

web/src/app/(content)/my-songs/page.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import { redirect } from 'next/navigation';
22

33
import { checkLogin } from '@web/src/modules/auth/features/auth.utils';
44
import Page from '@web/src/modules/my-songs/components/MySongsPage';
5+
import { Metadata } from 'next';
6+
7+
export const metadata: Metadata = {
8+
title: 'My songs',
9+
};
510

611
const MySongsPage = async () => {
712
// TODO: Next.js extends fetch() to memoize the result of multiple requests to the same URL.

web/src/app/(content)/page.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
FeaturedSongsDtoType,
33
SongPreviewDtoType,
44
} from '@shared/validation/song/dto/types';
5+
import { Metadata } from 'next';
56

67
import axiosInstance from '@web/src/lib/axios';
78
import { HomePageProvider } from '@web/src/modules/browse/components/client/context/HomePage.context';
@@ -46,6 +47,10 @@ async function fetchFeaturedSongs(): Promise<FeaturedSongsDtoType> {
4647
}
4748
}
4849

50+
export const metadata: Metadata = {
51+
title: 'Songs',
52+
};
53+
4954
async function Home() {
5055
const recentSongs = await fetchRecentSongs();
5156
const featuredSongs = await fetchFeaturedSongs();

web/src/app/(content)/song/[id]/page.tsx

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,48 @@
1+
import { SongViewDtoType } from '@shared/validation/song/dto/types';
2+
import type { Metadata } from 'next';
3+
4+
import axios from '@web/src/lib/axios';
15
import { SongPage } from '@web/src/modules/song/components/SongPage';
26

3-
function Page({ params }: { params: { id: string } }) {
7+
interface SongPage {
8+
params: {
9+
id: string;
10+
};
11+
}
12+
13+
export async function generateMetadata({
14+
params,
15+
}: SongPage): Promise<Metadata> {
16+
let song;
17+
const publicUrl = process.env.NEXT_PUBLIC_URL;
18+
19+
try {
20+
const response = await axios.get<SongViewDtoType>(`/song/${params.id}`);
21+
song = response.data;
22+
} catch {
23+
return {
24+
title: 'Unknown song!',
25+
};
26+
}
27+
28+
return {
29+
title: song.title,
30+
description: song.description,
31+
authors: [{ name: song.uploader.username }],
32+
openGraph: {
33+
url: publicUrl + '/song/' + song.publicId,
34+
title: song.title,
35+
description: song.description,
36+
siteName: 'Note Block World',
37+
images: [song.thumbnailUrl],
38+
},
39+
twitter: {
40+
card: 'summary_large_image',
41+
},
42+
};
43+
}
44+
45+
function Page({ params }: SongPage) {
446
const { id } = params;
547

648
return <SongPage id={id} />;

web/src/app/(content)/upload/page.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ import {
55
getUserData,
66
} from '@web/src/modules/auth/features/auth.utils';
77
import { UploadSongPage } from '@web/src/modules/song-upload/components/client/UploadSongPage';
8+
import { Metadata } from 'next';
9+
10+
export const metadata: Metadata = {
11+
title: 'Upload song',
12+
};
813

914
async function UploadPage() {
1015
const isLogged = await checkLogin();

0 commit comments

Comments
 (0)