File tree 39 files changed +198
-72
lines changed
components/dataDisplay/postEmbed
39 files changed +198
-72
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import type { Metadata } from "next";
2
2
import Image from "next/image" ;
3
3
4
4
export const metadata : Metadata = {
5
- title : "Ouranos — Login" ,
5
+ title : "Login" ,
6
6
description : "Your Bluesky web client" ,
7
7
} ;
8
8
Original file line number Diff line number Diff line change 1
1
import type { Metadata } from "next" ;
2
2
3
3
export const metadata : Metadata = {
4
- title : "Ouranos - About" ,
4
+ title : "About" ,
5
5
description : "About Ouranos" ,
6
6
} ;
7
7
Original file line number Diff line number Diff line change 1
- import type { Metadata } from "next" ;
2
-
3
- export const metadata : Metadata = {
4
- title : "Ouranos — Feed" ,
5
- description : "Feed" ,
6
- } ;
7
-
8
1
export default function FeedLayout ( {
9
2
children,
10
3
} : {
Original file line number Diff line number Diff line change 1
1
import FeedHeader from "@/components/contentDisplay/feedHeader/FeedHeader" ;
2
2
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
+ }
3
17
4
18
interface Props {
5
19
searchParams : {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import Layout from "@/containers/Layout";
2
2
import type { Metadata } from "next" ;
3
3
4
4
export const metadata : Metadata = {
5
- title : "Ouranos — Feeds" ,
5
+ title : "Feeds" ,
6
6
description : "Feeds" ,
7
7
} ;
8
8
Original file line number Diff line number Diff line change 1
1
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
+ }
2
16
3
17
interface Props {
4
18
searchParams : {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import FeedTabs from "@/components/navigational/feedTabs/FeedTabs";
2
2
import type { Metadata } from "next" ;
3
3
4
4
export const metadata : Metadata = {
5
- title : "Ouranos — Home" ,
5
+ title : "Home" ,
6
6
description : "Home" ,
7
7
} ;
8
8
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { getProfile } from "@/lib/api/bsky/actor";
8
8
import { getSessionFromServer } from "@/lib/api/auth/session" ;
9
9
10
10
export const metadata : Metadata = {
11
- title : " Ouranos",
11
+ title : { template : "%s — Ouranos", default : "Ouranos" } ,
12
12
description : "Home" ,
13
13
} ;
14
14
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import Layout from "@/containers/Layout";
2
2
import type { Metadata } from "next" ;
3
3
4
4
export const metadata : Metadata = {
5
- title : "Ouranos — Lists" ,
5
+ title : "Lists" ,
6
6
description : "Lists" ,
7
7
} ;
8
8
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import Layout from "@/containers/Layout";
2
2
import type { Metadata } from "next" ;
3
3
4
4
export const metadata : Metadata = {
5
- title : "Ouranos — Notifications" ,
5
+ title : "Notifications" ,
6
6
description : "Notifications" ,
7
7
} ;
8
8
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import Layout from "@/containers/Layout";
2
2
import type { Metadata } from "next" ;
3
3
4
4
export const metadata : Metadata = {
5
- title : "Ouranos — Search" ,
5
+ title : "Search" ,
6
6
description : "Search" ,
7
7
} ;
8
8
Original file line number Diff line number Diff line change 1
1
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
+ } ;
2
8
3
9
export default function Page ( ) {
4
10
return < AppearanceContainer /> ;
Original file line number Diff line number Diff line change 1
1
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
+
2
9
3
10
export default function Page ( ) {
4
11
return < BlockedUsersContainer /> ;
Original file line number Diff line number Diff line change 1
1
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
+ } ;
2
8
3
9
export default function Page ( ) {
4
10
return < ContentFilteringContainer /> ;
Original file line number Diff line number Diff line change 1
1
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
+ } ;
2
8
3
9
export default function Page ( ) {
4
10
return < HomeFeedContainer /> ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import Layout from "@/containers/Layout";
2
2
import type { Metadata } from "next" ;
3
3
4
4
export const metadata : Metadata = {
5
- title : "Ouranos — Settings",
5
+ title : { template : "%s — Ouranos" , default : " Settings" } ,
6
6
description : "Settings" ,
7
7
} ;
8
8
Original file line number Diff line number Diff line change 1
1
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
+ } ;
2
8
3
9
export default function Page ( ) {
4
10
return < MutedUsersContainer /> ;
Original file line number Diff line number Diff line change 1
1
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
+ } ;
2
8
3
9
export default function Page ( ) {
4
10
return < MyFeedsContainer /> ;
Original file line number Diff line number Diff line change 1
1
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
+ } ;
2
8
3
9
export default function Page ( ) {
4
10
return < ThreadPreferencesContainer /> ;
Original file line number Diff line number Diff line change 1
1
import type { Metadata } from "next" ;
2
2
import ProfileHeader from "@/components/contentDisplay/profileHeader/ProfileHeader" ;
3
+ import { getProfile } from "@/lib/api/bsky/actor" ;
3
4
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
+ }
8
16
9
17
interface Props {
10
18
params : { handle : string } ;
Original file line number Diff line number Diff line change 1
- import FollowingContainer from "@/containers/users/FollowingContainer" ;
2
1
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
+ }
3
13
4
14
interface Props {
5
15
params : {
Original file line number Diff line number Diff line change 1
1
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
- } ;
8
2
9
3
export default function LikedByLayout ( {
10
4
children,
Original file line number Diff line number Diff line change 1
1
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
+ }
2
13
3
14
interface Props {
4
15
params : {
Original file line number Diff line number Diff line change 1
1
import PostThreadContainer from "@/containers/thread/PostThreadContainer" ;
2
2
import { getSessionFromServer } from "@/lib/api/auth/session" ;
3
3
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
+ }
4
31
5
32
interface Props {
6
33
params : {
Original file line number Diff line number Diff line change 1
1
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
- } ;
8
2
9
3
export default function RepostedByLayout ( {
10
4
children,
Original file line number Diff line number Diff line change 1
1
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
+ }
2
13
3
14
interface Props {
4
15
params : {
Original file line number Diff line number Diff line change 1
1
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
- } ;
8
2
9
3
export default function RepostedByLayout ( {
10
4
children,
Original file line number Diff line number Diff line change 1
1
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
+ }
2
13
3
14
interface Props {
4
15
params : {
Original file line number Diff line number Diff line change 1
- import type { Metadata } from "next" ;
2
-
3
- export const metadata : Metadata = {
4
- title : "Ouranos — List" ,
5
- description : "List" ,
6
- } ;
7
-
8
1
export default function ListsLayout ( {
9
2
children,
10
3
} : {
Original file line number Diff line number Diff line change 1
1
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
+ }
2
16
3
17
interface Props {
4
18
searchParams : {
You can’t perform that action at this time.
0 commit comments