Rename storage directory

This commit is contained in:
Kamran Ahmed
2020-01-18 22:47:48 +04:00
parent b97ae52a1b
commit a26945288b
72 changed files with 39 additions and 41 deletions

View File

@@ -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`

View File

@@ -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`)

View File

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