Skip to content

Commit

Permalink
Fix paths for github pages deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
mraerino committed Jun 8, 2024
1 parent 6a60c86 commit 88a90e5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const CleanCSS = require("clean-css");
const yaml = require("js-yaml");
const Image = require("@11ty/eleventy-img");
const { EleventyHtmlBasePlugin } = require("@11ty/eleventy");

/**
* @template T
Expand All @@ -18,6 +19,8 @@ const Image = require("@11ty/eleventy-img");
* @type {(eleventyConfig: EleventyConfig) => RecursivePartial<EleventyReturnValue>}
*/
module.exports = function (config) {
config.addPlugin(EleventyHtmlBasePlugin);

config.addFilter("cssmin", function (code) {
return new CleanCSS({}).minify(code).styles;
});
Expand Down Expand Up @@ -54,5 +57,6 @@ module.exports = function (config) {
data: "../data",
output: "dist",
},
pathPrefix: process.env.ELEVENTY_PATH_PREFIX,
};
};
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jobs:
build:
name: Build
runs-on: ubuntu-24.04
env:
ELEVENTY_PATH_PREFIX: website
steps:
- uses: actions/checkout@v4
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion layouts/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ header {
var(--color-bg) 1rem,
rgba(255, 255, 255, 0) 6rem
),
url("/assets/hero.jpg");
url("{{ '/assets/hero.jpg' | htmlBaseUrl }}");
background-size: cover;
background-position: center;
width: 100%;
Expand Down

0 comments on commit 88a90e5

Please sign in to comment.