diff --git a/bin/update-sponsors.cjs b/bin/update-sponsors.cjs index 9d80d1baa..83dfcc526 100644 --- a/bin/update-sponsors.cjs +++ b/bin/update-sponsors.cjs @@ -13,7 +13,42 @@ if (!apiKey || !sheetId) { const sheetRange = 'A3:I1001'; const sheetUrl = `https://sheets.googleapis.com/v4/spreadsheets/${sheetId}/values/${sheetRange}?key=${apiKey}`; -function populatePageAds({ +function removeAllSponsors(baseContentDir) { + console.log('------------------------'); + console.log('Removing sponsors from: ', baseContentDir); + console.log('------------------------'); + const dataDirPath = path.join(__dirname, '../src/data'); + const contentDirPath = path.join(dataDirPath, baseContentDir); + + const contentDir = fs.readdirSync(contentDirPath); + contentDir.forEach((content) => { + console.log('Removing sponsor from: ', content); + + const pageFilePath = path.join(contentDirPath, content, `${content}.md`); + const pageFileContent = fs.readFileSync(pageFilePath, 'utf8'); + + const frontMatterRegex = /---\n([\s\S]*?)\n---/; + + const existingFrontmatter = pageFileContent.match(frontMatterRegex)[1]; + const contentWithoutFrontmatter = pageFileContent + .replace(frontMatterRegex, ``) + .trim(); + + let frontmatterObj = yaml.load(existingFrontmatter); + delete frontmatterObj.sponsor; + + const newFrontmatter = yaml.dump(frontmatterObj, { + lineWidth: 10000, + forceQuotes: true, + quotingType: "'", + }); + const newContent = `---\n${newFrontmatter}---\n${contentWithoutFrontmatter}`; + + fs.writeFileSync(pageFilePath, newContent, 'utf8'); + }); +} + +function addPageSponsor({ pageUrl, company, redirectUrl, @@ -24,13 +59,6 @@ function populatePageAds({ endDate, isActive, }) { - const isConfiguredActive = isActive.toLowerCase() === 'yes'; - - const currentDate = new Date(); - const isDateInRange = - currentDate >= new Date(startDate) && currentDate <= new Date(endDate); - const shouldShowAd = isConfiguredActive && isDateInRange; - const urlPart = pageUrl .replace('https://roadmap.sh/', '') .replace(/\?.+?$/, ''); @@ -64,29 +92,27 @@ function populatePageAds({ let frontmatterObj = yaml.load(existingFrontmatter); delete frontmatterObj.sponsor; - if (shouldShowAd) { - const frontmatterValues = Object.entries(frontmatterObj); - const roadmapLabel = frontmatterObj.briefTitle; + const frontmatterValues = Object.entries(frontmatterObj); + const roadmapLabel = frontmatterObj.briefTitle; - // Insert sponsor data at 10 index i.e. after - // roadmap dimensions in the frontmatter - frontmatterValues.splice(10, 0, [ - 'sponsor', - { - url: redirectUrl, - title: adTitle, - imageUrl, - description: adDescription, - event: { - category: 'SponsorClick', - action: `${company} Redirect`, - label: `${roadmapLabel} / ${company} Link`, - }, + // Insert sponsor data at 10 index i.e. after + // roadmap dimensions in the frontmatter + frontmatterValues.splice(10, 0, [ + 'sponsor', + { + url: redirectUrl, + title: adTitle, + imageUrl, + description: adDescription, + event: { + category: 'SponsorClick', + action: `${company} Redirect`, + label: `${roadmapLabel} / ${company} Link`, }, - ]); + }, + ]); - frontmatterObj = Object.fromEntries(frontmatterValues); - } + frontmatterObj = Object.fromEntries(frontmatterValues); const newFrontmatter = yaml.dump(frontmatterObj, { lineWidth: 10000, @@ -98,6 +124,10 @@ function populatePageAds({ fs.writeFileSync(pageFilePath, newContent, 'utf8'); } +// Remove sponsors from all roadmaps +removeAllSponsors('roadmaps'); +removeAllSponsors('best-practices'); + fetch(sheetUrl) .then((res) => res.json()) .then((rawData) => { @@ -117,7 +147,15 @@ fetch(sheetUrl) isActive, ] = row; - populatePageAds({ + const isConfiguredActive = isActive?.toLowerCase() === 'yes'; + const currentDate = new Date(); + const isDateInRange = currentDate >= new Date(startDate) && currentDate <= new Date(endDate); + + if (!isConfiguredActive || !isDateInRange) { + return; + } + + addPageSponsor({ pageUrl, company, redirectUrl, diff --git a/src/data/best-practices/frontend-performance/frontend-performance.md b/src/data/best-practices/frontend-performance/frontend-performance.md index dfe17ccfc..71d0bd638 100644 --- a/src/data/best-practices/frontend-performance/frontend-performance.md +++ b/src/data/best-practices/frontend-performance/frontend-performance.md @@ -11,6 +11,15 @@ description: 'Detailed list of best practices to improve your frontend performan dimensions: width: 968 height: 1270.89 +sponsor: + url: 'https://info.honeycomb.io/observability-engineering-oreilly-book-2022?utm_medium=paid-sponsorship&utm_source=insight-partners&utm_campaign=plg_insightpartners_paidsponsorship' + title: 'Free eBook' + imageUrl: 'https://i.imgur.com/zS1FMNo.jpg' + description: 'Get this ebook to start your observability journey for quicker debugging & more time to innovate.' + event: + category: 'SponsorClick' + action: 'Honeycomb Redirect' + label: 'Frontend Performance / Honeycomb Link' schema: headline: 'Frontend Performance Best Practices' description: 'Detailed list of best practices to improve the frontend performance of your website. Each best practice carries further details and how to implement that best practice.' @@ -27,3 +36,4 @@ seo: - 'frontend checklist' - 'make performant frontends' --- + diff --git a/src/data/roadmaps/android/android.md b/src/data/roadmaps/android/android.md index b08ff4b85..a4b2e4ae3 100644 --- a/src/data/roadmaps/android/android.md +++ b/src/data/roadmaps/android/android.md @@ -1,5 +1,4 @@ --- -# jsonUrl: "/jsons/roadmaps/android.json" pdfUrl: '/pdfs/roadmaps/android.pdf' order: 4 briefTitle: 'Android' @@ -41,7 +40,6 @@ tags: - 'main-sitemap' - 'role-roadmap' --- - The intent of this guide is to give you an idea about the Android development landscape and to help guide your learning if you are confused. Before we start, please note that the roadmap is opinionated, and you might have different opinions than those of the author. Having said that, [we would love to hear your opinions](https://github.com/kamranahmedse/developer-roadmap/issues/new) and incorporate them in the roadmap if suitable. There are multiple ways to develop applications for Android; you can go down the path of hybrid application development where [Flutter](https://flutter.dev/), [React-Native](https://reactnative.dev/), or [NativeScript](https://www.nativescript.org/) are the most common contenders. Flutter uses Dart, whereas React Native and Native Script rely on JavaScript. Answering the question of hybrid vs native is out of the scope of this roadmap. This roadmap is focused on native Android app development, but if you are interested in learning any hybrid framework, my personal preference is [React-Native](https://reactnative.dev) and I would recommend you check out the [Frontend Developer Roadmap](/frontend). @@ -142,4 +140,4 @@ For any suggestions, improvements and feedback, feel free to [submit an issue](h -


+


\ No newline at end of file diff --git a/src/data/roadmaps/aspnet-core/aspnet-core.md b/src/data/roadmaps/aspnet-core/aspnet-core.md index b79375fef..4f4a2fac6 100644 --- a/src/data/roadmaps/aspnet-core/aspnet-core.md +++ b/src/data/roadmaps/aspnet-core/aspnet-core.md @@ -11,6 +11,15 @@ hasTopics: true dimensions: width: 968 height: 2773.45 +sponsor: + url: 'https://www.honeycomb.io/resources/intercom-accelerates-developer-productivity?utm_medium=paid-sponsorship&utm_source=insight-partners&utm_campaign=plg_insightpartners_paidsponsorship' + title: 'Observability Boosts Dev' + imageUrl: 'https://i.imgur.com/cEt0VAH.jpg' + description: 'Learn how Intercom leveraged observability for developer productivity, delivering better outcomes.' + event: + category: 'SponsorClick' + action: 'Honeycomb Redirect' + label: 'ASP.NET Core / Honeycomb Link' schema: headline: 'ASP.NET Core Developer Roadmap' description: 'Learn how to become a ASP.NET Core 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.' @@ -59,3 +68,4 @@ tags: - 'main-sitemap' - 'role-roadmap' --- + diff --git a/src/data/roadmaps/frontend/frontend.md b/src/data/roadmaps/frontend/frontend.md index d7afe65ea..37f0ff26e 100644 --- a/src/data/roadmaps/frontend/frontend.md +++ b/src/data/roadmaps/frontend/frontend.md @@ -11,6 +11,15 @@ tnsBannerLink: 'https://thenewstack.io?utm_source=roadmap.sh&utm_medium=Referral dimensions: width: 968 height: 2822.1 +sponsor: + url: 'https://info.honeycomb.io/observability-engineering-oreilly-book-2022?utm_medium=paid-sponsorship&utm_source=insight-partners&utm_campaign=plg_insightpartners_paidsponsorship' + title: 'Free eBook' + imageUrl: 'https://i.imgur.com/zS1FMNo.jpg' + description: 'Get this ebook to start your observability journey for quicker debugging & more time to innovate.' + event: + category: 'SponsorClick' + action: 'Honeycomb Redirect' + label: 'Frontend / Honeycomb Link' schema: headline: 'Frontend Developer Roadmap' description: 'Learn how to become a Frontend 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.' diff --git a/src/data/roadmaps/golang/golang.md b/src/data/roadmaps/golang/golang.md index 5048248b4..581af3fb3 100644 --- a/src/data/roadmaps/golang/golang.md +++ b/src/data/roadmaps/golang/golang.md @@ -16,6 +16,15 @@ schema: imageUrl: 'https://roadmap.sh/roadmaps/golang.png' datePublished: '2023-01-05' dateModified: '2023-01-20' +sponsor: + url: 'https://www.honeycomb.io/blog/how-we-define-sre-work-as-team?utm_medium=paid-sponsorship&utm_source=insight-partners&utm_campaign=plg_insightpartners_paidsponsorship' + title: 'Day in the Life of an SRE' + imageUrl: 'https://i.imgur.com/xANWBZQ.jpg' + description: 'Dive into the world of SRE work to better understand an SRE’s role in driving incident response.' + event: + category: 'SponsorClick' + action: 'Honeycomb Redirect' + label: 'Go / Honeycomb Link' seo: title: 'Learn to become a Go developer' description: 'Community driven, articles, resources, guides, interview questions, quizzes for Go development. Learn to become a modern Go developer by following the steps, skills, resources and guides listed in this roadmap.' @@ -56,3 +65,4 @@ tags: - 'main-sitemap' - 'skill-roadmap' --- + diff --git a/src/data/roadmaps/java/java.md b/src/data/roadmaps/java/java.md index cfa55afd5..a907733f9 100644 --- a/src/data/roadmaps/java/java.md +++ b/src/data/roadmaps/java/java.md @@ -16,6 +16,15 @@ schema: imageUrl: 'https://roadmap.sh/roadmaps/java.png' datePublished: '2023-01-05' dateModified: '2023-01-20' +sponsor: + url: 'https://www.honeycomb.io/resources/platform-engineering-is-the-future-of-ops-thanks?utm_medium=paid-sponsorship&utm_source=insight-partners&utm_campaign=plg_insightpartners_paidsponsorship' + title: 'DevOps vs. Platform Ops' + imageUrl: 'https://i.imgur.com/kI8YCAA.jpg' + description: 'Explore the role of DevOps as platform engineering rises in the software development field.' + event: + category: 'SponsorClick' + action: 'Honeycomb Redirect' + label: 'Java / Honeycomb Link' seo: title: 'Learn to become a modern Java developer' description: 'Community driven, articles, resources, guides, interview questions, quizzes for java development. Learn to become a modern Java developer by following the steps, skills, resources and guides listed in this roadmap.' @@ -56,3 +65,4 @@ tags: - 'main-sitemap' - 'skill-roadmap' --- + diff --git a/src/data/roadmaps/javascript/javascript.md b/src/data/roadmaps/javascript/javascript.md index 3e756aa8d..010c42e34 100644 --- a/src/data/roadmaps/javascript/javascript.md +++ b/src/data/roadmaps/javascript/javascript.md @@ -53,4 +53,3 @@ tags: - 'main-sitemap' - 'skill-roadmap' --- - diff --git a/src/data/roadmaps/kubernetes/kubernetes.md b/src/data/roadmaps/kubernetes/kubernetes.md index d3d4aaaf7..26330530a 100644 --- a/src/data/roadmaps/kubernetes/kubernetes.md +++ b/src/data/roadmaps/kubernetes/kubernetes.md @@ -53,4 +53,3 @@ tags: - 'main-sitemap' - 'skill-roadmap' --- - diff --git a/src/data/roadmaps/nodejs/nodejs.md b/src/data/roadmaps/nodejs/nodejs.md index ce73100fb..f8e45aa79 100644 --- a/src/data/roadmaps/nodejs/nodejs.md +++ b/src/data/roadmaps/nodejs/nodejs.md @@ -11,6 +11,15 @@ hasTopics: true dimensions: width: 968 height: 2474.06 +sponsor: + url: 'https://www.honeycomb.io/blog/building-platform-team?utm_medium=paid-sponsorship&utm_source=insight-partners&utm_campaign=plg_insightpartners_paidsponsorship' + title: 'How to Lead a Platform Team' + imageUrl: 'https://i.imgur.com/XG7MEWs.jpg' + description: 'Master building & executing a top-performing platform engineering team with this guide.' + event: + category: 'SponsorClick' + action: 'Honeycomb Redirect' + label: 'Node.js / Honeycomb Link' schema: headline: 'Node.js Roadmap' description: 'Learn Node.js 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.' diff --git a/src/data/roadmaps/postgresql-dba/postgresql-dba.md b/src/data/roadmaps/postgresql-dba/postgresql-dba.md index 157590b4f..a08bfb604 100644 --- a/src/data/roadmaps/postgresql-dba/postgresql-dba.md +++ b/src/data/roadmaps/postgresql-dba/postgresql-dba.md @@ -39,7 +39,6 @@ tags: - 'main-sitemap' - 'role-roadmap' --- - The intent of this guide is to give you an idea about the DBA landscape and to help guide your learning if you are confused. The roadmap is highly opinionated — neither, knowing everything listed in the roadmap, nor the order of items given in the roadmap is required to be followed in order to be a DBA. ## Learn basic RDBMS terms and concepts @@ -238,4 +237,4 @@ Get involved to Postgres community and contribute to Postgres; be a useful membe - pgsql-hackers - pgsql-bugs - Reviewing patches -- Writing patches, attending in [Commitfests](https://commitfest.postgresql.org/) +- Writing patches, attending in [Commitfests](https://commitfest.postgresql.org/) \ No newline at end of file diff --git a/src/data/roadmaps/python/python.md b/src/data/roadmaps/python/python.md index 92ecd0575..4d00240c2 100644 --- a/src/data/roadmaps/python/python.md +++ b/src/data/roadmaps/python/python.md @@ -16,6 +16,15 @@ schema: imageUrl: 'https://roadmap.sh/roadmaps/python.png' datePublished: '2023-01-05' dateModified: '2023-01-20' +sponsor: + url: 'https://www.honeycomb.io/blog/how-we-define-sre-work-as-team?utm_medium=paid-sponsorship&utm_source=insight-partners&utm_campaign=plg_insightpartners_paidsponsorship' + title: 'Day in the Life of an SRE' + imageUrl: 'https://i.imgur.com/xANWBZQ.jpg' + description: 'Dive into the world of SRE work to better understand an SRE’s role in driving incident response.' + event: + category: 'SponsorClick' + action: 'Honeycomb Redirect' + label: 'Python / Honeycomb 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.' diff --git a/src/data/roadmaps/qa/qa.md b/src/data/roadmaps/qa/qa.md index a35ebfc3c..c289398fb 100644 --- a/src/data/roadmaps/qa/qa.md +++ b/src/data/roadmaps/qa/qa.md @@ -11,6 +11,15 @@ hasTopics: true dimensions: width: 968 height: 2107.75 +sponsor: + url: 'https://info.honeycomb.io/observability-engineering-oreilly-book-2022?utm_medium=paid-sponsorship&utm_source=insight-partners&utm_campaign=plg_insightpartners_paidsponsorship' + title: 'Free eBook' + imageUrl: 'https://i.imgur.com/zS1FMNo.jpg' + description: 'Get this ebook to start your observability journey for quicker debugging & more time to innovate.' + event: + category: 'SponsorClick' + action: 'Honeycomb Redirect' + label: 'QA / Honeycomb Link' schema: headline: 'QA Engineer Roadmap' description: 'Learn to become a QA Engineer 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.' @@ -47,3 +56,4 @@ tags: - 'main-sitemap' - 'role-roadmap' --- + diff --git a/src/data/roadmaps/react/react.md b/src/data/roadmaps/react/react.md index 597d012e4..9e21919af 100644 --- a/src/data/roadmaps/react/react.md +++ b/src/data/roadmaps/react/react.md @@ -48,4 +48,3 @@ tags: - 'main-sitemap' - 'skill-roadmap' --- - diff --git a/src/data/roadmaps/software-design-architecture/software-design-architecture.md b/src/data/roadmaps/software-design-architecture/software-design-architecture.md index 806724f7a..9caa5ad13 100644 --- a/src/data/roadmaps/software-design-architecture/software-design-architecture.md +++ b/src/data/roadmaps/software-design-architecture/software-design-architecture.md @@ -50,4 +50,3 @@ tags: - 'main-sitemap' - 'skill-roadmap' --- - diff --git a/src/data/roadmaps/spring-boot/spring-boot.md b/src/data/roadmaps/spring-boot/spring-boot.md index f8b64084d..17021935d 100644 --- a/src/data/roadmaps/spring-boot/spring-boot.md +++ b/src/data/roadmaps/spring-boot/spring-boot.md @@ -11,6 +11,15 @@ isNew: true dimensions: width: 968 height: 1245.52 +sponsor: + url: 'https://www.honeycomb.io/blog/an-engineering-managers-bill-of-rights-and-responsibilities?utm_medium=paid-sponsorship&utm_source=insight-partners&utm_campaign=plg_insightpartners_paidsponsorship' + title: 'Lead High-Impact Teams' + imageUrl: 'https://i.imgur.com/EBscW4C.jpg' + description: 'Learn what it takes to be a manager of a high-performance engineering team.' + event: + category: 'SponsorClick' + action: 'Honeycomb Redirect' + label: 'Spring Boot / Honeycomb Link' schema: headline: 'Spring Boot Roadmap' description: 'Learn Spring Boot 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.' @@ -56,3 +65,4 @@ tags: - 'main-sitemap' - 'skill-roadmap' --- +