Add handling of old roadmap images

pull/1331/head
Kamran Ahmed 5 years ago
parent 9f98b30568
commit 61a585614e
  1. 6
      data/roadmaps.json
  2. 5
      lib/roadmap.js
  3. 0
      static/roadmaps/2019/backend.png
  4. 0
      static/roadmaps/2019/devops.png
  5. 0
      static/roadmaps/2019/frontend.png
  6. BIN
      static/roadmaps/latest/backend.png
  7. BIN
      static/roadmaps/latest/devops.png
  8. BIN
      static/roadmaps/latest/frontend.png

@ -4,7 +4,7 @@
"description": "Step by step guide to becoming a modern frontend developer",
"featuredDescription": "Step by step guide to becoming a modern frontend developer in 2019",
"slug": "/roadmaps/frontend",
"picture": "/static/roadmaps/frontend.png",
"picture": "/static/roadmaps/{version}/frontend.png",
"featured": true,
"versions": [
"latest",
@ -17,7 +17,7 @@
"description": "Step by step guide to becoming a modern backend developer",
"featuredDescription": "Step by step guide to becoming a modern backend developer in 2019",
"slug": "/roadmaps/backend",
"picture": "/static/roadmaps/backend.png",
"picture": "/static/roadmaps/{version}/backend.png",
"featured": true,
"versions": [
"latest",
@ -30,7 +30,7 @@
"description": "Step by step guide for DevOps or any other Operations Role",
"featuredDescription": "Step by step guide to become an SRE or for any operations role in 2019",
"slug": "/roadmaps/devops",
"picture": "/static/roadmaps/devops.png",
"picture": "/static/roadmaps/{version}/devops.png",
"featured": true,
"versions": [
"latest",

@ -19,8 +19,11 @@ export const getRequestedRoadmap = req => {
legacyUrlWithoutVersion,
];
const foundRoadmap = roadmaps.find(roadmap => urlToSlugList.includes(roadmap.slug)) || {};
return {
...roadmaps.find(roadmap => urlToSlugList.includes(roadmap.slug)),
...foundRoadmap,
version: foundVersion,
picture: (foundRoadmap.picture || '').replace('{version}', foundVersion),
};
};

Before

Width:  |  Height:  |  Size: 965 KiB

After

Width:  |  Height:  |  Size: 965 KiB

Before

Width:  |  Height:  |  Size: 367 KiB

After

Width:  |  Height:  |  Size: 367 KiB

Before

Width:  |  Height:  |  Size: 625 KiB

After

Width:  |  Height:  |  Size: 625 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 965 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 KiB

Loading…
Cancel
Save