Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEMrush - Fixing non-canonical links in sitemap #3018

Merged
merged 1 commit into from
Aug 23, 2024
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
2 changes: 1 addition & 1 deletion app/products/[filename]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export async function generateMetadata({

const seo = tinaProps.data.products.seo;
if (seo && !seo.canonical) {
seo.canonical = `${tinaProps.data.global.header.url}/products/${params.filename}`;
seo.canonical = `${tinaProps.data.global.header.url}products/${params.filename}`;
}

// eslint-disable-next-line react-hooks/rules-of-hooks
Expand Down
2 changes: 1 addition & 1 deletion pages/industry/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const getStaticProps = async () => {

const seo = tinaProps.data.industryIndex.seo;
if (seo && !seo.canonical) {
seo.canonical = `${tinaProps.data.global.header.url}/products`;
seo.canonical = `${tinaProps.data.global.header.url}/industry`;
}

return {
Expand Down
4 changes: 2 additions & 2 deletions pages/netug/[[...filename]].tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import client from "@/tina/client";
import classNames from "classnames";
import { InferGetStaticPropsType } from "next";
import ReactDomServer from "react-dom/server";
import { tinaField, useTina } from "tinacms/dist/react";
import { TinaMarkdown } from "tinacms/dist/rich-text";
import {
Expand All @@ -26,7 +27,6 @@ import { getRandomTestimonialsByCategory } from "../../helpers/getTestimonials";
import { sanitiseXSS, spanWhitelist } from "../../helpers/validator";
import { removeExtension } from "../../services/client/utils.service";
import { EventInfo } from "../../services/server/events";
import ReactDomServer from "react-dom/server";

const ISR_TIME = 60 * 60; // 1 hour;

Expand Down Expand Up @@ -390,7 +390,7 @@ export const getStaticProps = async ({ params }) => {
tinaProps.data.userGroupPage.seo &&
!tinaProps.data.userGroupPage.seo.canonical
) {
tinaProps.data.userGroupPage.seo.canonical = `${tinaProps.data.global.header.url}netug/${params.filename ?? ""}`;
tinaProps.data.userGroupPage.seo.canonical = `${tinaProps.data.global.header.url}netug${params.filename ? `/${params.filename}` : ""}`;
}

return {
Expand Down
Loading