Skip to content

Commit d79cc08

Browse files
authored
Merge branch 'pdelfan:main' into main
2 parents 63da2b2 + 4d7d367 commit d79cc08

File tree

39 files changed

+198
-72
lines changed

39 files changed

+198
-72
lines changed

Diff for: src/app/(auth)/login/layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Metadata } from "next";
22
import Image from "next/image";
33

44
export const metadata: Metadata = {
5-
title: "Ouranos — Login",
5+
title: "Login",
66
description: "Your Bluesky web client",
77
};
88

Diff for: src/app/(site)/about/layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Metadata } from "next";
22

33
export const metadata: Metadata = {
4-
title: "Ouranos - About",
4+
title: "About",
55
description: "About Ouranos",
66
};
77

Diff for: src/app/dashboard/feeds/[feed]/layout.tsx

-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
import type { Metadata } from "next";
2-
3-
export const metadata: Metadata = {
4-
title: "Ouranos — Feed",
5-
description: "Feed",
6-
};
7-
81
export default function FeedLayout({
92
children,
103
}: {

Diff for: src/app/dashboard/feeds/[feed]/page.tsx

+14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
import FeedHeader from "@/components/contentDisplay/feedHeader/FeedHeader";
22
import FeedContainer from "@/containers/posts/FeedContainer";
3+
import { getFeedInfo } from "@/lib/api/bsky/feed";
4+
import { Metadata } from "next";
5+
6+
export async function generateMetadata({ searchParams }: Props): Promise<Metadata> {
7+
const feedInfo = await getFeedInfo(searchParams.uri);
8+
const title = feedInfo.view.displayName
9+
? feedInfo.view.displayName
10+
: "Feed";
11+
12+
return {
13+
title: title + " — Ouranos",
14+
description: "Feed",
15+
};
16+
}
317

418
interface Props {
519
searchParams: {

Diff for: src/app/dashboard/feeds/layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Layout from "@/containers/Layout";
22
import type { Metadata } from "next";
33

44
export const metadata: Metadata = {
5-
title: "Ouranos — Feeds",
5+
title: "Feeds",
66
description: "Feeds",
77
};
88

Diff for: src/app/dashboard/home/[feed]/page.tsx

+14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
import FeedContainer from "@/containers/posts/FeedContainer";
2+
import { getFeedInfo } from "@/lib/api/bsky/feed";
3+
import { Metadata } from "next";
4+
5+
export async function generateMetadata({ searchParams }: Props): Promise<Metadata> {
6+
const feedInfo = await getFeedInfo(searchParams.uri);
7+
const title = feedInfo.view.displayName
8+
? feedInfo.view.displayName
9+
: "Feed";
10+
11+
return {
12+
title: title + " — Ouranos",
13+
description: "Feed",
14+
};
15+
}
216

317
interface Props {
418
searchParams: {

Diff for: src/app/dashboard/home/layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import FeedTabs from "@/components/navigational/feedTabs/FeedTabs";
22
import type { Metadata } from "next";
33

44
export const metadata: Metadata = {
5-
title: "Ouranos — Home",
5+
title: "Home",
66
description: "Home",
77
};
88

Diff for: src/app/dashboard/layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { getProfile } from "@/lib/api/bsky/actor";
88
import { getSessionFromServer } from "@/lib/api/auth/session";
99

1010
export const metadata: Metadata = {
11-
title: "Ouranos",
11+
title: { template: "%s — Ouranos", default: "Ouranos" },
1212
description: "Home",
1313
};
1414

Diff for: src/app/dashboard/lists/layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Layout from "@/containers/Layout";
22
import type { Metadata } from "next";
33

44
export const metadata: Metadata = {
5-
title: "Ouranos — Lists",
5+
title: "Lists",
66
description: "Lists",
77
};
88

Diff for: src/app/dashboard/notifications/layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Layout from "@/containers/Layout";
22
import type { Metadata } from "next";
33

44
export const metadata: Metadata = {
5-
title: "Ouranos — Notifications",
5+
title: "Notifications",
66
description: "Notifications",
77
};
88

Diff for: src/app/dashboard/search/layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Layout from "@/containers/Layout";
22
import type { Metadata } from "next";
33

44
export const metadata: Metadata = {
5-
title: "Ouranos — Search",
5+
title: "Search",
66
description: "Search",
77
};
88

Diff for: src/app/dashboard/settings/appearance/page.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
import AppearanceContainer from "@/containers/settings/AppearanceContainer/AppearanceContainer";
2+
import { Metadata } from "next";
3+
4+
export const metadata: Metadata = {
5+
title: "Appearance",
6+
description: "Appearance",
7+
};
28

39
export default function Page() {
410
return <AppearanceContainer />;

Diff for: src/app/dashboard/settings/blocked-users/page.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
import BlockedUsersContainer from "@/containers/settings/blockedUsersContainer/BlockedUsersContainer";
2+
import { Metadata } from "next";
3+
4+
export const metadata: Metadata = {
5+
title: "Blocked Users",
6+
description: "Blocked Users",
7+
};
8+
29

310
export default function Page() {
411
return <BlockedUsersContainer />;

Diff for: src/app/dashboard/settings/content-filtering/page.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
import ContentFilteringContainer from "@/containers/settings/contentFilteringContainer/ContentFilteringContainer";
2+
import { Metadata } from "next";
3+
4+
export const metadata: Metadata = {
5+
title: "Content Filtering",
6+
description: "Content Filtering",
7+
};
28

39
export default function Page() {
410
return <ContentFilteringContainer />;

Diff for: src/app/dashboard/settings/home-feed/page.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
import HomeFeedContainer from "@/containers/settings/homeFeedContainer/HomeFeedContainer";
2+
import { Metadata } from "next";
3+
4+
export const metadata: Metadata = {
5+
title: "Home Feed Preferences",
6+
description: "Home Feed Preferences",
7+
};
28

39
export default function Page() {
410
return <HomeFeedContainer />;

Diff for: src/app/dashboard/settings/layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Layout from "@/containers/Layout";
22
import type { Metadata } from "next";
33

44
export const metadata: Metadata = {
5-
title: "Ouranos — Settings",
5+
title: { template: "%sOuranos", default: "Settings" },
66
description: "Settings",
77
};
88

Diff for: src/app/dashboard/settings/muted-users/page.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
import MutedUsersContainer from "@/containers/settings/mutedUsersContainer/MutedUsersContainer";
2+
import { Metadata } from "next";
3+
4+
export const metadata: Metadata = {
5+
title: "Muted Users",
6+
description: "Muted Users",
7+
};
28

39
export default function Page() {
410
return <MutedUsersContainer />;

Diff for: src/app/dashboard/settings/my-feeds/page.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
import MyFeedsContainer from "@/containers/settings/myFeedsContainer/MyFeedsContainer";
2+
import { Metadata } from "next";
3+
4+
export const metadata: Metadata = {
5+
title: "My Feeds",
6+
description: "My Feeds",
7+
};
28

39
export default function Page() {
410
return <MyFeedsContainer />;

Diff for: src/app/dashboard/settings/thread-preferences/page.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
import ThreadPreferencesContainer from "@/containers/settings/threadPreferencesContainer/ThreadPreferencesContainer";
2+
import { Metadata } from "next";
3+
4+
export const metadata: Metadata = {
5+
title: "Thread Preferences",
6+
description: "Thread Preferences",
7+
};
28

39
export default function Page() {
410
return <ThreadPreferencesContainer />;

Diff for: src/app/dashboard/user/[handle]/(content)/layout.tsx

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
import type { Metadata } from "next";
22
import ProfileHeader from "@/components/contentDisplay/profileHeader/ProfileHeader";
3+
import { getProfile } from "@/lib/api/bsky/actor";
34

4-
export const metadata: Metadata = {
5-
title: "Ouranos — Profile",
6-
description: "Profile",
7-
};
5+
export async function generateMetadata({ params }: Props): Promise<Metadata> {
6+
const profile = await getProfile(params.handle);
7+
const title = profile?.displayName
8+
? `${profile.displayName} (@${params.handle})`
9+
: params.handle;
10+
11+
return {
12+
title: title,
13+
description: "Profile",
14+
};
15+
}
816

917
interface Props {
1018
params: { handle: string };

Diff for: src/app/dashboard/user/[handle]/(follow)/known-followers/page.tsx

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1-
import FollowingContainer from "@/containers/users/FollowingContainer";
21
import KnownFollowersContainer from "@/containers/users/KnownFollowersContainer";
2+
import type { Metadata } from "next";
3+
4+
export function generateMetadata({ params }: Props): Metadata {
5+
const title = `Followers of @${params.handle} that you know`;
6+
const descripton = `Followers of @${params.handle} that you know`;
7+
8+
return {
9+
title: title,
10+
description: descripton,
11+
};
12+
}
313

414
interface Props {
515
params: {

Diff for: src/app/dashboard/user/[handle]/(post)/post/[id]/liked-by/layout.tsx

-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
import Layout from "@/containers/Layout";
2-
import type { Metadata } from "next";
3-
4-
export const metadata: Metadata = {
5-
title: "Ouranos — Liked By",
6-
description: "Liked By",
7-
};
82

93
export default function LikedByLayout({
104
children,

Diff for: src/app/dashboard/user/[handle]/(post)/post/[id]/liked-by/page.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
import LikedByContainer from "@/containers/thread/LikedByContainer";
2+
import type { Metadata } from "next";
3+
4+
export function generateMetadata({ params }: Props): Metadata {
5+
const title = `@${params.handle}'s Post Liked By`;
6+
const descripton = `Users who have liked @${params.handle}'s post`;
7+
8+
return {
9+
title: title,
10+
description: descripton,
11+
};
12+
}
213

314
interface Props {
415
params: {

Diff for: src/app/dashboard/user/[handle]/(post)/post/[id]/page.tsx

+27
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,33 @@
11
import PostThreadContainer from "@/containers/thread/PostThreadContainer";
22
import { getSessionFromServer } from "@/lib/api/auth/session";
33
import { getProfile } from "@/lib/api/bsky/actor";
4+
import { getAgent } from "@/lib/api/bsky/agent";
5+
import { getPostThread } from "@/lib/api/bsky/feed";
6+
import { AppBskyFeedDefs, AppBskyFeedPost } from "@atproto/api";
7+
import { Metadata } from "next";
8+
9+
export async function generateMetadata({ params }: Props): Promise<Metadata> {
10+
const agent = await getAgent();
11+
const { handle, id } = params;
12+
const { data } = await agent.resolveHandle({ handle });
13+
const uri = `at://${data.did}/app.bsky.feed.post/${id}`;
14+
const post = await getPostThread(uri);
15+
16+
const isThreadViewPost = AppBskyFeedDefs.isThreadViewPost(post) ? true : false;
17+
const threadPost = isThreadViewPost ? post.post as AppBskyFeedDefs.PostView : null;
18+
19+
const text =
20+
threadPost && AppBskyFeedPost.isRecord(threadPost.record)
21+
? threadPost.record.text
22+
: "";
23+
24+
const title = text !== "" ? `${threadPost?.author.displayName || params.handle}: "${text}"` : `Post by ${params.handle}`;
25+
26+
return {
27+
title: title,
28+
description: "Feed",
29+
};
30+
}
431

532
interface Props {
633
params: {

Diff for: src/app/dashboard/user/[handle]/(post)/post/[id]/quotes/layout.tsx

-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
import Layout from "@/containers/Layout";
2-
import type { Metadata } from "next";
3-
4-
export const metadata: Metadata = {
5-
title: "Ouranos — Quotes",
6-
description: "Quotes for this post",
7-
};
82

93
export default function RepostedByLayout({
104
children,

Diff for: src/app/dashboard/user/[handle]/(post)/post/[id]/quotes/page.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
import QuotesContainer from "@/containers/thread/QuotesContainer";
2+
import type { Metadata } from "next";
3+
4+
export function generateMetadata({ params }: Props): Metadata {
5+
const title = `@${params.handle}'s Post Quotes`;
6+
const descripton = `Users who have quoted @${params.handle}'s post`;
7+
8+
return {
9+
title: title,
10+
description: descripton,
11+
};
12+
}
213

314
interface Props {
415
params: {

Diff for: src/app/dashboard/user/[handle]/(post)/post/[id]/reposted-by/layout.tsx

-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
import Layout from "@/containers/Layout";
2-
import type { Metadata } from "next";
3-
4-
export const metadata: Metadata = {
5-
title: "Ouranos — Reposted By",
6-
description: "Reposted By",
7-
};
82

93
export default function RepostedByLayout({
104
children,

Diff for: src/app/dashboard/user/[handle]/(post)/post/[id]/reposted-by/page.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
import RepostedByContainer from "@/containers/thread/RepostedByContainer";
2+
import type { Metadata } from "next";
3+
4+
export function generateMetadata({ params }: Props): Metadata {
5+
const title = `@${params.handle}'s Post Reposted By`;
6+
const descripton = `Users who have reposted @${params.handle}'s post`;
7+
8+
return {
9+
title: title,
10+
description: descripton,
11+
};
12+
}
213

314
interface Props {
415
params: {

Diff for: src/app/dashboard/user/[handle]/lists/[list]/layout.tsx

-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
import type { Metadata } from "next";
2-
3-
export const metadata: Metadata = {
4-
title: "Ouranos — List",
5-
description: "List",
6-
};
7-
81
export default function ListsLayout({
92
children,
103
}: {

Diff for: src/app/dashboard/user/[handle]/lists/[list]/page.tsx

+14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
import ListContainer from "@/containers/lists/ListContainer";
2+
import { getListInfo } from "@/lib/api/bsky/list";
3+
import { Metadata } from "next";
4+
5+
export async function generateMetadata({ searchParams }: Props): Promise<Metadata> {
6+
const listInfo = await getListInfo(searchParams.uri);
7+
const title = listInfo.list.name
8+
? listInfo.list.name
9+
: "List";
10+
11+
return {
12+
title: title,
13+
description: "Feed",
14+
};
15+
}
216

317
interface Props {
418
searchParams: {

0 commit comments

Comments
 (0)