From 56e10a559130a366b81d1a5f96051beeb2755fa7 Mon Sep 17 00:00:00 2001 From: madrilene Date: Wed, 31 Jan 2024 10:54:16 +0100 Subject: [PATCH] change meta structure --- src/_data/meta.js | 28 ++++++++++++----------- src/_includes/partials/meta-info.njk | 6 ++--- src/_includes/schemas/blogpost-schema.njk | 6 ++--- src/_layouts/post.njk | 6 ++--- src/common/404.md | 2 +- src/common/feed.njk | 4 ++-- src/common/humans.njk | 11 ++++----- src/posts/2023-01-25-opengraph-images.md | 6 ++--- 8 files changed, 35 insertions(+), 34 deletions(-) diff --git a/src/_data/meta.js b/src/_data/meta.js index 4355b44..814f76b 100644 --- a/src/_data/meta.js +++ b/src/_data/meta.js @@ -7,21 +7,23 @@ module.exports = { locale: 'en_EN', lang: 'en', skipContent: 'Skip to content', - author: 'Lene Saile', // i.e. Lene Saile - page / blog author's name. Must be set. - authorAvatar: '/favicon.png', // for h-card, defaults to favicon - authorEmail: '', // i.e. hola@lenesaile.com - email of the author - authorWebsite: '', // i.e. https.://www.lenesaile.com - the personal site of the author - creator: 'Lene Saile', // i.e. Lene Saile - creator's (developer) name. - creatorEmail: 'hola@lenesaile.com', // i.e. hola@lenesaile.com - creatorWebsite: 'https://www.lenesaile.com', // i.e. https.://www.lenesaile.com - creatorSocial: 'https://front-end.social/@lene', // i.e. https.://www.lenesaile.com + author: { + name: 'Lene Saile', // i.e. Lene Saile - page / blog author's name. Must be set. + avatar: '/favicon.png', + email: 'hola@lenesaile.com', // i.e. hola@lenesaile.com - email of the author + website: 'https.://www.lenesaile.com' // i.e. https.://www.lenesaile.com - the personal site of the author + }, + creator: { + name: 'Lene Saile', // i.e. Lene Saile - creator's (developer) name. + email: 'hola@lenesaile.com', + website: 'https://www.lenesaile.com', + social: 'https://front-end.social/@lene' + }, themeColor: '#DD4462', // Manifest: defines the default theme color for the application themeBgColor: '#FBFBFB', // Manifest: defines a placeholder background color for the application page to display before its stylesheet is loaded - meta_data: { - opengraph_default: '/assets/images/template/opengraph-default.jpg', // fallback/default meta image - opengraph_default_alt: - 'Visible content: Eleventy starter based on workflow for Cube CSS, Every Layout, Design Tokens and Tailwind for uitility, based on the concepts explained in buildexcellentwebsit.es' // alt text for default meta image - }, + opengraph_default: '/assets/images/template/opengraph-default.jpg', // fallback/default meta image + opengraph_default_alt: + 'Visible content: Eleventy starter based on workflow for Cube CSS, Every Layout, Design Tokens and Tailwind for uitility, based on the concepts explained in buildexcellentwebsit.es', // alt text for default meta image blog: { // this is for the rss feed name: 'My Web Development Blog', diff --git a/src/_includes/partials/meta-info.njk b/src/_includes/partials/meta-info.njk index bd11e0b..0a73cdc 100644 --- a/src/_includes/partials/meta-info.njk +++ b/src/_includes/partials/meta-info.njk @@ -48,12 +48,12 @@ content="{{ meta.url }}{% if (layout == 'post') %}/assets/og-images/{{ title | slugify }}-preview.jpeg - {% else %}{{ meta.meta_data.opengraph_default }} + {% else %}{{ meta.opengraph_default }} {% endif %}" /> - + diff --git a/src/_includes/schemas/blogpost-schema.njk b/src/_includes/schemas/blogpost-schema.njk index e7d915d..9966c3a 100644 --- a/src/_includes/schemas/blogpost-schema.njk +++ b/src/_includes/schemas/blogpost-schema.njk @@ -11,16 +11,16 @@ "@id": "{{ url }}", "headline": "{{ title or meta.siteName }}", "description": "{{ discover.description or description or meta.siteDescription }}", - "image": "{{ meta.url }}{% if discover.image %}/assets/images/{{ discover.image }}{% else %}{{ meta.meta_data.opengraph_default }}{% endif %}", + "image": "{{ meta.url }}{% if discover.image %}/assets/images/{{ discover.image }}{% else %}{{ meta.opengraph_default }}{% endif %}", "inLanguage": "{{ meta.locale }}", "publisher": { "@type": "{{ meta.siteType }}", - "name": "{{ meta.author }}", + "name": "{{ meta.author.name }}", "url": "{{ meta.url }}" }, "author": { "@type": "Person", - "name": "{{ meta.author }}" + "name": "{{ meta.author.name }}" }, "datePublished": "{{ date | toIsoString }}" } diff --git a/src/_layouts/post.njk b/src/_layouts/post.njk index 5c106e6..24c4133 100644 --- a/src/_layouts/post.njk +++ b/src/_layouts/post.njk @@ -35,11 +35,11 @@ schema: blog diff --git a/src/common/404.md b/src/common/404.md index fd97b2e..50a201c 100644 --- a/src/common/404.md +++ b/src/common/404.md @@ -12,4 +12,4 @@ noindex: true [Please try visiting the home page!](/) Please let me know if you encounter more errors: -{{ meta.creatorEmail }} +{{ meta.creator.email }} diff --git a/src/common/feed.njk b/src/common/feed.njk index 06e3b27..c16b10d 100644 --- a/src/common/feed.njk +++ b/src/common/feed.njk @@ -13,8 +13,8 @@ excludeFromSitemap: true {{ postslist | getNewestCollectionItemDate | dateToRfc3339 }} {{ meta.url }}/ - {{ meta.author }} - {{ meta.authorEmail }} + {{ meta.author.name }} + {{ meta.author.email }} {%- for post in postslist %} {%- set absolutePostUrl = post.url | absoluteUrl(meta.url) %} diff --git a/src/common/humans.njk b/src/common/humans.njk index 495f100..f1ff80f 100644 --- a/src/common/humans.njk +++ b/src/common/humans.njk @@ -3,13 +3,12 @@ permalink: /humans.txt eleventyExcludeFromCollections: true excludeFromSitemap: true --- - /* TEAM */ -Developer: {{ meta.creator }} -Contact: {{ meta.creatorEmail }} -Site: {{ meta.creatorWebsite }} -{% if meta.creatorSocial %} -Find me on: {{ meta.creatorSocial }}{% endif %} +Developer: {{ meta.creator.name }} +Contact: {{ meta.creator.email }} +Site: {{ meta.creator.website }} +{% if meta.creator.social %} +Find me on: {{ meta.creator.social }}{% endif %} /* SITE */ Doctype: HTML5 diff --git a/src/posts/2023-01-25-opengraph-images.md b/src/posts/2023-01-25-opengraph-images.md index fc75df4..9d96972 100644 --- a/src/posts/2023-01-25-opengraph-images.md +++ b/src/posts/2023-01-25-opengraph-images.md @@ -21,12 +21,12 @@ The fallback and default image for all other pages is the image set as `opengrap ``` {% endraw %} -To change the look and behaviour of those images and replace the SVG background edit `src/social-preview.njk`. The implementation is based on [Bernard Nijenhuis article](https://bnijenhuis.nl/notes/automatically-generate-open-graph-images-in-eleventy/). +To change the look and behaviour of those images and replace the SVG background edit `src/common/og-images.njk`. The implementation is based on [Bernard Nijenhuis article](https://bnijenhuis.nl/notes/automatically-generate-open-graph-images-in-eleventy/).