diff --git a/.eleventy.js b/.eleventy.js index b55d8ad..f064d39 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -22,6 +22,16 @@ module.exports = function (eleventyConfig) { eleventyConfig.addPlugin(lazyImagesPlugin, { appendInitScript: false }); eleventyConfig.addPlugin(embedYouTube); + let p = {}; + console.log("environment is " + process.env.NODE_ENV); + if (process.env.NODE_ENV === "build") { + console.log("running in production"); + console.log("URL base is " + urlBase); + eleventyConfig.addPlugin(EleventyHtmlBasePlugin); + // this should be set + p = { pathPrefix: urlBase }; + } + // Return your Object options: eleventyConfig.addPassthroughCopy({ "./theme/assets": "assets" }); eleventyConfig.addPassthroughCopy({ "./img": "img" }); @@ -138,14 +148,6 @@ module.exports = function (eleventyConfig) { } }); - let p = {}; - if (process.env.NODE_ENV === "build") { - console.log("running in production"); - eleventyConfig.addPlugin(EleventyHtmlBasePlugin); - // this should be set - p = { pathPrefix: urlBase }; - } - return { ...p, passthroughFileCopy: true, diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 5fdd465..3d87b15 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -20,6 +20,10 @@ concurrency: group: "pages" cancel-in-progress: true +env: + NODE_ENV: build + BASE_URL: ${{ github.event.repository.name }} + jobs: # Single deploy job since we're just deploying build-and-deploy: