Skip to content
Permalink
Browse files

Prefix generated dev pages with "dev-"

  • Loading branch information
stp-ip committed Dec 19, 2019
1 parent c9a3aa3 commit c697ff429b31e735447431f49685224153506c7d
Showing 677 changed files with 1,120 additions and 4,124 deletions.
@@ -1,5 +1,6 @@
const fs = require("fs");
const path = require("path");
const prefix = "dev";
const { indexTemplate, index, content, list } = require('./templates');

const root = path.resolve(`${__dirname}/../..`);
@@ -105,7 +106,7 @@ Object.keys(fragments).forEach(fragment => {
alignments.forEach(alignment => {
fs.createReadStream(fragments[fragment].nested[dir][filename]).pipe(
fs.createWriteStream(
`${paths.devAligns}/${fragment}/${dir}-${alignment}/${filename}`
`${paths.devAligns}/${prefix}-${fragment}/${dir}-${alignment}/${filename}`
)
);
});
@@ -122,21 +123,21 @@ function parseBlackFriday(fragment, weight, content, filename, dir) {
return false;
}

if (!fs.existsSync(`${paths.devAligns}/${fragment}`)) {
fs.mkdirSync(`${paths.devAligns}/${fragment}`);
if (!fs.existsSync(`${paths.devAligns}/${prefix}-${fragment}`)) {
fs.mkdirSync(`${paths.devAligns}/${prefix}-${fragment}`);
}

if (dir && !fs.existsSync(`${paths.devAligns}/${fragment}/${dir}`)) {
if (dir && !fs.existsSync(`${paths.devAligns}/${prefix}-${fragment}/${dir}`)) {
alignments.forEach(alignment => {
const path = `${paths.devAligns}/${fragment}/${dir}-${alignment}`;
const path = `${paths.devAligns}/${prefix}-${fragment}/${dir}-${alignment}`;
if (!fs.existsSync(path)) {
fs.mkdirSync(path);
}
});
}

fs.writeFile(
`${paths.devAligns}/${fragment}/index.md`,
`${paths.devAligns}/${prefix}-${fragment}/index.md`,
indexTemplate.replace(/%fragment%/g, fragment),
"utf8",
() => {}
@@ -155,7 +156,7 @@ function parseBlackFriday(fragment, weight, content, filename, dir) {

// Write the edited config into the fragment, whether it's in a nested directory or not
fs.writeFile(
`${paths.devAligns}/${fragment +
`${paths.devAligns}/${prefix}${fragment +
(dir ? `/${dir}-${alignment}` : "")}/${filename +
(dir ? "" : `-${alignment}`)}.md`,
tmp,
@@ -23,7 +23,7 @@ headless = true
const list = `+++
fragment = "list"
weight = 110
section = "dev/alignments"
section = "dev/dev-alignments"
count = 1000
summary = false
tiled = true
@@ -1,5 +1,6 @@
const fs = require("fs");
const path = require("path");
const prefix = "dev";
const { indexTemplate, index, content, list } = require('./templates');

const root = path.resolve(`${__dirname}/../..`);
@@ -104,7 +105,7 @@ Object.keys(fragments).forEach(fragment => {
backgrounds.forEach(background => {
fs.createReadStream(fragments[fragment].nested[dir][filename]).pipe(
fs.createWriteStream(
`${paths.devColors}/${fragment}/${dir}-${background}/${filename}`
`${paths.devColors}/${prefix}-${fragment}/${dir}-${background}/${filename}`
)
);
});
@@ -121,21 +122,21 @@ function parseBlackFriday(fragment, weight, content, filename, dir) {
return;
}

if (!fs.existsSync(`${paths.devColors}/${fragment}`)) {
fs.mkdirSync(`${paths.devColors}/${fragment}`);
if (!fs.existsSync(`${paths.devColors}/${prefix}-${fragment}`)) {
fs.mkdirSync(`${paths.devColors}/${prefix}-${fragment}`);
}

if (dir && !fs.existsSync(`${paths.devColors}/${fragment}/${dir}`)) {
if (dir && !fs.existsSync(`${paths.devColors}/${prefix}-${fragment}/${dir}`)) {
backgrounds.forEach(background => {
const path = `${paths.devColors}/${fragment}/${dir}-${background}`;
const path = `${paths.devColors}/${prefix}-${fragment}/${dir}-${background}`;
if (!fs.existsSync(path)) {
fs.mkdirSync(path);
}
});
}

fs.writeFile(
`${paths.devColors}/${fragment}/index.md`,
`${paths.devColors}/${prefix}-${fragment}/index.md`,
indexTemplate.replace(/%fragment%/g, fragment),
"utf8",
() => {}
@@ -146,7 +147,7 @@ function parseBlackFriday(fragment, weight, content, filename, dir) {
.replace(/background\s?=\s".*"/im, `background = "${background}"`)
.replace(/weight\s?=\s?"?\d+"?/im, `weight = ${weight + i}`);
fs.writeFile(
`${paths.devColors}/${fragment +
`${paths.devColors}/${prefix}-${fragment +
(dir ? `/${dir}-${background}` : "")}/${filename +
(dir ? "" : `-${background}`)}.md`,
tmp,
@@ -23,7 +23,7 @@ headless = true
const list = `+++
fragment = "list"
weight = 110
section = "dev/colors"
section = "dev/dev-colors"
count = 1000
summary = false
tiled = true
@@ -1,7 +1,7 @@
+++
fragment = "list"
weight = 110
section = "dev/alignments"
section = "dev/dev-alignments"
count = 1000
summary = false
tiled = true

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit c697ff4

Please sign in to comment.
You can’t perform that action at this time.