]> git.ardis.lu - ardislu.dev/commitdiff
Remove canonical URL header
authorArdis Lu <ardisglu@gmail.com>
Mon, 28 Oct 2024 04:31:51 +0000 (21:31 -0700)
committerArdis Lu <ardisglu@gmail.com>
Mon, 28 Oct 2024 04:31:51 +0000 (21:31 -0700)
It causes issues with SEO when the search engine's scraper doesn't finish running the JS to update the canonical URL for an article. There are also no alternate URLs so the canonical URL is not useful anyway (the canonical URL was originally intended to de-duplicate the "www." subdomain but "www." already redirects to the root).

index.html
script.js

index ddd530b57e42f1136284fd4b16370d95602af177..4b7216f23fa3ab7d315b65eb2778c09c1af66d1e 100644 (file)
@@ -25,7 +25,6 @@
   <link rel="manifest" href="/manifest.webmanifest">
   <link rel="search" href="https://ardislu.dev/opensearch.osdx" type="application/opensearchdescription+xml" title="ardislu.dev">
   <link rel="alternate" type="application/atom+xml" title="ardislu.dev" href="/atom.xml">
-  <link rel="canonical" href="https://ardislu.dev/">
   <style>
     @layer fonts, base, print, hljs;
 
index 9a51f6d3eb8115f2e25a3ef7554e9d8ff793ac43..7ce2c3215edea093202ffc76b1e7731acbbbe80c 100644 (file)
--- a/script.js
+++ b/script.js
@@ -184,7 +184,6 @@ function buildPostComponent(articleContent) {
 function setPageMetadata(values) {
   document.title = values.title;
   document.querySelector('meta[name="description"]').content = values.description;
-  document.querySelector('link[rel="canonical"]').href = `https://ardislu.dev${values.path}`;
   document.querySelector('meta[property="og:title"]').content = values.title;
   document.querySelector('meta[property="og:description"]').content = values.description;
   document.querySelector('meta[property="og:url"]').content = `https://ardislu.dev${values.path}`;
This page took 0.03714 seconds and 4 git commands to generate.