From 23e4d616d268b3f28dcbafca0815a28698f90394 Mon Sep 17 00:00:00 2001 From: "Jandir A. Cutabiala" Date: Sun, 15 Sep 2024 01:45:53 -0300 Subject: [PATCH] feat: add canonical --- eslint.config.mjs | 10 ---------- gatsby-config.ts | 15 ++++++++++++--- package.json | 1 + src/components/Footer/index.tsx | 2 +- yarn.lock | 7 +++++++ 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 2c3780c..ba3cf25 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -59,14 +59,4 @@ export default [ "@typescript-eslint/no-explicit-any": "off", }, }, - // { - // overrides: [ - // { - // files: ["src/images/**"], - // rules: { - // all: "off", - // }, - // }, - // ], - // }, ]; diff --git a/gatsby-config.ts b/gatsby-config.ts index 86b13e4..2f35a43 100644 --- a/gatsby-config.ts +++ b/gatsby-config.ts @@ -3,10 +3,12 @@ import type { GatsbyConfig } from "gatsby"; import algoliaQueries from "./algolia-queries"; +const siteUrl = "https://jandir.co"; + const config: GatsbyConfig = { siteMetadata: { title: `Jandir A. Cutabiala | Software Engineer`, - siteUrl: `https://jandir.co`, + siteUrl, author: { name: `Jandir A. Cutabiala`, }, @@ -36,8 +38,8 @@ const config: GatsbyConfig = { { resolve: "gatsby-plugin-robots-txt", options: { - host: "https://jandir.co", - sitemap: "https://jandir.co/sitemap", + host: siteUrl, + sitemap: `${siteUrl}/sitemap-index.xml`, policy: [ { userAgent: "*", @@ -53,6 +55,13 @@ const config: GatsbyConfig = { lang: "en", }, }, + { + resolve: `gatsby-plugin-canonical-urls`, + options: { + siteUrl, + stripQueryString: true, + }, + }, { resolve: "gatsby-plugin-mdx", options: { diff --git a/package.json b/package.json index c5dff4f..16fe311 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "dotenv": "16.4.5", "gatsby": "5.13.7", "gatsby-plugin-algolia": "1.0.3", + "gatsby-plugin-canonical-urls": "5.13.1", "gatsby-plugin-google-gtag": "5.13.1", "gatsby-plugin-google-tagmanager": "5.13.1", "gatsby-plugin-html-attributes": "1.0.5", diff --git a/src/components/Footer/index.tsx b/src/components/Footer/index.tsx index b89f2ee..f73bc6b 100644 --- a/src/components/Footer/index.tsx +++ b/src/components/Footer/index.tsx @@ -36,7 +36,7 @@ export default function Footer() {

All rights reserved © jandir.co {currentYear}

- + Term of use
diff --git a/yarn.lock b/yarn.lock index 4663281..01e6c0a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7679,6 +7679,13 @@ gatsby-plugin-algolia@1.0.3: algoliasearch "^4.9.1" lodash.chunk "^4.2.0" +gatsby-plugin-canonical-urls@5.13.1: + version "5.13.1" + resolved "https://registry.yarnpkg.com/gatsby-plugin-canonical-urls/-/gatsby-plugin-canonical-urls-5.13.1.tgz#90ad65fb188afdde38fbbb412af4cbb11eef1847" + integrity sha512-rnVEfz7gIPgYk/go/fk5tM5Iv/7Qe6GonquhWMkDNPvRJPJ0qkv37Hv1l/BrC/2AHz9RNQsSZJRonVPPSHlhgA== + dependencies: + "@babel/runtime" "^7.20.13" + gatsby-plugin-google-gtag@5.13.1: version "5.13.1" resolved "https://registry.yarnpkg.com/gatsby-plugin-google-gtag/-/gatsby-plugin-google-gtag-5.13.1.tgz#81b294f2ab12dad5ba5e9946e4b78cd315676bbc"