Skip to content

Commit

Permalink
Merge pull request #4 from klalicki/feature_bg-images
Browse files Browse the repository at this point in the history
adds code to make it build on other URLs other than root
  • Loading branch information
klalicki authored Mar 14, 2024
2 parents b634387 + 26effb5 commit f282dda
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const fs = require("fs");
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
const lazyImagesPlugin = require("eleventy-plugin-lazyimages");
const embedYouTube = require("eleventy-plugin-youtube-embed");
const { EleventyHtmlBasePlugin } = require("@11ty/eleventy");
const urlBase = process.env.BASE_URL || "";

const markdownItOptions = {
html: true,
Expand Down Expand Up @@ -136,7 +138,16 @@ 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,
dir: {
input: "content/pages",
Expand Down

0 comments on commit f282dda

Please sign in to comment.