From db6eda37a4fe5ed70232f4be1ffbcd20916eebd8 Mon Sep 17 00:00:00 2001 From: Stefan Date: Sat, 30 Nov 2024 14:58:14 +0000 Subject: [PATCH] Add canonical tag for the www version --- .eleventy.js | 10 ++++++---- _includes/head.html | 37 ++++++++++++++++++------------------- package.json | 1 + 3 files changed, 25 insertions(+), 23 deletions(-) create mode 120000 package.json diff --git a/.eleventy.js b/.eleventy.js index 7d49567..e53fe32 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -9,11 +9,13 @@ const placeImages = fg.sync([ const Image = require("@11ty/eleventy-img"); module.exports = function (config) { + config.addGlobalData("siteUrl", "https://www.veganprestwich.co.uk"); + config.addShortcode("image", async (src, alt, sizes) => { let metadata = await Image(src, { widths: [150, 300], formats: ["webp", "jpeg"], - outputDir: "./_site/img/" + outputDir: "./_site/img/", }); let imageAttributes = { @@ -49,15 +51,15 @@ module.exports = function (config) { config.addCollection("sorted_places", (api) => sortedPlaces(api)); config.addCollection("shops", (api) => - sortedPlaces(api).filter((a) => a.data.permalink && a.data.shop) + sortedPlaces(api).filter((a) => a.data.permalink && a.data.shop), ); config.addCollection("restaurants", (api) => - sortedPlaces(api).filter((a) => a.data.permalink && a.data.restaurant) + sortedPlaces(api).filter((a) => a.data.permalink && a.data.restaurant), ); config.addCollection("deliveries", (api) => - sortedPlaces(api).filter((a) => a.data.permalink && a.data.delivery) + sortedPlaces(api).filter((a) => a.data.permalink && a.data.delivery), ); config.addWatchTarget("./style/style.scss"); diff --git a/_includes/head.html b/_includes/head.html index ae58a99..dc5e145 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -1,26 +1,25 @@ - - - - - - {% capture styles %} - {% include "../_site/style/style.css" %} - {% endcapture %} + + + + + + {% capture styles %} {% include "../_site/style/style.css" %} {% endcapture %} - {%- if metaTitle %} - {{ metaTitle | escape }} - {%- elsif name %} - {{ name | escape }}, Prestwich - {%- elsif title %} - {{ title | escape }}, Prestwich - {%- else %} - {{ site.title | escape }} - {%- endif %} + {%- if metaTitle %} {{ metaTitle | escape }} {%- elsif name %} {{ name | + escape }}, Prestwich {%- elsif title %} {{ title | escape }}, Prestwich {%- + else %} {{ site.title | escape }} {%- endif %} - - + + + diff --git a/package.json b/package.json new file mode 120000 index 0000000..c113178 --- /dev/null +++ b/package.json @@ -0,0 +1 @@ +/nix/store/jxdir18sxqlflsgf5xva89hwgdxyj610-package.json \ No newline at end of file