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

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