Add handling of old roadmap images

This commit is contained in:
Kamran Ahmed
2019-10-31 23:49:30 +04:00
parent 9f98b30568
commit 61a585614e
8 changed files with 7 additions and 4 deletions

View File

@ -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",

View File

@ -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),
};
};

View File

Before

Width:  |  Height:  |  Size: 965 KiB

After

Width:  |  Height:  |  Size: 965 KiB

View File

Before

Width:  |  Height:  |  Size: 367 KiB

After

Width:  |  Height:  |  Size: 367 KiB

View File

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