Add canonical tag for the www version

This commit is contained in:
Stefan 2024-11-30 14:58:14 +00:00
parent de1b3b8d13
commit db6eda37a4
3 changed files with 25 additions and 23 deletions

View file

@ -9,11 +9,13 @@ const placeImages = fg.sync([
const Image = require("@11ty/eleventy-img"); const Image = require("@11ty/eleventy-img");
module.exports = function (config) { module.exports = function (config) {
config.addGlobalData("siteUrl", "https://www.veganprestwich.co.uk");
config.addShortcode("image", async (src, alt, sizes) => { config.addShortcode("image", async (src, alt, sizes) => {
let metadata = await Image(src, { let metadata = await Image(src, {
widths: [150, 300], widths: [150, 300],
formats: ["webp", "jpeg"], formats: ["webp", "jpeg"],
outputDir: "./_site/img/" outputDir: "./_site/img/",
}); });
let imageAttributes = { let imageAttributes = {
@ -49,15 +51,15 @@ module.exports = function (config) {
config.addCollection("sorted_places", (api) => sortedPlaces(api)); config.addCollection("sorted_places", (api) => sortedPlaces(api));
config.addCollection("shops", (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) => 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) => 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"); config.addWatchTarget("./style/style.scss");

View file

@ -1,26 +1,25 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="max-image-preview:large"> <meta name="robots" content="max-image-preview:large" />
<meta name="generator" content="Eleventy"> <meta name="generator" content="Eleventy" />
{% capture styles %} {% capture styles %} {% include "../_site/style/style.css" %} {% endcapture %}
{% include "../_site/style/style.css" %}
{% endcapture %}
<style> <style>
{{ styles }} {{ styles }}
</style> </style>
<title> <title>
{%- if metaTitle %} {%- if metaTitle %} {{ metaTitle | escape }} {%- elsif name %} {{ name |
{{ metaTitle | escape }} escape }}, Prestwich {%- elsif title %} {{ title | escape }}, Prestwich {%-
{%- elsif name %} else %} {{ site.title | escape }} {%- endif %}
{{ name | escape }}, Prestwich
{%- elsif title %}
{{ title | escape }}, Prestwich
{%- else %}
{{ site.title | escape }}
{%- endif %}
</title> </title>
<meta name="description" content="{{ excerpt | default: site.description | strip_html | truncate: 160 | escape }}"> <meta
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>💚</text></svg>" /> name="description"
content="{{ excerpt | default: site.description | strip_html | truncate: 160 | escape }}"
/>
<link
rel="icon"
href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>💚</text></svg>"
/>
<link rel="canonical" href="{{ siteUrl }}{{ page.url }}" />
</head> </head>

1
package.json Symbolic link
View file

@ -0,0 +1 @@
/nix/store/jxdir18sxqlflsgf5xva89hwgdxyj610-package.json