Skip to content

Commit

Permalink
improving cannonical tags
Browse files Browse the repository at this point in the history
  • Loading branch information
zachlasiuk committed Aug 5, 2024
1 parent 4b488dd commit eb66bbe
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<url>
<loc>https://www.arm.com/developer-hub/ecosystem-dashboard?package={{ .Params.name | urlize }}</loc>{{ if not .Lastmod.IsZero }}
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}
<changefreq>monthly</changefreq>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
{{ end }}{{ end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@

<title>{{ .Site.Title }}</title>


<!-- Canonical link that changes if a package is selected -->
<link rel="canonical" href="https://www.arm.com/developer-hub/ecosystem-dashboard" />


<!-- Include the Arm standard Lato font for machines that don't have by default (Mac) -->
<!-- Can be done automatically now in cross-page.css locally to speed up process -->
<link rel="preconnect" href="https://fonts.gstatic.com" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ function updatePageMetadata(package_dom) {
if (!does_it_woa) {
social_description = "View "+pkg_name+" in the Ecosystem Dashboard for Arm and discover if it runs on Arm (and if not, what alternative packages do).";
}
let new_cannonical = 'https://www.arm.com/developer-hub/ecosystem-dashboard?package='+normalizePackageName(pkg_name);




Expand All @@ -93,6 +95,15 @@ function updatePageMetadata(package_dom) {
}


// Update canonical link
const canonical_link = document.querySelector('link[rel="canonical"]');
if (canonical_link) {
canonical_link.setAttribute('rel',new_cannonical);
}


link rel="canonical"

// Update descriptions
const ogDescription = document.querySelector('meta[property="og:description"]');
if (ogDescription) {
Expand Down

0 comments on commit eb66bbe

Please sign in to comment.