From 49b0021719534faee29a5a7f570ed166eff7d1af Mon Sep 17 00:00:00 2001 From: Laura Little <935915+marshmallowrobot@users.noreply.github.com> Date: Sun, 29 Jan 2023 18:11:22 -0500 Subject: [PATCH 1/2] fixed bug where VTT files were being picked up as article files --- scripts/get_article_files.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/get_article_files.js b/scripts/get_article_files.js index 798a3ee6..2b3f8afb 100644 --- a/scripts/get_article_files.js +++ b/scripts/get_article_files.js @@ -4,7 +4,7 @@ const { join } = require('path') module.exports = getArticleFiles = (path) => { return fs.readdirSync(path).reduce((articles, filename) => { const filePath = join(path, filename) - if (filePath.match(/\d\d/) && !filePath.includes('-script.asciidoc')) { + if (filePath.match(/\d\d[-\w]+(? { return articles } }, []) -} \ No newline at end of file +} From d8f92686c286131e558e2a76e5f9783660e20b63 Mon Sep 17 00:00:00 2001 From: Laura Little <935915+marshmallowrobot@users.noreply.github.com> Date: Sun, 29 Jan 2023 18:12:38 -0500 Subject: [PATCH 2/2] use default image path when article does not have a YouTube video code --- scripts/generate_learning_path_markdown.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/generate_learning_path_markdown.js b/scripts/generate_learning_path_markdown.js index 52f85861..d6e8396e 100644 --- a/scripts/generate_learning_path_markdown.js +++ b/scripts/generate_learning_path_markdown.js @@ -21,11 +21,11 @@ const getYouTubeCode = (section, articleNumber) => { return '' } -const getYouTubeImage = (youTubeCode) => { +const getArticleImage = (youTubeCode) => { if (youTubeCode) { return `https://img.youtube.com/vi/${youTubeCode}/mqdefault.jpg` } - return '' + return 'images/learn/LP-article-default.png' } (async () => { @@ -77,7 +77,7 @@ const getYouTubeImage = (youTubeCode) => { const frontMatter = { title: articleTitle, contributors, - image: getYouTubeImage(youtubeCode), + image: getArticleImage(youtubeCode), featured: weight === 1, weight, youtubeCode