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
5 changes: 3 additions & 2 deletions src/components/SeoGenerator/SeoGenerator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const SeoGenerator: FC<SeoGeneratorProps> = ({
preloadImages,
}) => {
const router = useRouter();
const isUserProfile = router.pathname.startsWith('/user/');

if (forceNoIndex && canonicalOverride) {
return (
Expand Down Expand Up @@ -114,7 +115,7 @@ const SeoGenerator: FC<SeoGeneratorProps> = ({
<meta
name="robots"
content={
process.env.NEXT_PUBLIC_INDEXING === 'off'
isUserProfile || process.env.NEXT_PUBLIC_INDEXING === 'off'
? 'noindex, nofollow'
: 'index, follow'
}
Expand Down Expand Up @@ -209,7 +210,7 @@ const SeoGenerator: FC<SeoGeneratorProps> = ({
))}
<meta httpEquiv="X-UA-Compatible" content="ie=edge" />
<meta name="theme-color" content="#1e2023" />
{pathname.includes('/user') ? (
{isUserProfile ? (
<meta name="robots" content={'noindex, nofollow'} />
) : (
<meta
Expand Down
1 change: 1 addition & 0 deletions src/pages/user/[userId]/certificate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const Certificate = ({ userId, certificate }) => {
export default Certificate;

export async function getServerSideProps(context) {
context.res.setHeader('X-Robots-Tag', 'noindex, nofollow');
const userId = context.params.userId;
const certificate = await getCertificate(userId);
if (!certificate) context.res.statusCode = 404;
Expand Down
6 changes: 3 additions & 3 deletions src/uxcore/components/SeoGenerator/SeoGenerator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const SeoGenerator: FC<SeoGeneratorProps> = ({
!pathname.includes('/uxcgdiy') &&
!pathname.includes('/uxcgstory');
const isUXCPPage = pathname.includes('/uxcp');
const isUserProfile = pathname.includes('/user');
const isUserProfile = router.pathname.startsWith('/user/');
const isUXCatPage = pathname.includes('/uxcat');
let favIconPath = '/assets/favicon.svg';

Expand All @@ -108,7 +108,7 @@ const SeoGenerator: FC<SeoGeneratorProps> = ({
<meta
name="robots"
content={
process.env.NEXT_PUBLIC_INDEXING === 'off'
isUserProfile || process.env.NEXT_PUBLIC_INDEXING === 'off'
? 'noindex, nofollow'
: 'index, follow'
}
Expand Down Expand Up @@ -225,7 +225,7 @@ const SeoGenerator: FC<SeoGeneratorProps> = ({
/>
<meta httpEquiv="X-UA-Compatible" content="ie=edge" />
<meta name="theme-color" content="#1e2023" />
{pathname.includes('/user') ? (
{isUserProfile ? (
<meta name="robots" content={'noindex, nofollow'} />
) : (
<meta
Expand Down
Loading