1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-08-13 12:43:59 +02:00

Update event labels for sponsor links

This commit is contained in:
Kamran Ahmed
2023-03-01 23:04:32 +00:00
parent d08887060f
commit 60b1edcab9
7 changed files with 20 additions and 20 deletions

View File

@@ -51,10 +51,12 @@ function populateRoadmapAds({
const existingFrontmatter = roadmapFileContent.match(frontMatterRegex)[1];
const contentWithoutFrontmatter = roadmapFileContent.replace(frontMatterRegex, ``).trim();
let fronmatterObj = yaml.load(existingFrontmatter);
let frontmatterObj = yaml.load(existingFrontmatter);
delete frontmatterObj.sponsor;
if (shouldShowAd) {
const frontmatterValues = Object.entries(fronmatterObj);
const frontmatterValues = Object.entries(frontmatterObj);
const roadmapLabel = frontmatterObj.briefTitle;
// Insert sponsor data at 10 index i.e. after
// roadmap dimensions in the fronmatter
@@ -68,17 +70,15 @@ function populateRoadmapAds({
event: {
category: 'SponsorClick',
action: `${company} Redirect`,
label: `Clicked ${company} Link`,
label: `${roadmapLabel} / ${company} Link`,
},
},
]);
fronmatterObj = Object.fromEntries(frontmatterValues);
} else {
delete fronmatterObj.sponsor;
frontmatterObj = Object.fromEntries(frontmatterValues);
}
const newFrontmatter = yaml.dump(fronmatterObj, { lineWidth: 10000, forceQuotes: true, quotingType: '"' });
const newFrontmatter = yaml.dump(frontmatterObj, { lineWidth: 10000, forceQuotes: true, quotingType: '"' });
const newContent = `---\n${newFrontmatter}---\n\n${contentWithoutFrontmatter}`;
fs.writeFileSync(roadmapFilePath, newContent, 'utf8');

View File

@@ -19,7 +19,7 @@ sponsor:
event:
category: "SponsorClick"
action: "Fermyon Redirect"
label: "Clicked Fermyon Link"
label: "Backend / Fermyon Link"
schema:
headline: "Backend Developer Roadmap"
description: "Learn how to become a Backend Developer with this interactive step by step guide in 2023. We also have resources and short descriptions attached to the roadmap items so you can get everything you want to learn in one place."

View File

@@ -19,7 +19,7 @@ sponsor:
event:
category: "SponsorClick"
action: "Ambassador Redirect"
label: "Clicked Ambassador Link"
label: "DevOps / Ambassador Link"
schema:
headline: "DevOps Roadmap"
description: "Learn to become a DevOps, SRE or get any other operations role with this interactive step by step guide in 2023. We also have resources and short descriptions attached to the roadmap items so you can get everything you want to learn in one place."

View File

@@ -19,7 +19,7 @@ sponsor:
event:
category: "SponsorClick"
action: "Apollo Redirect"
label: "Clicked Apollo Link"
label: "GraphQL / Apollo Link"
schema:
headline: "GraphQL Roadmap"
description: "Learn how to use GraphQL with this interactive step by step guide in 2023. We also have resources and short descriptions attached to the roadmap items so you can get everything you want to learn in one place."

View File

@@ -19,7 +19,7 @@ sponsor:
event:
category: "SponsorClick"
action: "Fermyon Redirect"
label: "Clicked Fermyon Link"
label: "JavaScript / Fermyon Link"
schema:
headline: "JavaScript Roadmap"
description: "Learn JavaScript with this interactive step by step guide in 2023. We also have resources and short descriptions attached to the roadmap items so you can get everything you want to learn in one place."

View File

@@ -10,6 +10,12 @@ hasTopics: true
dimensions:
width: 992
height: 1259.03
schema:
headline: "Python Roadmap"
description: "Learn Python with this interactive step by step guide in 2023. We also have resources and short descriptions attached to the roadmap items so you can get everything you want to learn in one place."
imageUrl: "https://roadmap.sh/roadmaps/python.png"
datePublished: "2023-01-05"
dateModified: "2023-01-20"
sponsor:
url: "https://www.fermyon.com/spin?utm_source=python&utm_medium=banner&utm_campaign=roadmap-sh"
title: "Serverless Python Apps"
@@ -18,13 +24,7 @@ sponsor:
event:
category: "SponsorClick"
action: "Fermyon Redirect"
label: "Clicked Fermyon Link"
schema:
headline: "Python Roadmap"
description: "Learn Python with this interactive step by step guide in 2023. We also have resources and short descriptions attached to the roadmap items so you can get everything you want to learn in one place."
imageUrl: "https://roadmap.sh/roadmaps/python.png"
datePublished: "2023-01-05"
dateModified: "2023-01-20"
label: "Python / Fermyon Link"
seo:
title: "Learn to become a modern Python developer"
description: "Community driven, articles, resources, guides, interview questions, quizzes for python development. Learn to become a modern Python developer by following the steps, skills, resources and guides listed in this roadmap."

View File

@@ -19,7 +19,7 @@ sponsor:
event:
category: "SponsorClick"
action: "Apollo Redirect"
label: "Clicked Apollo Link"
label: "Design and Architecture / Apollo Link"
schema:
headline: "Software Design and Architecture Roadmap"
description: "Learn Software Design and Architecture with this interactive step by step guide in 2023. We also have resources and short descriptions attached to the roadmap items so you can get everything you want to learn in one place."