Update event labels for sponsor links

pull/3518/head
Kamran Ahmed 2 years ago
parent d08887060f
commit 60b1edcab9
  1. 16
      bin/update-sponsors.cjs
  2. 2
      src/data/roadmaps/backend/backend.md
  3. 2
      src/data/roadmaps/devops/devops.md
  4. 2
      src/data/roadmaps/graphql/graphql.md
  5. 2
      src/data/roadmaps/javascript/javascript.md
  6. 14
      src/data/roadmaps/python/python.md
  7. 2
      src/data/roadmaps/software-design-architecture/software-design-architecture.md

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

@ -19,7 +19,7 @@ sponsor:
event: event:
category: "SponsorClick" category: "SponsorClick"
action: "Fermyon Redirect" action: "Fermyon Redirect"
label: "Clicked Fermyon Link" label: "Backend / Fermyon Link"
schema: schema:
headline: "Backend Developer Roadmap" 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." 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."

@ -19,7 +19,7 @@ sponsor:
event: event:
category: "SponsorClick" category: "SponsorClick"
action: "Ambassador Redirect" action: "Ambassador Redirect"
label: "Clicked Ambassador Link" label: "DevOps / Ambassador Link"
schema: schema:
headline: "DevOps Roadmap" 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." 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."

@ -19,7 +19,7 @@ sponsor:
event: event:
category: "SponsorClick" category: "SponsorClick"
action: "Apollo Redirect" action: "Apollo Redirect"
label: "Clicked Apollo Link" label: "GraphQL / Apollo Link"
schema: schema:
headline: "GraphQL Roadmap" 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." 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."

@ -19,7 +19,7 @@ sponsor:
event: event:
category: "SponsorClick" category: "SponsorClick"
action: "Fermyon Redirect" action: "Fermyon Redirect"
label: "Clicked Fermyon Link" label: "JavaScript / Fermyon Link"
schema: schema:
headline: "JavaScript Roadmap" 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." 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."

@ -10,6 +10,12 @@ hasTopics: true
dimensions: dimensions:
width: 992 width: 992
height: 1259.03 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: sponsor:
url: "https://www.fermyon.com/spin?utm_source=python&utm_medium=banner&utm_campaign=roadmap-sh" url: "https://www.fermyon.com/spin?utm_source=python&utm_medium=banner&utm_campaign=roadmap-sh"
title: "Serverless Python Apps" title: "Serverless Python Apps"
@ -18,13 +24,7 @@ sponsor:
event: event:
category: "SponsorClick" category: "SponsorClick"
action: "Fermyon Redirect" action: "Fermyon Redirect"
label: "Clicked Fermyon Link" label: "Python / 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"
seo: seo:
title: "Learn to become a modern Python developer" 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." 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."

@ -19,7 +19,7 @@ sponsor:
event: event:
category: "SponsorClick" category: "SponsorClick"
action: "Apollo Redirect" action: "Apollo Redirect"
label: "Clicked Apollo Link" label: "Design and Architecture / Apollo Link"
schema: schema:
headline: "Software Design and Architecture Roadmap" 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." 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."

Loading…
Cancel
Save