Add canonicals and fix og:url on all pages

pull/3259/head
Kamran Ahmed 2 years ago
parent d5495f7280
commit 52d00a0654
  1. 8
      src/layouts/BaseLayout.astro
  2. 2
      src/pages/404.astro
  3. 18
      src/pages/[...topicId].astro
  4. 1
      src/pages/[roadmapId]/index.astro
  5. 11
      src/pages/[roadmapId]/topics.astro
  6. 2
      src/pages/about.astro
  7. 6
      src/pages/guides/[guideId].astro
  8. 6
      src/pages/guides/index.astro
  9. 2
      src/pages/index.astro
  10. 1
      src/pages/pdfs.md
  11. 1
      src/pages/privacy.md
  12. 16
      src/pages/roadmaps.astro
  13. 1
      src/pages/signup.astro
  14. 1
      src/pages/terms.md
  15. 1
      src/pages/videos/[videoId].astro
  16. 1
      src/pages/videos/index.astro

@ -14,6 +14,7 @@ export interface Props {
description?: string; description?: string;
keywords?: string[]; keywords?: string[];
noIndex?: boolean; noIndex?: boolean;
permalink?: string;
sponsor?: SponsorType; sponsor?: SponsorType;
} }
@ -22,8 +23,11 @@ const {
description = siteConfig.description, description = siteConfig.description,
keywords = siteConfig.keywords, keywords = siteConfig.keywords,
noIndex = false, noIndex = false,
permalink = '',
sponsor, sponsor,
} = Astro.props; } = Astro.props;
const currentPageAbsoluteUrl = `https://roadmap.sh${permalink}`;
--- ---
<!DOCTYPE html> <!DOCTYPE html>
@ -53,7 +57,9 @@ const {
<meta property='og:title' content={title} /> <meta property='og:title' content={title} />
<meta property='og:description' content={description} /> <meta property='og:description' content={description} />
<meta property='og:type' content='website' /> <meta property='og:type' content='website' />
<meta property='og:url' content='https://roadmap.sh' /> <meta property='og:url' content={currentPageAbsoluteUrl} />
<link rel='canonical' href={currentPageAbsoluteUrl} />
<meta name='mobile-web-app-capable' content='yes' /> <meta name='mobile-web-app-capable' content='yes' />
<meta name='apple-mobile-web-app-capable' content='yes' /> <meta name='apple-mobile-web-app-capable' content='yes' />

@ -3,7 +3,7 @@ import Icon from '../components/Icon.astro';
import BaseLayout from '../layouts/BaseLayout.astro'; import BaseLayout from '../layouts/BaseLayout.astro';
--- ---
<BaseLayout title='Page not found'> <BaseLayout title='Page not found' permalink={'/404/'}>
<div class='bg-gray-100'> <div class='bg-gray-100'>
<div <div
class='py-10 md:py-32 container flex flex-col md:flex-row items-center justify-center gap-7 ' class='py-10 md:py-32 container flex flex-col md:flex-row items-center justify-center gap-7 '

@ -15,16 +15,24 @@ export async function getStaticPaths() {
} }
const { topicId } = Astro.params; const { topicId } = Astro.params;
const { file, breadcrumbs, roadmapId, roadmap, heading } = Astro.props as TopicFileType; const { file, breadcrumbs, roadmapId, roadmap, heading } =
Astro.props as TopicFileType;
--- ---
<BaseLayout title={`${heading} - roadmap.sh`} description={`Free resources to learn ${heading} in ${roadmap.featuredTitle}. Everything you need to know about ${heading} and how it realtes to ${roadmap.featuredTitle}.`} noIndex={true}> <BaseLayout
title={`${heading} - roadmap.sh`}
description={`Free resources to learn ${heading} in ${roadmap.featuredTitle}. Everything you need to know about ${heading} and how it realtes to ${roadmap.featuredTitle}.`}
noIndex={true}
permalink={`/${topicId}/`}
>
<RoadmapBanner roadmapId={roadmapId} roadmap={roadmap} /> <RoadmapBanner roadmapId={roadmapId} roadmap={roadmap} />
<div class="bg-gray-50"> <div class='bg-gray-50'>
<Breadcrumbs breadcrumbs={breadcrumbs} roadmapId={roadmapId} /> <Breadcrumbs breadcrumbs={breadcrumbs} roadmapId={roadmapId} />
<div class="container pb-16 prose prose-p:mt-0 prose-h1:mb-4 prose-h2:mb-3 prose-h2:mt-0"> <div
<main id="main-content"> class='container pb-16 prose prose-p:mt-0 prose-h1:mb-4 prose-h2:mb-3 prose-h2:mt-0'
>
<main id='main-content'>
<file.Content /> <file.Content />
</main> </main>
</div> </div>

@ -25,6 +25,7 @@ const roadmapData = roadmapFile.frontmatter as RoadmapFrontmatter;
--- ---
<BaseLayout <BaseLayout
permalink={`/${roadmapId}/`}
title={roadmapData?.seo?.title} title={roadmapData?.seo?.title}
description={roadmapData.seo.description} description={roadmapData.seo.description}
keywords={roadmapData.seo.keywords} keywords={roadmapData.seo.keywords}

@ -22,7 +22,12 @@ const roadmapFile = await import(`../../roadmaps/${roadmapId}/${roadmapId}.md`);
const roadmapData = roadmapFile.frontmatter as RoadmapFrontmatter; const roadmapData = roadmapFile.frontmatter as RoadmapFrontmatter;
--- ---
<BaseLayout title={`${roadmapData.title} Topics`} description={roadmapData.seo.description} keywords={roadmapData.seo.keywords}> <BaseLayout
title={`${roadmapData.title} Topics`}
description={roadmapData.seo.description}
keywords={roadmapData.seo.keywords}
permalink={`/${roadmapId}/topics/`}
>
<RoadmapHeader <RoadmapHeader
description={roadmapData.description} description={roadmapData.description}
title={`${roadmapData.featuredTitle} Topics`} title={`${roadmapData.featuredTitle} Topics`}
@ -31,8 +36,8 @@ const roadmapData = roadmapFile.frontmatter as RoadmapFrontmatter;
hasTopics={false} hasTopics={false}
/> />
<div class="bg-gray-50 pt-5 pb-8 sm:pt-10 sm:pb-16"> <div class='bg-gray-50 pt-5 pb-8 sm:pt-10 sm:pb-16'>
<div class="container"> <div class='container'>
{ {
topics.map((topic) => { topics.map((topic) => {
// Breadcrumbs have three additional items e.g. // Breadcrumbs have three additional items e.g.

@ -2,7 +2,7 @@
import BaseLayout from '../layouts/BaseLayout.astro'; import BaseLayout from '../layouts/BaseLayout.astro';
--- ---
<BaseLayout title='About roadmap.sh'> <BaseLayout title='About roadmap.sh' permalink={'/about/'}>
<div class='bg-white border-b pt-7 pb-7 sm:pt-12 sm:pb-10'> <div class='bg-white border-b pt-7 pb-7 sm:pt-12 sm:pb-10'>
<div class='container'> <div class='container'>
<div class='flex items-center'> <div class='flex items-center'>

@ -22,7 +22,11 @@ const { guide } = Astro.props;
const { frontmatter: guideData } = guide; const { frontmatter: guideData } = guide;
--- ---
<BaseLayout title={guideData.seo.title} description={guideData.seo.description}> <BaseLayout
title={guideData.seo.title}
description={guideData.seo.description}
permalink={`/guides/${guideId}/`}
>
<GuideHeader guide={guide} /> <GuideHeader guide={guide} />
<div class='bg-gray-50 py-5 sm:py-10'> <div class='bg-gray-50 py-5 sm:py-10'>

@ -7,7 +7,11 @@ import { getAllGuides } from '../../lib/guide';
const guides = await getAllGuides(); const guides = await getAllGuides();
--- ---
<BaseLayout title='Guides - roadmap.sh' description={'Detailed guides on Software Engineering Topics'}> <BaseLayout
title='Guides - roadmap.sh'
description={'Detailed guides on Software Engineering Topics'}
permalink={`/guides/`}
>
<SimplePageHeader <SimplePageHeader
title='Guides' title='Guides'
description='Succinct graphical explanations to engineering topics.' description='Succinct graphical explanations to engineering topics.'

@ -13,7 +13,7 @@ const guides = await getAllGuides();
const videos = await getAllVideos(); const videos = await getAllVideos();
--- ---
<BaseLayout title='Developer Roadmaps' description={"Community driven roadmaps, articles and guides for developers to grow in their career."}> <BaseLayout title='Developer Roadmaps' description={"Community driven roadmaps, articles and guides for developers to grow in their career."} permalink={'/'}>
<div class='bg-gradient-to-b from-slate-900 to-black'> <div class='bg-gradient-to-b from-slate-900 to-black'>
<div class='border-b border-b-slate-900'> <div class='border-b border-b-slate-900'>
<div <div

@ -15,6 +15,7 @@ Here is the list of PDF links for each of the roadmaps.
* **QA Roadmap** - [Roadmap Link](https://roadmap.sh/qa) / [PDF Link](https://roadmap.sh/pdfs/qa.pdf) * **QA Roadmap** - [Roadmap Link](https://roadmap.sh/qa) / [PDF Link](https://roadmap.sh/pdfs/qa.pdf)
* **ASP.NET Core Roadmap** - [Roadmap Link](https://roadmap.sh/aspnet-core) / [PDF Link](https://roadmap.sh/pdfs/aspnet-core.pdf) * **ASP.NET Core Roadmap** - [Roadmap Link](https://roadmap.sh/aspnet-core) / [PDF Link](https://roadmap.sh/pdfs/aspnet-core.pdf)
* **Flutter Roadmap** - [Roadmap Link](https://roadmap.sh/flutter) / [PDF Link](https://roadmap.sh/pdfs/flutter.pdf) * **Flutter Roadmap** - [Roadmap Link](https://roadmap.sh/flutter) / [PDF Link](https://roadmap.sh/pdfs/flutter.pdf)
* **Go Roadmap** - [Roadmap Link](https://roadmap.sh/golang) / [PDF Link](https://roadmap.sh/pdfs/golang.pdf)
* **Software Architect Roadmap** - [Roadmap Link](https://roadmap.sh/software-architect) / [PDF Link](https://roadmap.sh/pdfs/software-architect.pdf) * **Software Architect Roadmap** - [Roadmap Link](https://roadmap.sh/software-architect) / [PDF Link](https://roadmap.sh/pdfs/software-architect.pdf)
* **Software Design and Architecture Roadmap** - [Roadmap Link](https://roadmap.sh/software-design-architecture) / [PDF Link](https://roadmap.sh/pdfs/software-design-architecture.pdf) * **Software Design and Architecture Roadmap** - [Roadmap Link](https://roadmap.sh/software-design-architecture) / [PDF Link](https://roadmap.sh/pdfs/software-design-architecture.pdf)
* **JavaScript Roadmap** - [Roadmap Link](https://roadmap.sh/javascript) / [PDF Link](https://roadmap.sh/pdfs/javascript.pdf) * **JavaScript Roadmap** - [Roadmap Link](https://roadmap.sh/javascript) / [PDF Link](https://roadmap.sh/pdfs/javascript.pdf)

@ -1,6 +1,7 @@
--- ---
layout: ../layouts/MarkdownLayout.astro layout: ../layouts/MarkdownLayout.astro
title: Privacy Policy - roadmap.sh title: Privacy Policy - roadmap.sh
noIndex: true
--- ---
# Privacy Policy # Privacy Policy

@ -8,16 +8,20 @@ const roleRoadmaps = await getRoadmapsByTag('role-roadmap');
const skillRoadmaps = await getRoadmapsByTag('skill-roadmap'); const skillRoadmaps = await getRoadmapsByTag('skill-roadmap');
--- ---
<BaseLayout title="Developer Roadmaps" description={"Step by step guides and paths to learn different tools or technologies"}> <BaseLayout
title='Developer Roadmaps'
description={'Step by step guides and paths to learn different tools or technologies'}
permalink={'/roadmaps/'}
>
<SimplePageHeader <SimplePageHeader
title="Developer Roadmaps" title='Developer Roadmaps'
description="Step by step guides and paths to learn different tools or technologies" description='Step by step guides and paths to learn different tools or technologies'
showYouTubeAlert={true} showYouTubeAlert={true}
/> />
<div class="bg-gray-100 pt-4 pb-14 sm:pt-8 sm:pb-16"> <div class='bg-gray-100 pt-4 pb-14 sm:pt-8 sm:pb-16'>
<div class="container"> <div class='container'>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-0.5 sm:gap-3"> <div class='grid grid-cols-1 sm:grid-cols-2 gap-0.5 sm:gap-3'>
{ {
roleRoadmaps.map((roleRoadmap) => ( roleRoadmaps.map((roleRoadmap) => (
<GridRoadmapItem roadmap={roleRoadmap} /> <GridRoadmapItem roadmap={roleRoadmap} />

@ -7,6 +7,7 @@ import BaseLayout from '../layouts/BaseLayout.astro';
<BaseLayout <BaseLayout
title='Signup - roadmap.sh' title='Signup - roadmap.sh'
description='Register yourself to receive occasional emails about new roadmaps, updates, guides and videos' description='Register yourself to receive occasional emails about new roadmaps, updates, guides and videos'
permalink={'/signup/'}
> >
<div class='container'> <div class='container'>
<div <div

@ -1,6 +1,7 @@
--- ---
layout: ../layouts/MarkdownLayout.astro layout: ../layouts/MarkdownLayout.astro
title: Terms and Conditions - roadmap.sh title: Terms and Conditions - roadmap.sh
noIndex: true
--- ---
# Terms of Service # Terms of Service

@ -24,6 +24,7 @@ const { video } = Astro.props;
<BaseLayout <BaseLayout
title={video.frontmatter.title} title={video.frontmatter.title}
description={video.frontmatter.description} description={video.frontmatter.description}
permalink={`/videos/${videoId}/`}
> >
<VideoHeader video={video} /> <VideoHeader video={video} />

@ -10,6 +10,7 @@ const videos = await getAllVideos();
<BaseLayout <BaseLayout
title='Illustrated Videos - roadmap.sh' title='Illustrated Videos - roadmap.sh'
description={'Graphical video demonstrations on software engineering topics.'} description={'Graphical video demonstrations on software engineering topics.'}
permalink={`/videos/`}
> >
<SimplePageHeader <SimplePageHeader
title='Videos' title='Videos'

Loading…
Cancel
Save