Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/webapp/pages/sources/[source].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import Custom404 from '../404';
import { defaultOpenGraph, defaultSeo } from '../../next-seo';
import { mainFeedLayoutProps } from '../../components/layouts/MainFeedPage';
import { getLayout } from '../../components/layouts/FeedLayout';
import { getPageSeoTitles } from '../../components/layouts/utils';
import { SourceActions } from '../../../shared/src/components/sources/SourceActions';
import type { DynamicSeoProps } from '../../components/common';
import { getAppOrigin } from '../../lib/seo';
Expand Down Expand Up @@ -352,10 +353,14 @@ export async function getStaticProps({
}

const { source } = res;
const seoTitles = getPageSeoTitles(`${source.name} posts`);
const seo: NextSeoProps = {
title: `${source.name} posts on daily.dev`,
openGraph: { ...defaultOpenGraph },
...defaultSeo,
...seoTitles,
openGraph: {
...defaultOpenGraph,
...seoTitles.openGraph,
},
description: source?.description || defaultSeo.description,
};

Expand Down
20 changes: 14 additions & 6 deletions packages/webapp/pages/tags/[tag].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ import Link from '@dailydotdev/shared/src/components/utilities/Link';
import CustomFeedOptionsMenu from '@dailydotdev/shared/src/components/CustomFeedOptionsMenu';
import { useContentPreference } from '@dailydotdev/shared/src/hooks/contentPreference/useContentPreference';
import { ContentPreferenceType } from '@dailydotdev/shared/src/graphql/contentPreference';
import { getPageSeoTitles } from '../../components/layouts/utils';
import { getLayout } from '../../components/layouts/FeedLayout';
import { mainFeedLayoutProps } from '../../components/layouts/MainFeedPage';
import type { DynamicSeoProps } from '../../components/common';
Expand Down Expand Up @@ -554,12 +555,19 @@ interface TagPageParams extends ParsedUrlQuery {
const getSeoData = (
title: string,
description = `Find all the recent posts, videos, updates and discussions about ${title}`,
): NextSeoProps => ({
title: `${title} posts on daily.dev`,
openGraph: { ...defaultOpenGraph },
...defaultSeo,
description,
});
): NextSeoProps => {
const seoTitles = getPageSeoTitles(`${title} posts`);

return {
...defaultSeo,
...seoTitles,
openGraph: {
...defaultOpenGraph,
...seoTitles.openGraph,
},
description,
};
};

export async function getStaticProps({
params,
Expand Down