forked from kamranahmedse/developer-roadmap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c3c552
commit 964a87f
Showing
17 changed files
with
241 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"author": "Kamran Ahmed", | ||
"title": "Roadmaps to becoming a modern developer", | ||
"name": "roadmap.sh", | ||
"description": "Community driven roadmaps, articles, guides, quizzes, tips and resources for developers to learn from, identify their career paths, know what they don't know, find out the knowledge gaps, learn and improve.", | ||
"twitter": "kamranahmedse", | ||
"facebook": "kamranahmedse", | ||
"logo": "/brand.png", | ||
"logoSquare": "/brand-square.png", | ||
"url": { | ||
"web": "https://roadmap.sh", | ||
"repo": "https://github.com/kamranahmedse/roadmap.sh", | ||
"repoData": "https://github.com/kamranahmedse/roadmap.sh/tree/master/content", | ||
"addGuide": "https://github.com/kamranahmedse/roadmap.sh/tree/master/contributing/guide.md", | ||
"addRoadmap": "https://github.com/kamranahmedse/roadmap.sh/tree/master/contributing/roadmap.md", | ||
"addResources": "https://github.com/kamranahmedse/roadmap.sh/tree/master/contributing/resources.md", | ||
"contribute": "https://github.com/kamranahmedse/roadmap.sh/tree/master/contributing", | ||
"issue": "https://github.com/kamranahmedse/roadmap.sh/issues/new" | ||
}, | ||
"keywords": [ | ||
"roadmap", | ||
"developer roadmaps", | ||
"developer roadmap", | ||
"frontend developer", | ||
"frontend developer roadmap", | ||
"frontend", | ||
"frontend roadmap", | ||
"backend", | ||
"backend developer", | ||
"backend developer roadmap", | ||
"devops", | ||
"devops roadmap", | ||
"fullstack developer roadmap", | ||
"guide to becoming a developer", | ||
"sre roadmap", | ||
"sre", | ||
"operations roadmap" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
declare global { | ||
interface Window { | ||
gtag: any; | ||
} | ||
} | ||
|
||
// https://developers.google.com/analytics/devguides/collection/gtagjs/pages | ||
export const firePageView = (url: string) => { | ||
if (!window.gtag) { | ||
console.warn('Missing GTAG – Analytics disabled'); | ||
return; | ||
} | ||
|
||
window.gtag('config', process.env.GA_SECRET, { | ||
page_path: url | ||
}); | ||
}; | ||
|
||
// https://developers.google.com/analytics/devguides/collection/gtagjs/events | ||
export const event = (props: { action: string; category: string; label: string; value: string; }) => { | ||
const { action, category, label, value } = props; | ||
if (!window.gtag) { | ||
console.warn('Missing GTAG – Analytics disabled'); | ||
return; | ||
} | ||
|
||
window.gtag( | ||
'event', | ||
action, | ||
{ | ||
event_category: category, | ||
event_label: label, | ||
value: value | ||
} | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { NextApiRequest } from 'next'; | ||
import roadmaps from '../content/roadmaps.json'; | ||
|
||
export type RoadmapType = { | ||
seo: { | ||
title: string; | ||
description: string; | ||
keywords: string[] | ||
}, | ||
title: string, | ||
description: string, | ||
featuredTitle: string; | ||
featuredDescription: string, | ||
author: { | ||
name: string, | ||
url: string | ||
}, | ||
featured: boolean, | ||
imagePath?: string, | ||
contentPath?: string; | ||
resourcesPath: string; | ||
isCommunity: boolean; | ||
url: string; | ||
}; | ||
|
||
export function getRequestedRoadmap(req: NextApiRequest): RoadmapType | undefined { | ||
// remove trailing slashes | ||
const normalizedUrl = req.url?.replace(/\/$/, '') || ''; | ||
|
||
return (roadmaps as RoadmapType[]).find(roadmap => normalizedUrl.startsWith(roadmap.url)); | ||
} | ||
|
||
export function getAllRoadmaps(): RoadmapType[] { | ||
return (roadmaps as RoadmapType[]); | ||
} | ||
|
||
export function getFeaturedRoadmaps(): RoadmapType[] { | ||
const roadmaps: RoadmapType[] = getAllRoadmaps(); | ||
|
||
return roadmaps.filter(roadmap => roadmap.featured); | ||
} |
Oops, something went wrong.