Rename storage directory
This commit is contained in:
1 parent
22e0006d6b
commit
083fd55f3e
72 files changed
+39
-41
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { AboutHeaderWrap } from './style';
|
||||
import siteConfig from "storage/site";
|
||||
import siteConfig from "content/site";
|
||||
|
||||
const AboutHeader = () => (
|
||||
<AboutHeaderWrap>
|
||||
|
||||
@@ -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 (
|
||||
<SummaryContainer>
|
||||
|
||||
@@ -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 = () => (
|
||||
<FaqContainer className='border-top bg-light'>
|
||||
|
||||
@@ -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 = () => (
|
||||
|
||||
@@ -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 (
|
||||
<GuideBodyWrap>
|
||||
<MdRenderer>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 = () => (
|
||||
|
||||
@@ -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 }) => (
|
||||
|
||||
@@ -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 (
|
||||
<SummaryContainer>
|
||||
|
||||
@@ -11,6 +11,7 @@ const SiteNav = () => (
|
||||
<div className='nav-links'>
|
||||
<a href='/roadmaps'>Roadmaps</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='/signup' className='signup'>Subscribe</a>
|
||||
</div>
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -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",
|
||||
@@ -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
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
import authors from "storage/authors";
|
||||
import authors from "content/authors";
|
||||
|
||||
export const findByUsername = (username) => authors.find(author => author.username === username) || {};
|
||||
+3
-3
@@ -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)
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import roadmaps from "storage/roadmaps";
|
||||
import roadmaps from "content/roadmaps";
|
||||
|
||||
export const getRequestedRoadmap = req => {
|
||||
const normalizedUrl = req.url.replace(/\/$/, '');
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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";
|
||||
|
||||
+2
-2
@@ -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';
|
||||
|
||||
|
||||
+3
-3
@@ -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`
|
||||
|
||||
@@ -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`)
|
||||
|
||||
+3
-3
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user