Skip to content

Commit

Permalink
fix(core): correct invalid path to README
Browse files Browse the repository at this point in the history
  • Loading branch information
bandantonio committed Dec 23, 2021
1 parent 01a099d commit 4bcb35b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/common/prepare-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,14 @@ let buildStaticFiles = async () => {
removeOutputDirectory();
const templatesPath = path.join(process.cwd() + '/views');
let generatedContent = await buildContent();
let sidebarListOfPages = generatedContent.allPages.filter(page => page.link !== 'index');
let sidebarListOfPages = generatedContent.allPages.filter(page => page.name !== 'README');
console.log(sidebarListOfPages);
try {
let items = await fsp.readdir(templatesPath);
items.filter(item => path.extname(item) == '.ejs').forEach(template => {
if (template == 'page.ejs') {
let compiledTemplate = compileTemplate(templatesPath, template);
let pageContent = generatedContent.htmlContent.filter(content => content.name !== 'index');
let pageContent = generatedContent.htmlContent.filter(content => content.name !== 'README');
pageContent.forEach(page => {
let readyHtml = compiledTemplate({
name: page.name,
Expand All @@ -111,7 +112,7 @@ let buildStaticFiles = async () => {
})
} else if (template == 'index.ejs') {
let compiledTemplate = compileTemplate(templatesPath, template);
let indexPage = generatedContent.htmlContent.find(content => content.name == 'index');
let indexPage = generatedContent.htmlContent.find(content => content.name == 'README');
if (indexPage) {
let readyHtml = compiledTemplate({
name: indexPage.name,
Expand Down

0 comments on commit 4bcb35b

Please sign in to comment.