From 7803df674cda4d2f4a1c246c98ef84365110150f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20=E2=80=9CAd=C3=A6dra=E2=80=9D=20Hamel?= Date: Wed, 12 Jun 2024 20:51:19 +0200 Subject: [PATCH] Move SVG out of assets --- gulpfile.js | 3 ++- src/index.pug | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 19693ab..46ac231 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -145,7 +145,8 @@ export const articles = () => export const images = () => src("src/*.avif", { encoding: false }).pipe(dest("dist/_assets/")); -export const svg = () => src("src/*.svg").pipe(dest("dist/_assets/")); +// SVG use has no way of allowing cross-origin, so we need to keep them with the HTML files. +export const svg = () => src("src/*.svg").pipe(dest("dist/")); export const css = () => src("src/index.css").pipe(postcss()).pipe(dest("dist/_assets/")); diff --git a/src/index.pug b/src/index.pug index 3779100..e9bfe47 100644 --- a/src/index.pug +++ b/src/index.pug @@ -17,8 +17,8 @@ ul.index-list h2 Find me elsewhere ul.index-list li: a(href="https://gitea.adaedra.eu/adaedra" target="_blank") - svg(xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" aria-label="Gitea Logo"): use(href=`${asset("logos.svg")}#gitea`)/ + svg(xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" aria-label="Gitea Logo"): use(href="/logos.svg#gitea")/ | Gitea li: a(href="https://nerdculture.de/@adaedra" target="_blank" rel="noopener") - svg(xmlns="http://www.w3.org/2000/svg" viewBox="0 0 74 79" aria-label="Mastodon Logo"): use(href=`${asset("logos.svg")}#mastodon`)/ + svg(xmlns="http://www.w3.org/2000/svg" viewBox="0 0 74 79" aria-label="Mastodon Logo"): use(href="/logos.svg#mastodon")/ | Mastodon