Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
EndangeredMassa committed Jan 15, 2024
1 parent ac0c51a commit 40a7b13
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
12 changes: 1 addition & 11 deletions app/article-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,7 @@ let articles =
"published": true,
"title": "Detangling the Standup: Status Reports, Team Planning, Context Sharing, and Community Building",
"date": "2022-01-04",
"description": `Standups are often applied without understanding the problem they are solving. This leads to:
<br>
<ol>
<li>Not clearly solving a specific problem</li>
<li>Not solving a problem with the best solution</li>
<li>A daily interruption to deep work</li>
</ol>
What follows is a pragmatic and ideal approach to resolving this situation.
The pragmatic approach is to understand so you can excel within that system.
The ideal solution tries to change the system to better serve the team.
`
"description": "Standups are often applied without understanding the problem they are solving. This leads to:<br><ol><li>Not clearly solving a specific problem</li><li>Not solving a problem with the best solution</li><li>A daily interruption to deep work</li></ol>What follows is a pragmatic and ideal approach to resolving this situation. The pragmatic approach is to understand so you can excel within that system. The ideal solution tries to change the system to better serve the team."
},
{
"slug": "detangling-the-manager",
Expand Down
13 changes: 11 additions & 2 deletions lib/scan-dir.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
let fs = require('fs');
let { join } = require('path');

function tryParseJSON(jsonText, originalFilePath) {
try {
return JSON.parse(jsonText);
} catch (error) {
console.log(`JSON Parse Error of "${originalFilePath}": ${error.message}\nText:\n${jsonText}`);
}
}

module.exports = async function ({ distDir, visit }) {
/*
We haev to convert the module format into json because no other mechanism for
share this data worked between ember build (node, commonjs) and the
project code (browser, module).
*/
let articleData = fs.readFileSync(join(__dirname, '/../app/article-data.js')).toString();
let articlePath = join(__dirname, '/../app/article-data.js');
let articleData = fs.readFileSync(articlePath).toString();
let trimmedArticleData = articleData
.replace('let articles =', '')
.replace('export default articles;', '');
let articles = JSON.parse(trimmedArticleData);
let articles = tryParseJSON(trimmedArticleData, articlePath);
let articleUrls = articles.map((a) => {
return '/blog/' + a.slug.replace(/\./g, '/');
});
Expand Down

0 comments on commit 40a7b13

Please sign in to comment.