Rename storage directory

pull/1331/head
Kamran Ahmed 5 years ago
parent b97ae52a1b
commit a26945288b
  1. 2
      components/about-header/index.js
  2. 4
      components/detailed-roadmap/index.js
  3. 2
      components/faq-list/index.js
  4. 2
      components/featured-content/roadmaps.js
  5. 2
      components/guide-body/index.js
  6. 2
      components/helmet/index.js
  7. 2
      components/page-footer/index.js
  8. 2
      components/roadmap-header/index.js
  9. 2
      components/roadmap-summary/index.js
  10. 1
      components/site-nav/index.js
  11. 0
      content/authors.json
  12. 0
      content/guides.json
  13. 0
      content/guides/design-patterns-for-humans.md
  14. 0
      content/guides/dns-in-one-picture.md
  15. 0
      content/guides/history-of-javascript.md
  16. 0
      content/guides/http-caching.md
  17. 0
      content/guides/journey-to-http2.md
  18. 0
      content/guides/levels-of-seniority.md
  19. 0
      content/guides/torrent-client.md
  20. 0
      content/guides/upcoming.md
  21. 0
      content/pages/about.md
  22. 0
      content/project/backend-map.json
  23. 0
      content/project/devops-map.json
  24. 0
      content/project/disclaimer.json
  25. 0
      content/project/frontend-map.json
  26. 0
      content/project/intro-map.json
  27. 0
      content/roadmaps.json
  28. 0
      content/roadmaps/1-frontend/0-About/0-Summary-detailed.md
  29. 0
      content/roadmaps/1-frontend/0-About/0-Summary.md
  30. 0
      content/roadmaps/1-frontend/0-About/1-Skill-Summary.md
  31. 0
      content/roadmaps/1-frontend/0-About/2-Job-Titles.md
  32. 0
      content/roadmaps/1-frontend/1-Landscape/1-Junior-Developer.md
  33. 0
      content/roadmaps/1-frontend/1-Landscape/2-Mid-Level-Developer.md
  34. 0
      content/roadmaps/1-frontend/1-Landscape/3-Senior-Developer.md
  35. 0
      content/roadmaps/1-frontend/2-Learn/1-Job-Ready.md
  36. 0
      content/roadmaps/1-frontend/2-Learn/2-Write-Better-CSS.md
  37. 0
      content/roadmaps/1-frontend/2-Learn/3-Build-Tools.md
  38. 0
      content/roadmaps/1-frontend/2-Learn/4-Modern-Applications.md
  39. 0
      content/roadmaps/1-frontend/2-Learn/5-Automated-Testing.md
  40. 0
      content/roadmaps/1-frontend/2-Learn/6-Static-Type-Checkers.md
  41. 0
      content/roadmaps/1-frontend/2-Learn/7-Server-Side-Rendering.md
  42. 0
      content/roadmaps/1-frontend/2-Learn/8-Go-Beyond.md
  43. 0
      content/roadmaps/1-frontend/meta.json
  44. 0
      content/roadmaps/2-backend/0-About/0-Summary.md
  45. 0
      content/roadmaps/2-backend/1-Landscape/0-Summary.md
  46. 0
      content/roadmaps/2-backend/1-Landscape/1-Junior.md
  47. 0
      content/roadmaps/2-backend/1-Landscape/2-Intermediate.md
  48. 0
      content/roadmaps/2-backend/1-Landscape/3-Senior.md
  49. 0
      content/roadmaps/2-backend/meta.json
  50. 0
      content/roadmaps/3-devops/0-About/0-Summary.md
  51. 0
      content/roadmaps/3-devops/1-Landscape/1-Junior.md
  52. 0
      content/roadmaps/3-devops/1-Landscape/2-Intermediate.md
  53. 0
      content/roadmaps/3-devops/1-Landscape/3-Senior.md
  54. 0
      content/roadmaps/3-devops/meta.json
  55. 0
      content/roadmaps/4-fullstack/0-About/0-Summary.md
  56. 0
      content/roadmaps/4-fullstack/meta.json
  57. 0
      content/roadmaps/5-qa/0-About/0-Summary.md
  58. 0
      content/roadmaps/5-qa/meta.json
  59. 2
      content/site.json
  60. 6
      contributing/guide.md
  61. 2
      lib/author.js
  62. 6
      lib/guide.js
  63. 2
      lib/roadmap.js
  64. 2
      lib/url.js
  65. 2
      pages/[roadmap]/index.js
  66. 2
      pages/guides/[guide].js
  67. 2
      pages/guides/index.js
  68. 4
      pages/roadmaps.js
  69. 6
      scripts/path-map.js
  70. 10
      scripts/roadmaps-meta.js
  71. 6
      scripts/sitemap.js
  72. 7
      test/path-map.spec.js

@ -1,5 +1,5 @@
import { AboutHeaderWrap } from './style'; import { AboutHeaderWrap } from './style';
import siteConfig from "storage/site"; import siteConfig from "content/site";
const AboutHeader = () => ( const AboutHeader = () => (
<AboutHeaderWrap> <AboutHeaderWrap>

@ -21,7 +21,7 @@ import { faBars } from '@fortawesome/free-solid-svg-icons'
import { getFacebookShareUrl } from 'lib/url'; import { getFacebookShareUrl } from 'lib/url';
import { ShareIcon } from 'components/share-icon'; import { ShareIcon } from 'components/share-icon';
import { getRedditShareUrl, getTwitterShareUrl } from 'lib/url'; import { getRedditShareUrl, getTwitterShareUrl } from 'lib/url';
import siteConfig from "storage/site"; import siteConfig from "content/site";
import MdRenderer from 'components/md-renderer'; import MdRenderer from 'components/md-renderer';
const DetailedRoadmap = ({ roadmap }) => { const DetailedRoadmap = ({ roadmap }) => {
@ -61,7 +61,7 @@ const DetailedRoadmap = ({ roadmap }) => {
}); });
const filePath = currentPage.path.replace(/^\//, ''); const filePath = currentPage.path.replace(/^\//, '');
const RoadmapContent = require(`../../storage/${filePath}`).default; const RoadmapContent = require(`../../content/${filePath}`).default;
return ( return (
<SummaryContainer> <SummaryContainer>

@ -1,7 +1,7 @@
import { FaqContainer } from './style'; import { FaqContainer } from './style';
import MdRenderer from 'components/md-renderer'; import MdRenderer from 'components/md-renderer';
const AboutPage = require(`../../storage/pages/about.md`).default; const AboutPage = require(`../../content/pages/about.md`).default;
const FaqList = () => ( const FaqList = () => (
<FaqContainer className='border-top bg-light'> <FaqContainer className='border-top bg-light'>

@ -1,5 +1,5 @@
import { FeaturedContentWrap } from './style'; import { FeaturedContentWrap } from './style';
import roadmaps from 'storage/roadmaps'; import roadmaps from 'content/roadmaps';
import FeaturedRoadmap from 'components/featured-roadmap'; import FeaturedRoadmap from 'components/featured-roadmap';
const FeaturedRoadmaps = () => ( const FeaturedRoadmaps = () => (

@ -3,7 +3,7 @@ import SharePage from 'components/share-page';
import { GuideBodyWrap } from './style'; import { GuideBodyWrap } from './style';
const GuideBody = ({ guide }) => { const GuideBody = ({ guide }) => {
const GuideContent = require(`../../storage/guides/${guide.fileName}.md`).default; const GuideContent = require(`../../content/guides/${guide.fileName}.md`).default;
return ( return (
<GuideBodyWrap> <GuideBodyWrap>
<MdRenderer> <MdRenderer>

@ -1,5 +1,5 @@
import NextHead from 'next/head'; import NextHead from 'next/head';
import siteConfig from 'storage/site'; import siteConfig from 'content/site';
const prepareTitle = (givenTitle) => { const prepareTitle = (givenTitle) => {
givenTitle = givenTitle || siteConfig.title; givenTitle = givenTitle || siteConfig.title;

@ -1,5 +1,5 @@
import Link from 'next/link'; import Link from 'next/link';
import siteConfig from "storage/site"; import siteConfig from "content/site";
import { FooterWrap } from './style.js' import { FooterWrap } from './style.js'
const PageFooter = () => ( const PageFooter = () => (

@ -1,7 +1,7 @@
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faArrowLeft, faClock, faEnvelope, faHandshake } from '@fortawesome/free-solid-svg-icons'; import { faArrowLeft, faClock, faEnvelope, faHandshake } from '@fortawesome/free-solid-svg-icons';
import { BadgeLink, BadgesList, DarkBadge, PrimaryBadge, SecondaryBadge } from 'components/badges'; 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'; import { Description, Header, Title, VersionList } from './style';
const RoadmapHeader = ({ roadmap }) => ( const RoadmapHeader = ({ roadmap }) => (

@ -17,7 +17,7 @@ const RoadmapSummary = ({ roadmap }) => {
} }
const filePath = roadmap.path.replace(/^\//, ''); const filePath = roadmap.path.replace(/^\//, '');
const RoadmapContent = require(`../../storage/${filePath}`).default; const RoadmapContent = require(`../../content/${filePath}`).default;
return ( return (
<SummaryContainer> <SummaryContainer>

@ -11,6 +11,7 @@ const SiteNav = () => (
<div className='nav-links'> <div className='nav-links'>
<a href='/roadmaps'>Roadmaps</a> <a href='/roadmaps'>Roadmaps</a>
<a href='/guides'>Guides</a> <a href='/guides'>Guides</a>
<a href='/jobs'>Jobs</a>
<a href='/about' className='d-none d-md-inline-block'>FAQ</a> <a href='/about' className='d-none d-md-inline-block'>FAQ</a>
<a href='/signup' className='signup'>Subscribe</a> <a href='/signup' className='signup'>Subscribe</a>
</div> </div>

@ -10,7 +10,7 @@
"url": { "url": {
"web": "https://roadmap.sh", "web": "https://roadmap.sh",
"repo": "https://github.com/kamranahmedse/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", "addGuide": "https://github.com/kamranahmedse/roadmap.sh/tree/master/contributing/guide.md",
"addRoadmap": "https://github.com/kamranahmedse/roadmap.sh/tree/master/contributing/roadmap.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", "addResources": "https://github.com/kamranahmedse/roadmap.sh/tree/master/contributing/resources.md",

@ -6,9 +6,9 @@ First of all thank you for considering to contribute to this project. It wouldn'
* Fork this repository * Fork this repository
* If you haven't contributed to this project before then create your author profile * 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 your preferred `username`
* Put a profile picture in [authors directory](../public/authors) with the username * Put a profile picture in [authors directory](../public/authors) with the username
* Create a new markdown file in the [guides directory](../storage/guides). * Create a new markdown file in the [guides directory](../content/guides).
* Add the meta data for this guide in [guides.json](../storage/guides.json). Please note that `fileName` and `slug` must match. * 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 * Open a pull request

@ -1,3 +1,3 @@
import authors from "storage/authors"; import authors from "content/authors";
export const findByUsername = (username) => authors.find(author => author.username === username) || {}; export const findByUsername = (username) => authors.find(author => author.username === username) || {};

@ -1,6 +1,6 @@
import guides from 'storage/guides'; import guides from 'content/guides';
import authors from 'storage/authors'; import authors from 'content/authors';
import siteConfig from 'storage/site'; import siteConfig from 'content/site';
export const getAllGuides = () => { export const getAllGuides = () => {
return guides.filter(guide => !guide.draft) return guides.filter(guide => !guide.draft)

@ -1,4 +1,4 @@
import roadmaps from "storage/roadmaps"; import roadmaps from "content/roadmaps";
export const getRequestedRoadmap = req => { export const getRequestedRoadmap = req => {
const normalizedUrl = req.url.replace(/\/$/, ''); const normalizedUrl = req.url.replace(/\/$/, '');

@ -1,4 +1,4 @@
import siteConfig from 'storage/site'; import siteConfig from 'content/site';
export const prefixHost = (url) => { export const prefixHost = (url) => {
// if it starts with forward slash then prefix site URL // if it starts with forward slash then prefix site URL

@ -4,7 +4,7 @@ import SiteNav from 'components/site-nav';
import PageFooter from 'components/page-footer'; import PageFooter from 'components/page-footer';
import { serverOnlyProps } from 'lib/server'; import { serverOnlyProps } from 'lib/server';
import { getRequestedRoadmap } from 'lib/roadmap'; import { getRequestedRoadmap } from 'lib/roadmap';
import siteConfig from 'storage/site'; import siteConfig from 'content/site';
import Helmet from 'components/helmet'; import Helmet from 'components/helmet';
import RoadmapSummary from 'components/roadmap-summary'; import RoadmapSummary from 'components/roadmap-summary';
import DetailedRoadmap from 'components/detailed-roadmap'; import DetailedRoadmap from 'components/detailed-roadmap';

@ -6,7 +6,7 @@ import GuideBody from 'components/guide-body';
import GuideFooter from 'components/guide-footer'; import GuideFooter from 'components/guide-footer';
import { getRequestedGuide } from 'lib/guide'; import { getRequestedGuide } from 'lib/guide';
import Helmet from 'components/helmet'; import Helmet from 'components/helmet';
import siteConfig from 'storage/site'; import siteConfig from 'content/site';
const Guide = ({ guide, canonical }) => { const Guide = ({ guide, canonical }) => {
if (!guide) { if (!guide) {

@ -7,7 +7,7 @@ import PageHeader from 'components/page-header';
import PageFooter from 'components/page-footer'; import PageFooter from 'components/page-footer';
import SiteNav from 'components/site-nav'; import SiteNav from 'components/site-nav';
import { getAllGuides } from 'lib/guide'; import { getAllGuides } from 'lib/guide';
import siteConfig from 'storage/site'; import siteConfig from 'content/site';
import Helmet from 'components/helmet'; import Helmet from 'components/helmet';
const PageTitle = "Programming Guides"; const PageTitle = "Programming Guides";

@ -5,10 +5,10 @@ import DefaultLayout from 'layouts/default/index';
import SiteNav from 'components/site-nav'; import SiteNav from 'components/site-nav';
import PageFooter from 'components/page-footer'; import PageFooter from 'components/page-footer';
import PageHeader from 'components/page-header'; import PageHeader from 'components/page-header';
import roadmaps from "storage/roadmaps"; import roadmaps from "content/roadmaps";
import RowBlock from 'components/row-block'; import RowBlock from 'components/row-block';
import IconRowBlock from 'components/icon-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 { BadgeLink, BadgesList, PrimaryBadge, SecondaryBadge } from 'components/badges';
import Helmet from 'components/helmet'; import Helmet from 'components/helmet';

@ -2,11 +2,11 @@ const path = require('path');
const glob = require('glob'); const glob = require('glob');
const fs = require('fs'); const fs = require('fs');
const roadmaps = require('../storage/roadmaps.json'); const roadmaps = require('../content/roadmaps.json');
const guides = require('../storage/guides.json'); const guides = require('../content/guides.json');
const PAGES_PATH = path.join(__dirname, '../pages'); 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` * Generate the page routes from the page files inside `/pages`

@ -2,9 +2,9 @@ const fs = require('fs');
const path = require('path'); const path = require('path');
const exec = require('child_process').execSync; const exec = require('child_process').execSync;
const STORAGE_PATH = path.join(__dirname, '../storage'); const STORAGE_PATH = path.join(__dirname, '../content');
const ROADMAPS_PATH = path.join(__dirname, '../storage/roadmaps'); const ROADMAPS_PATH = path.join(__dirname, '../content/roadmaps');
const META_FILE_PATH = path.join(__dirname, '../storage/roadmaps.json'); const META_FILE_PATH = path.join(__dirname, '../content/roadmaps.json');
const roadmapDirs = fs.readdirSync(ROADMAPS_PATH); const roadmapDirs = fs.readdirSync(ROADMAPS_PATH);
console.log(`[x] ${roadmapDirs.length} roadmaps found`); 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 roadmapDir = path.join(ROADMAPS_PATH, roadmapDirName);
const roadmapMeta = require(path.join(roadmapDir, 'meta.json')); 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 // 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 storage directory // 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 summaryFilePath = path.join(roadmapDir.replace(STORAGE_PATH, ''), '/0-About/0-Summary.md');
const contributors = exec(`git log --pretty=format:"%an%x09" ${roadmapDir} | uniq`) const contributors = exec(`git log --pretty=format:"%an%x09" ${roadmapDir} | uniq`)

@ -1,13 +1,13 @@
// This is a development script executed in the build step of pages // This is a development script executed in the build step of pages
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
const guides = require('../storage/guides'); const guides = require('../content/guides');
const roadmaps = require('../storage/roadmaps'); const roadmaps = require('../content/roadmaps');
const { getPageRoutes, getGuideRoutes } = require('./path-map'); const { getPageRoutes, getGuideRoutes } = require('./path-map');
const DOMAIN = 'https://roadmap.sh'; const DOMAIN = 'https://roadmap.sh';
const PAGES_DIR = path.join(__dirname, '../pages'); 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'; const SITEMAP_PATH = 'static/sitemap.xml';
// Set the header // Set the header

@ -1,13 +1,10 @@
const path = require('path'); const path = require('path');
const fs = require('fs'); const fs = require('fs');
const glob = require('glob'); const guides = require('../content/guides');
const guides = require('../storage/guides');
const roadmaps = require('../storage/roadmaps');
const { const {
getPageRoutes, getPageRoutes,
getGuideRoutes, getGuideRoutes,
getRoadmapRoutes
} = require("../scripts/path-map"); } = require("../scripts/path-map");
describe("Build scripts tests", () => { describe("Build scripts tests", () => {
@ -51,7 +48,7 @@ describe("Build scripts tests", () => {
guides.forEach(guide => { guides.forEach(guide => {
const [,, slug] = guide.url.split('/'); 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 : ''; const foundFile = fs.existsSync(expectedFile) ? expectedFile : '';
expect(foundFile).toEqual(expectedFile); expect(foundFile).toEqual(expectedFile);

Loading…
Cancel
Save