diff --git a/.github/scripts/generate-faq.js b/.github/scripts/generate-faq.js index 84b22f4766..94ae4ee72f 100644 --- a/.github/scripts/generate-faq.js +++ b/.github/scripts/generate-faq.js @@ -1,10 +1,10 @@ const fs = require('fs'); const path = require('path'); + const { PAGE_NAME } = process.env; -const pageName = '${PAGE_NAME}'; -const directoryPath = path.join(process.env.GITHUB_WORKSPACE, `docs/_includes/${pageName}`); -const outputFile = path.join(process.env.GITHUB_WORKSPACE, `docs/_includes/generated-${pageName}.md`); +const directoryPath = path.join(process.env.GITHUB_WORKSPACE, `docs/_includes/${PAGE_NAME}`); +const outputFile = path.join(process.env.GITHUB_WORKSPACE, `docs/_includes/generated-${PAGE_NAME}.md`); try { fs.readdir(directoryPath, async function (err, files) { @@ -43,7 +43,7 @@ try { lastInitial = currentInitial; } - fileContent += `{{ include "${pageName}/${fileNameWithoutExtension}" }}\n\n`; + fileContent += `{{ include "${PAGE_NAME}/${fileNameWithoutExtension}" }}\n\n`; }); // Remove the last extra line and '---' diff --git a/.github/scripts/generate-rss.js b/.github/scripts/generate-rss.js index 576d15ad90..f781adf5bc 100644 --- a/.github/scripts/generate-rss.js +++ b/.github/scripts/generate-rss.js @@ -4,11 +4,7 @@ const RSS = require('rss'); const MarkdownIt = require('markdown-it'); const cheerio = require('cheerio'); -const { SITE_TITLE } = process.env; -const { SITE_URL } = process.env; - -const siteTitle = '${SITE_TITLE}'; -const siteUrl = '${SITE_URL}'; +const { SITE_TITLE, SITE_URL } = process.env; const md = new MarkdownIt({html: true}); @@ -19,7 +15,7 @@ function convertDateToRFC822(dateString) { } function generateUrl(title) { - return `${siteUrl}/#${title.toLowerCase().replace(/ /g, '-')}`; + return `${SITE_URL}/#${title.toLowerCase().replace(/ /g, '-')}`; } function entriesAreEqual(entry1, entry2) { @@ -46,11 +42,11 @@ if (fs.existsSync('docs/rss.xml')) { } const feed = new RSS({ - title: siteTitle, - description: `Latest News from ${siteTitle}`, - feed_url: `${siteUrl}/rss.xml`, - site_url: siteUrl, - generator: siteTitle, + title: SITE_TITLE, + description: `Latest News from ${SITE_TITLE}`, + feed_url: `${SITE_URL}/rss.xml`, + site_url: SITE_URL, + generator: SITE_TITLE, pubDate: oldFeedItems.length > 0 ? oldFeedItems[0].date : new Date(), });