diff --git a/components/about-header/index.js b/components/about-header/index.js index a26844cc6..e5d080316 100644 --- a/components/about-header/index.js +++ b/components/about-header/index.js @@ -1,5 +1,5 @@ import { AboutHeaderWrap } from './style'; -import siteConfig from "storage/site"; +import siteConfig from "content/site"; const AboutHeader = () => ( diff --git a/components/detailed-roadmap/index.js b/components/detailed-roadmap/index.js index 4fbaf3c87..75b72b094 100644 --- a/components/detailed-roadmap/index.js +++ b/components/detailed-roadmap/index.js @@ -21,7 +21,7 @@ import { faBars } from '@fortawesome/free-solid-svg-icons' import { getFacebookShareUrl } from 'lib/url'; import { ShareIcon } from 'components/share-icon'; import { getRedditShareUrl, getTwitterShareUrl } from 'lib/url'; -import siteConfig from "storage/site"; +import siteConfig from "content/site"; import MdRenderer from 'components/md-renderer'; const DetailedRoadmap = ({ roadmap }) => { @@ -61,7 +61,7 @@ const DetailedRoadmap = ({ roadmap }) => { }); const filePath = currentPage.path.replace(/^\//, ''); - const RoadmapContent = require(`../../storage/${filePath}`).default; + const RoadmapContent = require(`../../content/${filePath}`).default; return ( diff --git a/components/faq-list/index.js b/components/faq-list/index.js index c7db1761c..75f1ecb7d 100644 --- a/components/faq-list/index.js +++ b/components/faq-list/index.js @@ -1,7 +1,7 @@ import { FaqContainer } from './style'; import MdRenderer from 'components/md-renderer'; -const AboutPage = require(`../../storage/pages/about.md`).default; +const AboutPage = require(`../../content/pages/about.md`).default; const FaqList = () => ( diff --git a/components/featured-content/roadmaps.js b/components/featured-content/roadmaps.js index 620cd5de9..5bf1970a8 100644 --- a/components/featured-content/roadmaps.js +++ b/components/featured-content/roadmaps.js @@ -1,5 +1,5 @@ import { FeaturedContentWrap } from './style'; -import roadmaps from 'storage/roadmaps'; +import roadmaps from 'content/roadmaps'; import FeaturedRoadmap from 'components/featured-roadmap'; const FeaturedRoadmaps = () => ( diff --git a/components/guide-body/index.js b/components/guide-body/index.js index 75d9bcb7e..2ed2d13e8 100644 --- a/components/guide-body/index.js +++ b/components/guide-body/index.js @@ -3,7 +3,7 @@ import SharePage from 'components/share-page'; import { GuideBodyWrap } from './style'; const GuideBody = ({ guide }) => { - const GuideContent = require(`../../storage/guides/${guide.fileName}.md`).default; + const GuideContent = require(`../../content/guides/${guide.fileName}.md`).default; return ( diff --git a/components/helmet/index.js b/components/helmet/index.js index 6c0ac1de0..9cc1f9336 100644 --- a/components/helmet/index.js +++ b/components/helmet/index.js @@ -1,5 +1,5 @@ import NextHead from 'next/head'; -import siteConfig from 'storage/site'; +import siteConfig from 'content/site'; const prepareTitle = (givenTitle) => { givenTitle = givenTitle || siteConfig.title; diff --git a/components/page-footer/index.js b/components/page-footer/index.js index 395c1bf0a..7d65dd74f 100644 --- a/components/page-footer/index.js +++ b/components/page-footer/index.js @@ -1,5 +1,5 @@ import Link from 'next/link'; -import siteConfig from "storage/site"; +import siteConfig from "content/site"; import { FooterWrap } from './style.js' const PageFooter = () => ( diff --git a/components/roadmap-header/index.js b/components/roadmap-header/index.js index c2c0b0b2c..632b1e6f4 100644 --- a/components/roadmap-header/index.js +++ b/components/roadmap-header/index.js @@ -1,7 +1,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faArrowLeft, faClock, faEnvelope, faHandshake } from '@fortawesome/free-solid-svg-icons'; import { BadgeLink, BadgesList, DarkBadge, PrimaryBadge, SecondaryBadge } from 'components/badges'; -import siteConfig from "storage/site"; +import siteConfig from "content/site"; import { Description, Header, Title, VersionList } from './style'; const RoadmapHeader = ({ roadmap }) => ( diff --git a/components/roadmap-summary/index.js b/components/roadmap-summary/index.js index 874f35b3c..4b11e9fe5 100644 --- a/components/roadmap-summary/index.js +++ b/components/roadmap-summary/index.js @@ -17,7 +17,7 @@ const RoadmapSummary = ({ roadmap }) => { } const filePath = roadmap.path.replace(/^\//, ''); - const RoadmapContent = require(`../../storage/${filePath}`).default; + const RoadmapContent = require(`../../content/${filePath}`).default; return ( diff --git a/components/site-nav/index.js b/components/site-nav/index.js index face3dfb3..8c9aa897b 100644 --- a/components/site-nav/index.js +++ b/components/site-nav/index.js @@ -11,6 +11,7 @@ const SiteNav = () => ( diff --git a/storage/authors.json b/content/authors.json similarity index 100% rename from storage/authors.json rename to content/authors.json diff --git a/storage/guides.json b/content/guides.json similarity index 100% rename from storage/guides.json rename to content/guides.json diff --git a/storage/guides/design-patterns-for-humans.md b/content/guides/design-patterns-for-humans.md similarity index 100% rename from storage/guides/design-patterns-for-humans.md rename to content/guides/design-patterns-for-humans.md diff --git a/storage/guides/dns-in-one-picture.md b/content/guides/dns-in-one-picture.md similarity index 100% rename from storage/guides/dns-in-one-picture.md rename to content/guides/dns-in-one-picture.md diff --git a/storage/guides/history-of-javascript.md b/content/guides/history-of-javascript.md similarity index 100% rename from storage/guides/history-of-javascript.md rename to content/guides/history-of-javascript.md diff --git a/storage/guides/http-caching.md b/content/guides/http-caching.md similarity index 100% rename from storage/guides/http-caching.md rename to content/guides/http-caching.md diff --git a/storage/guides/journey-to-http2.md b/content/guides/journey-to-http2.md similarity index 100% rename from storage/guides/journey-to-http2.md rename to content/guides/journey-to-http2.md diff --git a/storage/guides/levels-of-seniority.md b/content/guides/levels-of-seniority.md similarity index 100% rename from storage/guides/levels-of-seniority.md rename to content/guides/levels-of-seniority.md diff --git a/storage/guides/torrent-client.md b/content/guides/torrent-client.md similarity index 100% rename from storage/guides/torrent-client.md rename to content/guides/torrent-client.md diff --git a/storage/guides/upcoming.md b/content/guides/upcoming.md similarity index 100% rename from storage/guides/upcoming.md rename to content/guides/upcoming.md diff --git a/storage/pages/about.md b/content/pages/about.md similarity index 100% rename from storage/pages/about.md rename to content/pages/about.md diff --git a/storage/project/backend-map.json b/content/project/backend-map.json similarity index 100% rename from storage/project/backend-map.json rename to content/project/backend-map.json diff --git a/storage/project/devops-map.json b/content/project/devops-map.json similarity index 100% rename from storage/project/devops-map.json rename to content/project/devops-map.json diff --git a/storage/project/disclaimer.json b/content/project/disclaimer.json similarity index 100% rename from storage/project/disclaimer.json rename to content/project/disclaimer.json diff --git a/storage/project/frontend-map.json b/content/project/frontend-map.json similarity index 100% rename from storage/project/frontend-map.json rename to content/project/frontend-map.json diff --git a/storage/project/intro-map.json b/content/project/intro-map.json similarity index 100% rename from storage/project/intro-map.json rename to content/project/intro-map.json diff --git a/storage/roadmaps.json b/content/roadmaps.json similarity index 100% rename from storage/roadmaps.json rename to content/roadmaps.json diff --git a/storage/roadmaps/1-frontend/0-About/0-Summary-detailed.md b/content/roadmaps/1-frontend/0-About/0-Summary-detailed.md similarity index 100% rename from storage/roadmaps/1-frontend/0-About/0-Summary-detailed.md rename to content/roadmaps/1-frontend/0-About/0-Summary-detailed.md diff --git a/storage/roadmaps/1-frontend/0-About/0-Summary.md b/content/roadmaps/1-frontend/0-About/0-Summary.md similarity index 100% rename from storage/roadmaps/1-frontend/0-About/0-Summary.md rename to content/roadmaps/1-frontend/0-About/0-Summary.md diff --git a/storage/roadmaps/1-frontend/0-About/1-Skill-Summary.md b/content/roadmaps/1-frontend/0-About/1-Skill-Summary.md similarity index 100% rename from storage/roadmaps/1-frontend/0-About/1-Skill-Summary.md rename to content/roadmaps/1-frontend/0-About/1-Skill-Summary.md diff --git a/storage/roadmaps/1-frontend/0-About/2-Job-Titles.md b/content/roadmaps/1-frontend/0-About/2-Job-Titles.md similarity index 100% rename from storage/roadmaps/1-frontend/0-About/2-Job-Titles.md rename to content/roadmaps/1-frontend/0-About/2-Job-Titles.md diff --git a/storage/roadmaps/1-frontend/1-Landscape/1-Junior-Developer.md b/content/roadmaps/1-frontend/1-Landscape/1-Junior-Developer.md similarity index 100% rename from storage/roadmaps/1-frontend/1-Landscape/1-Junior-Developer.md rename to content/roadmaps/1-frontend/1-Landscape/1-Junior-Developer.md diff --git a/storage/roadmaps/1-frontend/1-Landscape/2-Mid-Level-Developer.md b/content/roadmaps/1-frontend/1-Landscape/2-Mid-Level-Developer.md similarity index 100% rename from storage/roadmaps/1-frontend/1-Landscape/2-Mid-Level-Developer.md rename to content/roadmaps/1-frontend/1-Landscape/2-Mid-Level-Developer.md diff --git a/storage/roadmaps/1-frontend/1-Landscape/3-Senior-Developer.md b/content/roadmaps/1-frontend/1-Landscape/3-Senior-Developer.md similarity index 100% rename from storage/roadmaps/1-frontend/1-Landscape/3-Senior-Developer.md rename to content/roadmaps/1-frontend/1-Landscape/3-Senior-Developer.md diff --git a/storage/roadmaps/1-frontend/2-Learn/1-Job-Ready.md b/content/roadmaps/1-frontend/2-Learn/1-Job-Ready.md similarity index 100% rename from storage/roadmaps/1-frontend/2-Learn/1-Job-Ready.md rename to content/roadmaps/1-frontend/2-Learn/1-Job-Ready.md diff --git a/storage/roadmaps/1-frontend/2-Learn/2-Write-Better-CSS.md b/content/roadmaps/1-frontend/2-Learn/2-Write-Better-CSS.md similarity index 100% rename from storage/roadmaps/1-frontend/2-Learn/2-Write-Better-CSS.md rename to content/roadmaps/1-frontend/2-Learn/2-Write-Better-CSS.md diff --git a/storage/roadmaps/1-frontend/2-Learn/3-Build-Tools.md b/content/roadmaps/1-frontend/2-Learn/3-Build-Tools.md similarity index 100% rename from storage/roadmaps/1-frontend/2-Learn/3-Build-Tools.md rename to content/roadmaps/1-frontend/2-Learn/3-Build-Tools.md diff --git a/storage/roadmaps/1-frontend/2-Learn/4-Modern-Applications.md b/content/roadmaps/1-frontend/2-Learn/4-Modern-Applications.md similarity index 100% rename from storage/roadmaps/1-frontend/2-Learn/4-Modern-Applications.md rename to content/roadmaps/1-frontend/2-Learn/4-Modern-Applications.md diff --git a/storage/roadmaps/1-frontend/2-Learn/5-Automated-Testing.md b/content/roadmaps/1-frontend/2-Learn/5-Automated-Testing.md similarity index 100% rename from storage/roadmaps/1-frontend/2-Learn/5-Automated-Testing.md rename to content/roadmaps/1-frontend/2-Learn/5-Automated-Testing.md diff --git a/storage/roadmaps/1-frontend/2-Learn/6-Static-Type-Checkers.md b/content/roadmaps/1-frontend/2-Learn/6-Static-Type-Checkers.md similarity index 100% rename from storage/roadmaps/1-frontend/2-Learn/6-Static-Type-Checkers.md rename to content/roadmaps/1-frontend/2-Learn/6-Static-Type-Checkers.md diff --git a/storage/roadmaps/1-frontend/2-Learn/7-Server-Side-Rendering.md b/content/roadmaps/1-frontend/2-Learn/7-Server-Side-Rendering.md similarity index 100% rename from storage/roadmaps/1-frontend/2-Learn/7-Server-Side-Rendering.md rename to content/roadmaps/1-frontend/2-Learn/7-Server-Side-Rendering.md diff --git a/storage/roadmaps/1-frontend/2-Learn/8-Go-Beyond.md b/content/roadmaps/1-frontend/2-Learn/8-Go-Beyond.md similarity index 100% rename from storage/roadmaps/1-frontend/2-Learn/8-Go-Beyond.md rename to content/roadmaps/1-frontend/2-Learn/8-Go-Beyond.md diff --git a/storage/roadmaps/1-frontend/meta.json b/content/roadmaps/1-frontend/meta.json similarity index 100% rename from storage/roadmaps/1-frontend/meta.json rename to content/roadmaps/1-frontend/meta.json diff --git a/storage/roadmaps/2-backend/0-About/0-Summary.md b/content/roadmaps/2-backend/0-About/0-Summary.md similarity index 100% rename from storage/roadmaps/2-backend/0-About/0-Summary.md rename to content/roadmaps/2-backend/0-About/0-Summary.md diff --git a/storage/roadmaps/2-backend/1-Landscape/0-Summary.md b/content/roadmaps/2-backend/1-Landscape/0-Summary.md similarity index 100% rename from storage/roadmaps/2-backend/1-Landscape/0-Summary.md rename to content/roadmaps/2-backend/1-Landscape/0-Summary.md diff --git a/storage/roadmaps/2-backend/1-Landscape/1-Junior.md b/content/roadmaps/2-backend/1-Landscape/1-Junior.md similarity index 100% rename from storage/roadmaps/2-backend/1-Landscape/1-Junior.md rename to content/roadmaps/2-backend/1-Landscape/1-Junior.md diff --git a/storage/roadmaps/2-backend/1-Landscape/2-Intermediate.md b/content/roadmaps/2-backend/1-Landscape/2-Intermediate.md similarity index 100% rename from storage/roadmaps/2-backend/1-Landscape/2-Intermediate.md rename to content/roadmaps/2-backend/1-Landscape/2-Intermediate.md diff --git a/storage/roadmaps/2-backend/1-Landscape/3-Senior.md b/content/roadmaps/2-backend/1-Landscape/3-Senior.md similarity index 100% rename from storage/roadmaps/2-backend/1-Landscape/3-Senior.md rename to content/roadmaps/2-backend/1-Landscape/3-Senior.md diff --git a/storage/roadmaps/2-backend/meta.json b/content/roadmaps/2-backend/meta.json similarity index 100% rename from storage/roadmaps/2-backend/meta.json rename to content/roadmaps/2-backend/meta.json diff --git a/storage/roadmaps/3-devops/0-About/0-Summary.md b/content/roadmaps/3-devops/0-About/0-Summary.md similarity index 100% rename from storage/roadmaps/3-devops/0-About/0-Summary.md rename to content/roadmaps/3-devops/0-About/0-Summary.md diff --git a/storage/roadmaps/3-devops/1-Landscape/1-Junior.md b/content/roadmaps/3-devops/1-Landscape/1-Junior.md similarity index 100% rename from storage/roadmaps/3-devops/1-Landscape/1-Junior.md rename to content/roadmaps/3-devops/1-Landscape/1-Junior.md diff --git a/storage/roadmaps/3-devops/1-Landscape/2-Intermediate.md b/content/roadmaps/3-devops/1-Landscape/2-Intermediate.md similarity index 100% rename from storage/roadmaps/3-devops/1-Landscape/2-Intermediate.md rename to content/roadmaps/3-devops/1-Landscape/2-Intermediate.md diff --git a/storage/roadmaps/3-devops/1-Landscape/3-Senior.md b/content/roadmaps/3-devops/1-Landscape/3-Senior.md similarity index 100% rename from storage/roadmaps/3-devops/1-Landscape/3-Senior.md rename to content/roadmaps/3-devops/1-Landscape/3-Senior.md diff --git a/storage/roadmaps/3-devops/meta.json b/content/roadmaps/3-devops/meta.json similarity index 100% rename from storage/roadmaps/3-devops/meta.json rename to content/roadmaps/3-devops/meta.json diff --git a/storage/roadmaps/4-fullstack/0-About/0-Summary.md b/content/roadmaps/4-fullstack/0-About/0-Summary.md similarity index 100% rename from storage/roadmaps/4-fullstack/0-About/0-Summary.md rename to content/roadmaps/4-fullstack/0-About/0-Summary.md diff --git a/storage/roadmaps/4-fullstack/meta.json b/content/roadmaps/4-fullstack/meta.json similarity index 100% rename from storage/roadmaps/4-fullstack/meta.json rename to content/roadmaps/4-fullstack/meta.json diff --git a/storage/roadmaps/5-qa/0-About/0-Summary.md b/content/roadmaps/5-qa/0-About/0-Summary.md similarity index 100% rename from storage/roadmaps/5-qa/0-About/0-Summary.md rename to content/roadmaps/5-qa/0-About/0-Summary.md diff --git a/storage/roadmaps/5-qa/meta.json b/content/roadmaps/5-qa/meta.json similarity index 100% rename from storage/roadmaps/5-qa/meta.json rename to content/roadmaps/5-qa/meta.json diff --git a/storage/site.json b/content/site.json similarity index 98% rename from storage/site.json rename to content/site.json index 460e37261..16e7a482b 100644 --- a/storage/site.json +++ b/content/site.json @@ -10,7 +10,7 @@ "url": { "web": "https://roadmap.sh", "repo": "https://github.com/kamranahmedse/roadmap.sh", - "repoData": "https://github.com/kamranahmedse/roadmap.sh/tree/master/storage", + "repoData": "https://github.com/kamranahmedse/roadmap.sh/tree/master/content", "addGuide": "https://github.com/kamranahmedse/roadmap.sh/tree/master/contributing/guide.md", "addRoadmap": "https://github.com/kamranahmedse/roadmap.sh/tree/master/contributing/roadmap.md", "addResources": "https://github.com/kamranahmedse/roadmap.sh/tree/master/contributing/resources.md", diff --git a/contributing/guide.md b/contributing/guide.md index c48890062..d2c6627aa 100644 --- a/contributing/guide.md +++ b/contributing/guide.md @@ -6,9 +6,9 @@ First of all thank you for considering to contribute to this project. It wouldn' * Fork this repository * If you haven't contributed to this project before then create your author profile - * Open the file [authors.json](../storage/authors.json) + * Open the file [authors.json](../content/authors.json) * Put your preferred `username` * Put a profile picture in [authors directory](../public/authors) with the username -* Create a new markdown file in the [guides directory](../storage/guides). -* Add the meta data for this guide in [guides.json](../storage/guides.json). Please note that `fileName` and `slug` must match. +* Create a new markdown file in the [guides directory](../content/guides). +* Add the meta data for this guide in [guides.json](../content/guides.json). Please note that `fileName` and `slug` must match. * Open a pull request diff --git a/lib/author.js b/lib/author.js index 5c76e3091..3514d9ae8 100644 --- a/lib/author.js +++ b/lib/author.js @@ -1,3 +1,3 @@ -import authors from "storage/authors"; +import authors from "content/authors"; export const findByUsername = (username) => authors.find(author => author.username === username) || {}; diff --git a/lib/guide.js b/lib/guide.js index 4b27b8ee8..69946aba5 100644 --- a/lib/guide.js +++ b/lib/guide.js @@ -1,6 +1,6 @@ -import guides from 'storage/guides'; -import authors from 'storage/authors'; -import siteConfig from 'storage/site'; +import guides from 'content/guides'; +import authors from 'content/authors'; +import siteConfig from 'content/site'; export const getAllGuides = () => { return guides.filter(guide => !guide.draft) diff --git a/lib/roadmap.js b/lib/roadmap.js index f6db029e5..6f0c8a4ae 100644 --- a/lib/roadmap.js +++ b/lib/roadmap.js @@ -1,4 +1,4 @@ -import roadmaps from "storage/roadmaps"; +import roadmaps from "content/roadmaps"; export const getRequestedRoadmap = req => { const normalizedUrl = req.url.replace(/\/$/, ''); diff --git a/lib/url.js b/lib/url.js index 293bec739..f0efdddb6 100644 --- a/lib/url.js +++ b/lib/url.js @@ -1,4 +1,4 @@ -import siteConfig from 'storage/site'; +import siteConfig from 'content/site'; export const prefixHost = (url) => { // if it starts with forward slash then prefix site URL diff --git a/pages/[roadmap]/index.js b/pages/[roadmap]/index.js index 924bfddf7..e6592e073 100644 --- a/pages/[roadmap]/index.js +++ b/pages/[roadmap]/index.js @@ -4,7 +4,7 @@ import SiteNav from 'components/site-nav'; import PageFooter from 'components/page-footer'; import { serverOnlyProps } from 'lib/server'; import { getRequestedRoadmap } from 'lib/roadmap'; -import siteConfig from 'storage/site'; +import siteConfig from 'content/site'; import Helmet from 'components/helmet'; import RoadmapSummary from 'components/roadmap-summary'; import DetailedRoadmap from 'components/detailed-roadmap'; diff --git a/pages/guides/[guide].js b/pages/guides/[guide].js index 86f0befd5..a864bd8eb 100644 --- a/pages/guides/[guide].js +++ b/pages/guides/[guide].js @@ -6,7 +6,7 @@ import GuideBody from 'components/guide-body'; import GuideFooter from 'components/guide-footer'; import { getRequestedGuide } from 'lib/guide'; import Helmet from 'components/helmet'; -import siteConfig from 'storage/site'; +import siteConfig from 'content/site'; const Guide = ({ guide, canonical }) => { if (!guide) { diff --git a/pages/guides/index.js b/pages/guides/index.js index 3582c8d4d..1eb4455d5 100644 --- a/pages/guides/index.js +++ b/pages/guides/index.js @@ -7,7 +7,7 @@ import PageHeader from 'components/page-header'; import PageFooter from 'components/page-footer'; import SiteNav from 'components/site-nav'; import { getAllGuides } from 'lib/guide'; -import siteConfig from 'storage/site'; +import siteConfig from 'content/site'; import Helmet from 'components/helmet'; const PageTitle = "Programming Guides"; diff --git a/pages/roadmaps.js b/pages/roadmaps.js index 10d61a632..814c4a9e1 100644 --- a/pages/roadmaps.js +++ b/pages/roadmaps.js @@ -5,10 +5,10 @@ import DefaultLayout from 'layouts/default/index'; import SiteNav from 'components/site-nav'; import PageFooter from 'components/page-footer'; import PageHeader from 'components/page-header'; -import roadmaps from "storage/roadmaps"; +import roadmaps from "content/roadmaps"; import RowBlock from 'components/row-block'; import IconRowBlock from 'components/icon-row-block'; -import siteConfig from "storage/site"; +import siteConfig from "content/site"; import { BadgeLink, BadgesList, PrimaryBadge, SecondaryBadge } from 'components/badges'; import Helmet from 'components/helmet'; diff --git a/scripts/path-map.js b/scripts/path-map.js index 980c74e37..007668dac 100644 --- a/scripts/path-map.js +++ b/scripts/path-map.js @@ -2,11 +2,11 @@ const path = require('path'); const glob = require('glob'); const fs = require('fs'); -const roadmaps = require('../storage/roadmaps.json'); -const guides = require('../storage/guides.json'); +const roadmaps = require('../content/roadmaps.json'); +const guides = require('../content/guides.json'); const PAGES_PATH = path.join(__dirname, '../pages'); -const ROADMAPS_PATH = path.join(__dirname, '../storage/roadmaps'); +const ROADMAPS_PATH = path.join(__dirname, '../content/roadmaps'); /** * Generate the page routes from the page files inside `/pages` diff --git a/scripts/roadmaps-meta.js b/scripts/roadmaps-meta.js index 67197206c..953e6afed 100644 --- a/scripts/roadmaps-meta.js +++ b/scripts/roadmaps-meta.js @@ -2,9 +2,9 @@ const fs = require('fs'); const path = require('path'); const exec = require('child_process').execSync; -const STORAGE_PATH = path.join(__dirname, '../storage'); -const ROADMAPS_PATH = path.join(__dirname, '../storage/roadmaps'); -const META_FILE_PATH = path.join(__dirname, '../storage/roadmaps.json'); +const STORAGE_PATH = path.join(__dirname, '../content'); +const ROADMAPS_PATH = path.join(__dirname, '../content/roadmaps'); +const META_FILE_PATH = path.join(__dirname, '../content/roadmaps.json'); const roadmapDirs = fs.readdirSync(ROADMAPS_PATH); console.log(`[x] ${roadmapDirs.length} roadmaps found`); @@ -14,8 +14,8 @@ const roadmapsMeta = roadmapDirs.reduce((metaAcc, roadmapDirName) => { const roadmapDir = path.join(ROADMAPS_PATH, roadmapDirName); const roadmapMeta = require(path.join(roadmapDir, 'meta.json')); - // We can't use the absolute path in the build e.g. ~/Users/user/where-build-is-running/storage - // So, we remove it and use the path relative to storage directory + // We can't use the absolute path in the build e.g. ~/Users/user/where-build-is-running/content + // So, we remove it and use the path relative to content directory const summaryFilePath = path.join(roadmapDir.replace(STORAGE_PATH, ''), '/0-About/0-Summary.md'); const contributors = exec(`git log --pretty=format:"%an%x09" ${roadmapDir} | uniq`) diff --git a/scripts/sitemap.js b/scripts/sitemap.js index 421d1af73..d88caebab 100644 --- a/scripts/sitemap.js +++ b/scripts/sitemap.js @@ -1,13 +1,13 @@ // This is a development script executed in the build step of pages const fs = require('fs'); const path = require('path'); -const guides = require('../storage/guides'); -const roadmaps = require('../storage/roadmaps'); +const guides = require('../content/guides'); +const roadmaps = require('../content/roadmaps'); const { getPageRoutes, getGuideRoutes } = require('./path-map'); const DOMAIN = 'https://roadmap.sh'; const PAGES_DIR = path.join(__dirname, '../pages'); -const STORAGE_PATH = path.join(__dirname, '../storage'); +const STORAGE_PATH = path.join(__dirname, '../content'); const SITEMAP_PATH = 'static/sitemap.xml'; // Set the header diff --git a/test/path-map.spec.js b/test/path-map.spec.js index 47988586c..772658201 100644 --- a/test/path-map.spec.js +++ b/test/path-map.spec.js @@ -1,13 +1,10 @@ const path = require('path'); const fs = require('fs'); -const glob = require('glob'); -const guides = require('../storage/guides'); -const roadmaps = require('../storage/roadmaps'); +const guides = require('../content/guides'); const { getPageRoutes, getGuideRoutes, - getRoadmapRoutes } = require("../scripts/path-map"); describe("Build scripts tests", () => { @@ -51,7 +48,7 @@ describe("Build scripts tests", () => { guides.forEach(guide => { const [,, slug] = guide.url.split('/'); - const expectedFile = path.join(__dirname, `../storage/guides/${slug}.md`); + const expectedFile = path.join(__dirname, `../content/guides/${slug}.md`); const foundFile = fs.existsSync(expectedFile) ? expectedFile : ''; expect(foundFile).toEqual(expectedFile);