mirror of
https://github.com/Start9Labs/start9.com.git
synced 2026-03-30 20:14:50 +00:00
fix proxy.pac deployment and clean up dead passthroughs
- Add post-build step to copy proxy.pac into _site/assets/ since the Slinkity production build crashes before passthrough copies complete - Remove dead videos passthrough (directory doesn't exist) - Remove redundant images passthrough (Vite handles these via imports) - Format .eleventy.js (consistent quotes, semicolons, trailing newline) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
37
.eleventy.js
37
.eleventy.js
@@ -1,40 +1,39 @@
|
|||||||
const faviconPlugin = require("eleventy-plugin-gen-favicons");
|
const faviconPlugin = require("eleventy-plugin-gen-favicons");
|
||||||
const format = require('date-fns/format')
|
const format = require("date-fns/format");
|
||||||
const pluginSEO = require("eleventy-plugin-seo");
|
const pluginSEO = require("eleventy-plugin-seo");
|
||||||
const tinysvg = require('@sardine/eleventy-plugin-tinysvg');
|
const tinysvg = require("@sardine/eleventy-plugin-tinysvg");
|
||||||
const slinkity = require('slinkity')
|
const slinkity = require("slinkity");
|
||||||
|
|
||||||
// for 404 callback
|
// for 404 callback
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const NOT_FOUND_PATH = "_site/404.html";
|
const NOT_FOUND_PATH = "_site/404.html";
|
||||||
|
|
||||||
module.exports = function (eleventyConfig) {
|
module.exports = function (eleventyConfig) {
|
||||||
eleventyConfig.addPassthroughCopy('./src/assets/images/');
|
eleventyConfig.addPassthroughCopy("./src/assets/proxy.pac");
|
||||||
eleventyConfig.addPassthroughCopy('./src/assets/videos/');
|
eleventyConfig.addPassthroughCopy("public");
|
||||||
eleventyConfig.addPassthroughCopy('./src/assets/proxy.pac');
|
|
||||||
eleventyConfig.addPassthroughCopy('public')
|
|
||||||
|
|
||||||
// plugins
|
// plugins
|
||||||
eleventyConfig.addPlugin(faviconPlugin, { outputDir: './public' });
|
eleventyConfig.addPlugin(faviconPlugin, { outputDir: "./public" });
|
||||||
eleventyConfig.addPlugin(slinkity.plugin, slinkity.defineConfig({}))
|
eleventyConfig.addPlugin(slinkity.plugin, slinkity.defineConfig({}));
|
||||||
eleventyConfig.addPlugin(pluginSEO, require("./src/_data/seo.json"));
|
eleventyConfig.addPlugin(pluginSEO, require("./src/_data/seo.json"));
|
||||||
eleventyConfig.addPlugin(tinysvg, {
|
eleventyConfig.addPlugin(tinysvg, {
|
||||||
baseUrl: 'src/_includes/svgs/',
|
baseUrl: "src/_includes/svgs/",
|
||||||
});
|
});
|
||||||
|
|
||||||
// filters
|
// filters
|
||||||
eleventyConfig.addFilter('date', function (date, dateFormat) {
|
eleventyConfig.addFilter("date", function (date, dateFormat) {
|
||||||
return format(date, dateFormat)
|
return format(date, dateFormat);
|
||||||
})
|
});
|
||||||
|
|
||||||
// 404 callback
|
// 404 callback
|
||||||
eleventyConfig.setBrowserSyncConfig({
|
eleventyConfig.setBrowserSyncConfig({
|
||||||
callbacks: {
|
callbacks: {
|
||||||
ready: function(err, bs) {
|
ready: function (err, bs) {
|
||||||
|
|
||||||
bs.addMiddleware("*", (req, res) => {
|
bs.addMiddleware("*", (req, res) => {
|
||||||
if (!fs.existsSync(NOT_FOUND_PATH)) {
|
if (!fs.existsSync(NOT_FOUND_PATH)) {
|
||||||
throw new Error(`Expected a \`${NOT_FOUND_PATH}\` file but could not find one. Did you create a 404.html template?`);
|
throw new Error(
|
||||||
|
`Expected a \`${NOT_FOUND_PATH}\` file but could not find one. Did you create a 404.html template?`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const content_404 = fs.readFileSync(NOT_FOUND_PATH);
|
const content_404 = fs.readFileSync(NOT_FOUND_PATH);
|
||||||
@@ -44,11 +43,11 @@ module.exports = function (eleventyConfig) {
|
|||||||
res.write(content_404);
|
res.write(content_404);
|
||||||
res.end();
|
res.end();
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
dir: { input: "src", output: "_site", data: "_data" },
|
dir: { input: "src", output: "_site", data: "_data" },
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
5
.github/workflows/deploy.yml
vendored
5
.github/workflows/deploy.yml
vendored
@@ -31,6 +31,11 @@ jobs:
|
|||||||
npm run build || true
|
npm run build || true
|
||||||
test -f _site/index.html
|
test -f _site/index.html
|
||||||
|
|
||||||
|
- name: Copy passthrough files missed by broken Slinkity build
|
||||||
|
run: |
|
||||||
|
mkdir -p _site/assets
|
||||||
|
cp src/assets/proxy.pac _site/assets/proxy.pac
|
||||||
|
|
||||||
- name: Configure SSH
|
- name: Configure SSH
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
|
|||||||
Reference in New Issue
Block a user