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

Add sizes override to Link element #89

Merged
merged 2 commits into from
Feb 19, 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
3 changes: 2 additions & 1 deletion cypress/e2e/seo.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);
});
});
Expand Down Expand Up @@ -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");
});
});

Expand Down
3 changes: 2 additions & 1 deletion src/SEO.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLLinkElement, 'sizes'> {
prefetch: boolean;
crossorigin: string;
sizes: string;
}

export interface Meta extends HTMLMetaElement {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/extendedLinkTags.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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" }] }}
/>
</head>
<body>Test</body>
Expand Down
Loading