fixed meta url

This commit is contained in:
madrilene 2022-11-15 09:42:48 +01:00
parent 712ee9d966
commit cf53bab1a8
10 changed files with 36 additions and 31 deletions

1
.prettierignore Normal file
View file

@ -0,0 +1 @@
src/assets/helperfiles/*

View file

@ -1,11 +1,12 @@
const package = require('../../package.json');
module.exports = {
pkv: package.version || 'v1',
url: process.env.URL || 'http://localhost:8080',
siteName: 'Eleventy Excellent',
siteDescription:
"Eleventy starter based on the workflow suggested by Andy Bell's https://buildexcellentwebsit.es/.",
siteType: 'Person', // schema
siteURL: 'https://eleventy-excellent.netlify.app',
locale: 'en_EN',
lang: 'en',
skipContent: 'Skip to content',
@ -33,7 +34,5 @@ module.exports = {
},
menu: {
closedText: 'Menu'
},
env: process.env.ELEVENTY_ENV === 'production',
pkv: package.version || 'v1'
}
};

View file

@ -22,7 +22,7 @@
<!-- Disable automatic detection and formatting of possible phone numbers -->
<meta name="format-detection" content="telephone=no" />
<!-- Helps prevent duplicate content issues -->
<link rel="canonical" href="{{ meta.siteURL }}{{ page.url }}" />
<link rel="canonical" href="{{ meta.url }}{{ page.url }}" />
<title>
{% if seo.title %} {{ seo.title }}
@ -47,7 +47,7 @@
<meta name="generator" content="Eleventy" />
<!-- Facebook Open Graph meta -->
<meta property="og:url" content="{{ meta.siteURL }}{{ page.url }}" />
<meta property="og:url" content="{{ meta.url }}{{ page.url }}" />
<meta property="og:type" content="website" />
<meta
property="og:title"
@ -57,7 +57,7 @@
<meta
property="og:image"
content="{% if meta.env == 'production' %}{{
meta.siteURL
meta.url
}}{% endif %}{% if featured_image %}{{ featured_image | replace('./src', '') }}{% else %}{{
meta.meta_data.opengraph_default
}}{% endif %}"

View file

@ -1,15 +1,15 @@
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebSite",
"@id": "{{ meta.siteURL }}#website",
"url": "{{ meta.siteURL }}",
"name": "{{ meta.siteName }}",
"description": "{{ meta[locale].metaDescription }}",
"inLanguage": "{{ meta[locale].localeCode }}"
}
]
}
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebSite",
"@id": "{{ meta.url }}#website",
"url": "{{ meta.url }}",
"name": "{{ meta.siteName }}",
"description": "{{ meta[locale].metaDescription }}",
"inLanguage": "{{ meta[locale].localeCode }}"
}
]
}
</script>

View file

@ -6,7 +6,7 @@
"@type": "WebPage"
},
"isPartOf": {
"@id": "{{ meta.siteURL }}#website"
"@id": "{{ meta.url }}#website"
},
"@id": "{{ url }}",
"headline": "{{ title or meta.siteName }}",
@ -16,7 +16,7 @@
"publisher": {
"@type": "{{ meta.siteType }}",
"name": "{{ meta.authorName }}",
"url": "{{ meta.siteURL }}"
"url": "{{ meta.url }}"
},
"author": {
"@type": "Person",

View file

@ -5,7 +5,7 @@
"@type": "WebPage"
},
"isPartOf": {
"@id": "{{ meta.siteURL }}#website"
"@id": "{{ meta.url }}#website"
},
"headline": "{{ title or meta.siteName }}",
"description": "{{ seo.description or meta.siteDescription }}",
@ -14,7 +14,7 @@
"publisher": {
"@type": "{{ meta.siteType }}",
"name": "{{ meta.authorName }}",
"url": "{{ meta.siteURL }}"
"url": "{{ meta.url }}"
}
}
</script>

View file

@ -42,7 +42,7 @@
{% endfor %} {% endif %}
<!-- include base schema -->
{%- include "schemas/base-schema.njk" %}
{% include "schemas/base-schema.njk" %}
</head>
<body>

View file

@ -4,6 +4,12 @@ eleventyExcludeFromCollections: true
excludeFromSitemap: true
---
/* TEAM */ Developer: {{ meta.author }} Contact: {{ meta.authorEmail }} Site:
{{ meta.siteURL }} {% if meta.meta_data.twitterCreator %}Twitter:
{{ meta.meta_data.twitterCreator }}{% endif %} /* SITE */ Doctype: HTML5
/* TEAM */
Developer: {{ meta.author }}
Contact: {{ meta.authorEmail }}
Site: {{ meta.authorWebsite }}
{% if meta.meta_data.twitterCreator %}
Twitter: {{ meta.meta_data.twitterCreator }}{% endif %}
/* SITE */
Doctype: HTML5

View file

@ -5,5 +5,4 @@ excludeFromSitemap: true
---
User-agent: *
Disallow: /404.html
Disallow: /google35901daa0ceb7399.html
Sitemap: {{ meta.siteURL }}/sitemap.xml
Sitemap: {{ meta.url }}/sitemap.xml

View file

@ -13,7 +13,7 @@ excludeFromSitemap: true
{% endif %}
<url>
<loc>{{ meta.siteURL }}{{ page.url }}</loc>
<loc>{{ meta.url }}{{ page.url }}</loc>
<lastmod>{{ lastmod | toIsoString }}</lastmod>
</url>
{% endif %}