Skip to content

Commit

Permalink
Remove canonical links
Browse files Browse the repository at this point in the history
  • Loading branch information
Hacksore committed Oct 21, 2024
1 parent 449a9e1 commit e294e8c
Show file tree
Hide file tree
Showing 16 changed files with 2 additions and 52 deletions.
8 changes: 1 addition & 7 deletions apps/web/src/components/common-head.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,21 @@ export interface Props {
title: string;
description: string;
image?: string;
canonicalPath?: string;
}
const defaultCanonicalUrl = removeTrailingSlash(
new URL(Astro.url.pathname, Astro.site).toString(),
);
// Image has website default
const { title, description, image = SITE_IMAGE, canonicalPath } = Astro.props;
const { title, description, image = SITE_IMAGE } = Astro.props;
function removeTrailingSlash(str: string) {
return str.replace(/\/+$/, "");
}
const ogCacheKey = "v3";
const ogImage = new URL(`${image}?c=${ogCacheKey}`, Astro.url);
const activeCanonicalUrl = canonicalPath
? new URL(canonicalPath, Astro.site).toString()
: defaultCanonicalUrl;
---

<head>
Expand All @@ -34,7 +29,6 @@ const activeCanonicalUrl = canonicalPath
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="generator" content={Astro.generator} />
<link rel="canonical" href={activeCanonicalUrl} />

<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
Expand Down
1 change: 0 additions & 1 deletion apps/web/src/content/blog/100-stars.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Celebrating 100 Stars on Github
customSlug: celebrating-100-stars-on-github
canonicalPath: /discord-overlayed-mac
description: Thanks to the everyone in the community for making this possible ❤️
ogImage: "../../assets/blog/100-stars.png"
pubDate: "March 06 2024"
Expand Down
1 change: 0 additions & 1 deletion apps/web/src/content/blog/borderless-fullscreen.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Using Overlayed On Fullscreen Games
customSlug: discord-overlay-in-any-game
canonicalPath: /discord-overlay-in-any-game
description: This guide will help you set your game to allow Overlayed to still work
ogImage: "../../assets/blog/borderless-windowed.png"
pubDate: "Jun 01 2024"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Discord Overlay for Minecraft
customSlug: discord-overlay-for-minecraft
canonicalPath: "/iscord-overlay-for-minecraft"
description: "Discord Overlay for Minecraft Java and Bedrock"
ogImage: "../../assets/blog/minecraft-overlay.png"
pubDate: "Oct 08 2024"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Discord Game Overlay Supported Games
customSlug: discord-game-overlay-supported-games
canonicalPath: "/discord-overlay-supported-games"
description: "The offical list of games supported by the Discord game overlay"
ogImage: "../../assets/blog/discord-overlay-supported-games.png"
pubDate: "July 08 2024"
Expand Down
1 change: 0 additions & 1 deletion apps/web/src/content/blog/install-guide.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Overlayed Installation Guide (All Platforms)
customSlug: installation-guide
canonicalPath: /installation-guide
description: Learn how to install Overlayed on each platform
ogImage: "../../assets/blog/installing-all-platforms.png"
pubDate: "Feb 14 2024"
Expand Down
1 change: 0 additions & 1 deletion apps/web/src/content/blog/linux.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Installing Overlayed on Linux
customSlug: installing-overlayed-on-linux
canonicalPath: /discord-overlayed-linux
description: Learn how to install the Overlayed app on Linux Step by Step
ogImage: "../../assets/blog/installing-on-linux.png"
pubDate: "Jan 01 2024"
Expand Down
1 change: 0 additions & 1 deletion apps/web/src/content/blog/mac-brew.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Installing Overlayed on Mac with Homebrew
customSlug: installing-overlayed-on-mac-with-homebrew
canonicalPath: /discord-overlayed-mac-homebrew
description: Learn how to install the Overlayed app on Mac With Homebrew
ogImage: "../../assets/blog/installing-with-homebrew.png"
pubDate: "Jan 14 2024"
Expand Down
1 change: 0 additions & 1 deletion apps/web/src/content/blog/mac.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Installing Overlayed on Mac
customSlug: installing-overlayed-on-mac
canonicalPath: /discord-overlayed-mac
description: Learn how to install the Overlayed app on Mac Step by Step
ogImage: "../../assets/blog/installing-on-mac.png"
pubDate: "Jan 01 2024"
Expand Down
1 change: 0 additions & 1 deletion apps/web/src/content/blog/windows-smartscreen.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Windows SmartScreen and Overlayed
customSlug: windows-smartscreen-and-overlayed
canonicalPath: windows-smartscreen-and-overlayed
description: Windows SmartScreen will show up when trying to install Overlayed on Windows
ogImage: "../../assets/blog/windows-smartscreen.png"
pubDate: "July 24 2024"
Expand Down
1 change: 0 additions & 1 deletion apps/web/src/content/blog/windows-winget.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Installing Overlayed on Windows with Winget
customSlug: installing-overlayed-on-windows-with-winget
canonicalPath: /discord-overlayed-windows-winget
description: Learn how to install the Overlayed app on Windows with Winget
ogImage: "../../assets/blog/installing-with-winget.png"
pubDate: "Jul 01 2024"
Expand Down
1 change: 0 additions & 1 deletion apps/web/src/content/blog/windows.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Installing Overlayed on Windows
customSlug: installing-overlayed-on-windows
canonicalPath: /discord-overlayed-windows
description: Learn how to install the Overlayed app on Windows Step by Step
ogImage: "../../assets/blog/installing-on-windows.png"
pubDate: "Jan 02 2024"
Expand Down
1 change: 0 additions & 1 deletion apps/web/src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const blog = defineCollection({
z.object({
title: z.string(),
customSlug: z.string(),
canonicalPath: z.string().optional(),
pubDate: z.string(),
ogImage: image().refine((img) => img.width >= 1200, {
message: "OG image must be at least 1080 pixels wide!",
Expand Down
4 changes: 1 addition & 3 deletions apps/web/src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ interface Props {
title?: string;
description?: string;
ogImage?: string;
canonicalPath?: string;
}
const { title, description, canonicalPath, ogImage } = Astro.props;
const { title, description, ogImage } = Astro.props;
---

<!doctype html>
Expand All @@ -21,7 +20,6 @@ const { title, description, canonicalPath, ogImage } = Astro.props;
title={title ?? SITE_TITLE}
description={description ?? SITE_DESCRIPTION}
image={ogImage}
canonicalPath={canonicalPath}
/>

<body>
Expand Down
1 change: 0 additions & 1 deletion apps/web/src/pages/blog/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const { Content } = await post.render();
title={post.data.title}
description={post.data.description}
ogImage={post.data.ogImage.src}
canonicalPath={post.data.canonicalPath}
>
<main class="px-4 prose prose-invert mx-auto pt-28">
<h1 class="text-4xl font-bold text-start md:text-center mb-2">
Expand Down
29 changes: 0 additions & 29 deletions apps/web/src/pages/discord-overlay-[slug].astro

This file was deleted.

0 comments on commit e294e8c

Please sign in to comment.