From aa9f0e19a205282a037af4cea4844749ce4bfe1a Mon Sep 17 00:00:00 2001 From: Gaurav Khanna Date: Sun, 18 Feb 2024 10:35:05 -0800 Subject: [PATCH 1/2] add sizes override to Link element --- src/SEO.astro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SEO.astro b/src/SEO.astro index 63930cf..559f50e 100644 --- a/src/SEO.astro +++ b/src/SEO.astro @@ -9,9 +9,10 @@ import LanguageAlternatesTags from "./components/LanguageAlternatesTags.astro"; export type TwitterCardType = "summary" | "summary_large_image" | "app" | "player"; -export interface Link extends HTMLLinkElement { +export interface Link extends Omit { prefetch: boolean; crossorigin: string; + sizes: string; } export interface Meta extends HTMLMetaElement { From 5ba950e9d1a9bf39fabe58359d0beec39fbaf35a Mon Sep 17 00:00:00 2001 From: Jonas-Merlin Schumacher Date: Mon, 19 Feb 2024 06:54:13 +0100 Subject: [PATCH 2/2] test: Add test for extended link sizes attribute --- cypress/e2e/seo.cy.js | 3 ++- src/pages/extendedLinkTags.astro | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/seo.cy.js b/cypress/e2e/seo.cy.js index 6dde00b..851a511 100644 --- a/cypress/e2e/seo.cy.js +++ b/cypress/e2e/seo.cy.js @@ -122,7 +122,7 @@ describe("Basic Tags Without URL", () => { cy.get('head meta[property="og:url"]').should( "have.attr", "content", - "http://localhost:4321/ogBasicTagsWithoutUrl/" + "http://localhost:4321/ogBasicTagsWithoutUrl" ); }); }); @@ -384,6 +384,7 @@ describe("Extended link tags", () => { cy.get('head link[rel="icon"]').should("have.attr", "href", "/favicon.ico"); cy.get('head link[rel="icon"]').should("have.attr", "rel", "icon"); cy.get('head link[rel="icon"]').should("have.attr", "type", "image/svg+xml"); + cy.get('head link[rel="icon"]').should("have.attr", "sizes", "60x60"); }); }); diff --git a/src/pages/extendedLinkTags.astro b/src/pages/extendedLinkTags.astro index b3f4534..bde81f7 100644 --- a/src/pages/extendedLinkTags.astro +++ b/src/pages/extendedLinkTags.astro @@ -10,7 +10,7 @@ import SEO from "../SEO.astro"; title="Francis York Morgan" description="Agent" canonical="Zach" - extend={{ link: [{ rel: "icon", href: "/favicon.ico", type:"image/svg+xml" }] }} + extend={{ link: [{ rel: "icon", href: "/favicon.ico", type:"image/svg+xml", sizes: "60x60" }] }} /> Test