From 5b93bc42db9d4811333903ff7fc386f91441008b Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Fri, 20 Jan 2023 20:10:21 +0400 Subject: [PATCH] Remove trailing slashes from the website URLs --- astro.config.mjs | 5 ++- sitemap.mjs | 22 +++++----- src/components/Breadcrumbs.astro | 39 ++++++++++------- src/components/FeaturedGuides.astro | 4 +- src/components/FeaturedVideos.astro | 4 +- src/components/Footer.astro | 26 ++++++----- src/components/GridRoadmapItem.astro | 2 +- src/components/GuideListItem.astro | 2 +- src/components/Navigation.astro | 45 ++++++-------------- src/components/ResourcesAlert.astro | 21 +++------ src/components/RoadmapBanner.astro | 16 +++---- src/components/RoadmapHeader.astro | 4 +- src/components/TopicSearch/TopicSearch.astro | 20 ++++----- src/components/VideoListItem.astro | 20 ++++----- src/components/YouTubeBanner.astro | 17 +++----- src/pages/404.astro | 4 +- src/pages/[...topicId].astro | 2 +- src/pages/[roadmapId]/index.astro | 2 +- src/pages/[roadmapId]/topics.astro | 4 +- src/pages/about.astro | 2 +- src/pages/guides/[guideId].astro | 2 +- src/pages/guides/index.astro | 7 +-- src/pages/index.astro | 5 ++- src/pages/privacy.md | 2 +- src/pages/roadmaps.astro | 2 +- src/pages/signup.astro | 2 +- src/pages/videos/[videoId].astro | 2 +- src/pages/videos/index.astro | 7 +-- 28 files changed, 126 insertions(+), 164 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index b9c871620..ce9747e9a 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -10,7 +10,7 @@ export default defineConfig({ site: 'https://roadmap.sh', markdown: { shikiConfig: { - theme: 'dracula' + theme: 'dracula', }, rehypePlugins: [ [ @@ -21,6 +21,9 @@ export default defineConfig({ ], ], }, + build: { + format: 'file', + }, integrations: [ tailwind({ config: { diff --git a/sitemap.mjs b/sitemap.mjs index d5c678ca3..c2c4bfa72 100644 --- a/sitemap.mjs +++ b/sitemap.mjs @@ -7,21 +7,21 @@ async function getRoadmapIds() { export function shouldIndexPage(page) { return ![ - 'https://roadmap.sh/404/', - 'https://roadmap.sh/terms/', - 'https://roadmap.sh/privacy/', - 'https://roadmap.sh/pdfs/', + 'https://roadmap.sh/404', + 'https://roadmap.sh/terms', + 'https://roadmap.sh/privacy', + 'https://roadmap.sh/pdfs', ].includes(page); } export async function serializeSitemap(item) { const highPriorityPages = [ - 'https://roadmap.sh/', - 'https://roadmap.sh/about/', - 'https://roadmap.sh/roadmaps/', - 'https://roadmap.sh/guides/', - 'https://roadmap.sh/videos/', - ...(await getRoadmapIds()).map((id) => `https://roadmap.sh/${id}/`), + 'https://roadmap.sh', + 'https://roadmap.sh/about', + 'https://roadmap.sh/roadmaps', + 'https://roadmap.sh/guides', + 'https://roadmap.sh/videos', + ...(await getRoadmapIds()).flatMap((id) => [`https://roadmap.sh/${id}`, `https://roadmap.sh/${id}/topics`]), ]; // Roadmaps and other high priority pages @@ -37,7 +37,7 @@ export async function serializeSitemap(item) { } // Guide and video pages - if (item.url.startsWith('https://roadmap.sh/guides/') || item.url.startsWith('https://roadmap.sh/videos/')) { + if (item.url.startsWith('https://roadmap.sh/guides') || item.url.startsWith('https://roadmap.sh/videos')) { return { ...item, // @ts-ignore diff --git a/src/components/Breadcrumbs.astro b/src/components/Breadcrumbs.astro index d4a99cfdc..38748e947 100644 --- a/src/components/Breadcrumbs.astro +++ b/src/components/Breadcrumbs.astro @@ -10,28 +10,35 @@ const { breadcrumbs, roadmapId } = Astro.props; ---
- - - -

- - ← Back to Topics List - -

-
\ No newline at end of file + return {breadcrumb.title}; + }) + } +

+ + +

+ + ← Back to Topics List + +

+ diff --git a/src/components/FeaturedGuides.astro b/src/components/FeaturedGuides.astro index 9b9d51f6e..a9c5ec032 100644 --- a/src/components/FeaturedGuides.astro +++ b/src/components/FeaturedGuides.astro @@ -18,7 +18,7 @@ const { heading, guides } = Astro.props;
View All Guides  → diff --git a/src/components/FeaturedVideos.astro b/src/components/FeaturedVideos.astro index 242d33e33..267e9b217 100644 --- a/src/components/FeaturedVideos.astro +++ b/src/components/FeaturedVideos.astro @@ -18,7 +18,7 @@ const { heading, videos } = Astro.props;
View All Videos  → diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 8ab5d9c57..66621494a 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -4,24 +4,22 @@ import Icon from './Icon.astro';
@@ -78,8 +76,8 @@ import Icon from './Icon.astro'; />

- The leading DevOps resource for Kubernetes, cloud-native computing, - and the latest in at-scale development, deployment, and management. + The leading DevOps resource for Kubernetes, cloud-native computing, and the latest in at-scale development, + deployment, and management.

diff --git a/src/components/GridRoadmapItem.astro b/src/components/GridRoadmapItem.astro index 624eff270..d7ffb1542 100644 --- a/src/components/GridRoadmapItem.astro +++ b/src/components/GridRoadmapItem.astro @@ -10,7 +10,7 @@ const frontmatter = roadmap.frontmatter; --- {frontmatter.title} diff --git a/src/components/Navigation.astro b/src/components/Navigation.astro index 196587125..af7f6f1d0 100644 --- a/src/components/Navigation.astro +++ b/src/components/Navigation.astro @@ -12,18 +12,18 @@ import Icon from './Icon.astro';

- - diff --git a/src/components/RoadmapBanner.astro b/src/components/RoadmapBanner.astro index ed4f8d486..fec1f96bb 100644 --- a/src/components/RoadmapBanner.astro +++ b/src/components/RoadmapBanner.astro @@ -10,17 +10,13 @@ const { roadmap, roadmapId } = Astro.props; --- - - - Visit complete + + + Visit complete - {roadmap.featuredTitle} roadmap + {roadmap.featuredTitle} roadmap diff --git a/src/components/RoadmapHeader.astro b/src/components/RoadmapHeader.astro index 1c25adeab..f1bad6c0c 100644 --- a/src/components/RoadmapHeader.astro +++ b/src/components/RoadmapHeader.astro @@ -37,7 +37,7 @@ const isRoadmapReady = !isUpcoming; !hasSearch && ( <> @@ -76,7 +76,7 @@ const isRoadmapReady = !isUpcoming; { hasSearch && ( diff --git a/src/components/TopicSearch/TopicSearch.astro b/src/components/TopicSearch/TopicSearch.astro index 8c8b5341c..bb50b5962 100644 --- a/src/components/TopicSearch/TopicSearch.astro +++ b/src/components/TopicSearch/TopicSearch.astro @@ -1,21 +1,19 @@ --- -import Icon from "../Icon.astro"; +import Icon from '../Icon.astro'; --- - -
+
- - + +
diff --git a/src/components/VideoListItem.astro b/src/components/VideoListItem.astro index 3668ce15f..a95bf4905 100644 --- a/src/components/VideoListItem.astro +++ b/src/components/VideoListItem.astro @@ -1,5 +1,5 @@ --- -import type { VideoFileType } from "../lib/video"; +import type { VideoFileType } from '../lib/video'; export interface Props { video: VideoFileType; @@ -11,30 +11,30 @@ const { frontmatter, id } = video;
- + {frontmatter.title} { frontmatter.isNew && ( - + New - ) } - diff --git a/src/components/YouTubeBanner.astro b/src/components/YouTubeBanner.astro index 43c722383..1e81ad6de 100644 --- a/src/components/YouTubeBanner.astro +++ b/src/components/YouTubeBanner.astro @@ -2,17 +2,14 @@ import Icon from './Icon.astro'; --- -
+
- We now have a YouTube Channel.  We now have a YouTube Channel.