Roadmap author and contributors page

pull/1331/head
Kamran Ahmed 5 years ago
parent ce35a8112f
commit 129deed6a9
  1. 7
      components/detailed-roadmap/index.js
  2. 10
      scripts/roadmaps-meta.js
  3. 39
      storage/roadmaps.json
  4. 4
      storage/roadmaps/1-frontend/meta.json
  5. 6
      storage/roadmaps/2-backend/meta.json
  6. 6
      storage/roadmaps/3-devops/meta.json
  7. 6
      storage/roadmaps/4-fullstack/meta.json
  8. 6
      storage/roadmaps/5-qa/meta.json

@ -13,7 +13,8 @@ const DetailedRoadmap = ({ roadmap }) => {
const [menuActive, setMenuState] = useState(false); const [menuActive, setMenuState] = useState(false);
const { const {
sidebar = {}, sidebar = {},
page: currentPage = {} page: currentPage = {},
author = {}
} = roadmap; } = roadmap;
const roadmapPages = Object.keys(sidebar || {}).map(groupTitle => { const roadmapPages = Object.keys(sidebar || {}).map(groupTitle => {
@ -42,7 +43,9 @@ const DetailedRoadmap = ({ roadmap }) => {
<div className="container d-flex align-items-center flex-column flex-md-row"> <div className="container d-flex align-items-center flex-column flex-md-row">
<RoadmapMeta> <RoadmapMeta>
<h3>{ roadmap.title }</h3> <h3>{ roadmap.title }</h3>
<p>Roadmap contributed by <a href="#">Kamran Ahmed</a> and <a href="#">5 others</a></p> <p>
Roadmap contributed by <a href={ author.url } target="_blank">{ author.name }</a>
{ roadmap.contributorsCount > 1 && ` and <a href="${roadmap.contributorsUrl}">${roadmap.contributorsCount} others</a>`}</p>
</RoadmapMeta> </RoadmapMeta>
<ShareRoadmap className="mt-2 mt-md-0"> <ShareRoadmap className="mt-2 mt-md-0">
<ShareIcon href={ siteConfig.url.repo } target="_blank"> <ShareIcon href={ siteConfig.url.repo } target="_blank">

@ -1,5 +1,6 @@
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
const exec = require('child_process').execSync;
const STORAGE_PATH = path.join(__dirname, '../storage'); const STORAGE_PATH = path.join(__dirname, '../storage');
const ROADMAPS_PATH = path.join(__dirname, '../storage/roadmaps'); const ROADMAPS_PATH = path.join(__dirname, '../storage/roadmaps');
@ -13,6 +14,13 @@ const roadmapsMeta = roadmapDirs.reduce((metaAcc, roadmapDirName) => {
const roadmapDir = path.join(ROADMAPS_PATH, roadmapDirName); const roadmapDir = path.join(ROADMAPS_PATH, roadmapDirName);
const roadmapMeta = require(path.join(roadmapDir, 'meta.json')); const roadmapMeta = require(path.join(roadmapDir, 'meta.json'));
const contributors = exec(`git log --pretty=format:"%an%x09" ${roadmapDir} | uniq`)
.toString()
.split('\n')
.map(contributor => contributor.replace(/[\s\t]/g, ' ').trim()) || [];
const contributorNames = contributors.filter(contributor => !!contributor);
console.log(`----------------------------`); console.log(`----------------------------`);
console.log(`[#] Roadmap: ${roadmapMeta.title}`); console.log(`[#] Roadmap: ${roadmapMeta.title}`);
console.log(`[x] Generating sidebar`); console.log(`[x] Generating sidebar`);
@ -61,6 +69,8 @@ const roadmapsMeta = roadmapDirs.reduce((metaAcc, roadmapDirName) => {
...metaAcc, ...metaAcc,
{ {
...roadmapMeta, ...roadmapMeta,
contributorsCount: contributorNames.length,
contributorsUrl: `/${roadmapSlug}/contributors`,
url: `/${roadmapSlug}`, url: `/${roadmapSlug}`,
path: path.join(roadmapDir.replace(STORAGE_PATH, ''), '/summary.md'), path: path.join(roadmapDir.replace(STORAGE_PATH, ''), '/summary.md'),
sidebar, sidebar,

@ -1,8 +1,12 @@
[ [
{ {
"title": "Frontend Developer", "title": "Frontend Developer",
"description": "Roadmap to becoming a modern frontend developer", "description": "Step by step guide to becoming a modern frontend developer",
"featuredDescription": "Step by step guide to becoming a modern frontend developer in 2019", "featuredDescription": "Step by step guide to becoming a modern frontend developer in 2019",
"author": {
"name": "Kamran Ahmed",
"url": "https://twitter.com/kamranahmedse"
},
"featured": true, "featured": true,
"detailed": true, "detailed": true,
"versions": [ "versions": [
@ -10,9 +14,18 @@
"2018", "2018",
"2017" "2017"
], ],
"contributorsCount": 1,
"contributorsUrl": "/frontend/contributors",
"url": "/frontend", "url": "/frontend",
"path": "/roadmaps/1-frontend/summary.md", "path": "/roadmaps/1-frontend/summary.md",
"sidebar": { "sidebar": {
"_others": [
{
"url": "/frontend/contributors",
"title": "contributors",
"path": "/roadmaps/1-frontend/_others/contributors.md"
}
],
"landscape": [ "landscape": [
{ {
"url": "/frontend/junior", "url": "/frontend/junior",
@ -79,6 +92,12 @@
"description": "Step by step guide to becoming a modern backend developer", "description": "Step by step guide to becoming a modern backend developer",
"featuredDescription": "Step by step guide to becoming a modern backend developer in 2019", "featuredDescription": "Step by step guide to becoming a modern backend developer in 2019",
"featured": true, "featured": true,
"author": {
"name": "Kamran Ahmed",
"url": "https://twitter.com/kamranahmedse"
},
"contributorsCount": 1,
"contributorsUrl": "/backend/contributors",
"url": "/backend", "url": "/backend",
"path": "/roadmaps/2-backend/summary.md", "path": "/roadmaps/2-backend/summary.md",
"sidebar": { "sidebar": {
@ -111,6 +130,12 @@
"2018", "2018",
"2017" "2017"
], ],
"author": {
"name": "Kamran Ahmed",
"url": "https://twitter.com/kamranahmedse"
},
"contributorsCount": 1,
"contributorsUrl": "/devops/contributors",
"url": "/devops", "url": "/devops",
"path": "/roadmaps/3-devops/summary.md", "path": "/roadmaps/3-devops/summary.md",
"sidebar": { "sidebar": {
@ -138,6 +163,12 @@
"description": "Step by step guide to becoming a modern fullstack developer in 2019", "description": "Step by step guide to becoming a modern fullstack developer in 2019",
"featuredDescription": "Step by step guide to becoming a modern fullstack developer in 2019", "featuredDescription": "Step by step guide to becoming a modern fullstack developer in 2019",
"upcoming": true, "upcoming": true,
"author": {
"name": "Kamran Ahmed",
"url": "https://twitter.com/kamranahmedse"
},
"contributorsCount": 1,
"contributorsUrl": "/fullstack/contributors",
"url": "/fullstack", "url": "/fullstack",
"path": "/roadmaps/4-fullstack/summary.md", "path": "/roadmaps/4-fullstack/summary.md",
"sidebar": {} "sidebar": {}
@ -147,6 +178,12 @@
"description": "Steps to follow in order to become a modern QA Engineer in 2019", "description": "Steps to follow in order to become a modern QA Engineer in 2019",
"featuredDescription": "Step by step guide to becoming a modern QA Engineer in 2019", "featuredDescription": "Step by step guide to becoming a modern QA Engineer in 2019",
"upcoming": true, "upcoming": true,
"author": {
"name": "Anas Fitiani",
"url": "https://github.com/anas-qa"
},
"contributorsCount": 1,
"contributorsUrl": "/qa/contributors",
"url": "/qa", "url": "/qa",
"path": "/roadmaps/5-qa/summary.md", "path": "/roadmaps/5-qa/summary.md",
"sidebar": {} "sidebar": {}

@ -2,6 +2,10 @@
"title": "Frontend Developer", "title": "Frontend Developer",
"description": "Step by step guide to becoming a modern frontend developer", "description": "Step by step guide to becoming a modern frontend developer",
"featuredDescription": "Step by step guide to becoming a modern frontend developer in 2019", "featuredDescription": "Step by step guide to becoming a modern frontend developer in 2019",
"author": {
"name": "Kamran Ahmed",
"url": "https://twitter.com/kamranahmedse"
},
"featured": true, "featured": true,
"detailed": true, "detailed": true,
"versions": [ "versions": [

@ -2,5 +2,9 @@
"title": "Backend Developer", "title": "Backend Developer",
"description": "Step by step guide to becoming a modern backend developer", "description": "Step by step guide to becoming a modern backend developer",
"featuredDescription": "Step by step guide to becoming a modern backend developer in 2019", "featuredDescription": "Step by step guide to becoming a modern backend developer in 2019",
"featured": true "featured": true,
"author": {
"name": "Kamran Ahmed",
"url": "https://twitter.com/kamranahmedse"
}
} }

@ -7,5 +7,9 @@
"latest", "latest",
"2018", "2018",
"2017" "2017"
] ],
"author": {
"name": "Kamran Ahmed",
"url": "https://twitter.com/kamranahmedse"
}
} }

@ -2,5 +2,9 @@
"title": "Full Stack Developer", "title": "Full Stack Developer",
"description": "Step by step guide to becoming a modern fullstack developer in 2019", "description": "Step by step guide to becoming a modern fullstack developer in 2019",
"featuredDescription": "Step by step guide to becoming a modern fullstack developer in 2019", "featuredDescription": "Step by step guide to becoming a modern fullstack developer in 2019",
"upcoming": true "upcoming": true,
"author": {
"name": "Kamran Ahmed",
"url": "https://twitter.com/kamranahmedse"
}
} }

@ -2,5 +2,9 @@
"title": "QA Engineer", "title": "QA Engineer",
"description": "Steps to follow in order to become a modern QA Engineer in 2019", "description": "Steps to follow in order to become a modern QA Engineer in 2019",
"featuredDescription": "Step by step guide to becoming a modern QA Engineer in 2019", "featuredDescription": "Step by step guide to becoming a modern QA Engineer in 2019",
"upcoming": true "upcoming": true,
"author": {
"name": "Anas Fitiani",
"url": "https://github.com/anas-qa"
}
} }

Loading…
Cancel
Save