diff --git a/composer.json b/composer.json index f95e4e9..c2df9ce 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "amteich/kirby-twig": "^4.1", "sylvainjule/matomo": "^1.0", "kirbyzone/sitemapper": "^1.2", - "steirico/kirby-plugin-image-crop-field": "^2.0" + "mullema/k3-image-clip": "^3.0" }, "scripts": { "start": [ diff --git a/composer.lock b/composer.lock index 37f3898..3e87f3c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c5992525649c1061a4453492d2f429de", + "content-hash": "fac28f73cea5cec843631a10a9a4e395", "packages": [ { "name": "amteich/kirby-twig", @@ -299,65 +299,6 @@ ], "time": "2020-12-28T12:54:39+00:00" }, - { - "name": "gumlet/php-image-resize", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/gumlet/php-image-resize.git", - "reference": "39066a32de8476a32c9ac6322f9658021cee8638" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/gumlet/php-image-resize/zipball/39066a32de8476a32c9ac6322f9658021cee8638", - "reference": "39066a32de8476a32c9ac6322f9658021cee8638", - "shasum": "" - }, - "require": { - "ext-fileinfo": "*", - "ext-gd": "*", - "php": ">=5.6.0" - }, - "require-dev": { - "apigen/apigen": "^4.1", - "ext-exif": "*", - "ext-gd": "*", - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^8.5" - }, - "suggest": { - "ext-exif": "Auto-rotate jpeg files" - }, - "type": "library", - "autoload": { - "psr-4": { - "Gumlet\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Aditya Patadia", - "homepage": "http://aditya.patadia.org/" - } - ], - "description": "PHP class to re-size and scale images", - "homepage": "https://github.com/gumlet/php-image-resize", - "keywords": [ - "image", - "php", - "resize", - "scale" - ], - "support": { - "issues": "https://github.com/gumlet/php-image-resize/issues", - "source": "https://github.com/gumlet/php-image-resize/tree/2.0.2" - }, - "time": "2022-05-12T11:03:20+00:00" - }, { "name": "kirbyzone/sitemapper", "version": "1.2.1", @@ -569,6 +510,45 @@ }, "time": "2016-12-13T01:01:17+00:00" }, + { + "name": "mullema/k3-image-clip", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/mullema/k3-image-clip.git", + "reference": "ac6a4a461ae8972557da24755005a3937a275b0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mullema/k3-image-clip/zipball/ac6a4a461ae8972557da24755005a3937a275b0c", + "reference": "ac6a4a461ae8972557da24755005a3937a275b0c", + "shasum": "" + }, + "require": { + "getkirby/composer-installer": "^1.2" + }, + "type": "kirby-plugin", + "extra": { + "installer-name": "k3-image-clip" + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthias Müller", + "email": "moeli@moeli.com", + "homepage": "https://getkirby.com/plugins/mullema" + } + ], + "description": "Visual image clip for Kirby 3", + "support": { + "issues": "https://github.com/mullema/k3-image-clip/issues", + "source": "https://github.com/mullema/k3-image-clip/tree/3.0.0" + }, + "time": "2021-12-05T21:47:42+00:00" + }, { "name": "phpmailer/phpmailer", "version": "v6.5.4", @@ -697,58 +677,6 @@ }, "time": "2021-05-03T11:20:27+00:00" }, - { - "name": "steirico/kirby-plugin-image-crop-field", - "version": "2.0.5", - "source": { - "type": "git", - "url": "https://github.com/steirico/kirby-plugin-image-crop-field.git", - "reference": "f4f637112e28296070665885654415bb307e328a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/steirico/kirby-plugin-image-crop-field/zipball/f4f637112e28296070665885654415bb307e328a", - "reference": "f4f637112e28296070665885654415bb307e328a", - "shasum": "" - }, - "require": { - "getkirby/composer-installer": "^1.1", - "gumlet/php-image-resize": "2.0.*" - }, - "type": "kirby-plugin", - "autoload": { - "files": [ - "config.php" - ], - "classmap": [ - "fields/", - "lib/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Rico Steiner", - "email": "rico@vweb.ch" - } - ], - "description": "A image cropping field for kirby.", - "keywords": [ - "crop", - "field", - "image", - "kirby3", - "plugin" - ], - "support": { - "issues": "https://github.com/steirico/kirby-plugin-image-crop-field/issues", - "source": "https://github.com/steirico/kirby-plugin-image-crop-field/tree/v2.0.5" - }, - "time": "2021-11-01T15:57:43+00:00" - }, { "name": "sylvainjule/matomo", "version": "1.0.7", diff --git a/site/blueprints/files/meta_image.yml b/site/blueprints/files/meta_image.yml deleted file mode 100644 index db27e77..0000000 --- a/site/blueprints/files/meta_image.yml +++ /dev/null @@ -1,19 +0,0 @@ -title: Meta image -accept: - mime: image/jpeg, image/png -fields: - alt_text: - label: - en: Alternative text - fr: Texte alternatif - type: text - crop: - label: - en: Social networks image crop - fr: Recadrage pour les réseaux sociaux - type: imagecrop - minSize: - width: 1200 - height: 675 - preserveAspectRatio: true - width: 1/2 diff --git a/site/blueprints/sections/generic_seo_meta_image.yml b/site/blueprints/sections/generic_seo_meta_image.yml deleted file mode 100644 index cbefff7..0000000 --- a/site/blueprints/sections/generic_seo_meta_image.yml +++ /dev/null @@ -1,16 +0,0 @@ -headline: - en: Meta image - fr: Méta image -type: files -template: meta_image -layout: cards -size: small -image: - query: file.croppedImage - ratio: 16/9 - cover: false - back: white -max: 1 -help: - en: "Image displayed by social networks (format: JPEG or PNG)." - fr: "Image affichée par les réseaux sociaux (format : JPEG ou PNG)." diff --git a/site/blueprints/sections/generic_seo_metadata.yml b/site/blueprints/sections/generic_seo_metadata.yml index ec2000e..d7c9121 100644 --- a/site/blueprints/sections/generic_seo_metadata.yml +++ b/site/blueprints/sections/generic_seo_metadata.yml @@ -8,8 +8,32 @@ fields: size: small buttons: false help: - en: "Short description of the page displayed by search engines and social networks (recommended maximum length: 160 characters)." - fr: "Courte description de la page affichée par les moteurs de recherche et les réseaux sociaux (taille maximale conseillée : 160 caractères)." + en: "Short description of the page displayed by search engines and social networks (recommended maximum length: 160 characters). Home page meta description is used if this field is empty." + fr: "Courte description de la page affichée par les moteurs de recherche et les réseaux sociaux (taille maximale conseillée : 160 caractères). La méta description de la page d'accueil est utilisée si ce champ est vide." + width: 3/4 + gap: + type: gap + width: 1/4 + meta_image: + label: + en: Meta image + fr: Méta image + type: image-clip + query: page.images + uploads: image + layout: cards + image: + cover: true + back: white + multiple: false + clip: + minwidth: 1200 + minheight: 675 + ratio: fixed + help: + en: "Image displayed by social networks (format: JPEG or PNG). Home page meta image is used if this field is empty." + fr: "Image affichée par les réseaux sociaux (format : JPEG ou PNG). La méta image de la page d'accueil est utilisée si ce champ est vide." + width: 1/4 # Hidden fields og_type: type: hidden diff --git a/site/blueprints/sections/home_seo_metadata.yml b/site/blueprints/sections/home_seo_metadata.yml new file mode 100644 index 0000000..fda090a --- /dev/null +++ b/site/blueprints/sections/home_seo_metadata.yml @@ -0,0 +1,44 @@ +type: fields +fields: + meta_description: + label: + en: Meta description + fr: Méta description + type: textarea + size: small + buttons: false + required: true + help: + en: "Short description of the page displayed by search engines and social networks (recommended maximum length: 160 characters)." + fr: "Courte description de la page affichée par les moteurs de recherche et les réseaux sociaux (taille maximale conseillée : 160 caractères)." + width: 3/4 + gap: + type: gap + width: 1/4 + meta_image: + label: + en: Meta image + fr: Méta image + type: image-clip + query: page.images + layout: cards + image: + cover: true + back: white + multiple: false + required: true + clip: + minwidth: 1200 + minheight: 675 + ratio: fixed + help: + en: "Image displayed by social networks (format: JPEG or PNG)." + fr: "Image affichée par les réseaux sociaux (format : JPEG ou PNG)." + width: 1/4 + # Hidden fields + og_type: + type: hidden + default: article + twitter_card_type: + type: hidden + default: summary_large_image diff --git a/site/blueprints/tabs/about_seo.yml b/site/blueprints/tabs/about_seo.yml index 0c9eee2..4c5afb9 100644 --- a/site/blueprints/tabs/about_seo.yml +++ b/site/blueprints/tabs/about_seo.yml @@ -2,10 +2,5 @@ label: en: SEO fr: Référencement icon: search -columns: - - width: 3/4 - sections: - seo_basic_meta: sections/generic_seo_metadata - - width: 1/3 - sections: - seo_meta_image: sections/generic_seo_meta_image +sections: + seo_basic_meta: sections/generic_seo_metadata diff --git a/site/blueprints/tabs/gallery_seo.yml b/site/blueprints/tabs/gallery_seo.yml index 0c9eee2..4c5afb9 100644 --- a/site/blueprints/tabs/gallery_seo.yml +++ b/site/blueprints/tabs/gallery_seo.yml @@ -2,10 +2,5 @@ label: en: SEO fr: Référencement icon: search -columns: - - width: 3/4 - sections: - seo_basic_meta: sections/generic_seo_metadata - - width: 1/3 - sections: - seo_meta_image: sections/generic_seo_meta_image +sections: + seo_basic_meta: sections/generic_seo_metadata diff --git a/site/blueprints/tabs/home_seo.yml b/site/blueprints/tabs/home_seo.yml index 0c9eee2..b48b371 100644 --- a/site/blueprints/tabs/home_seo.yml +++ b/site/blueprints/tabs/home_seo.yml @@ -2,10 +2,5 @@ label: en: SEO fr: Référencement icon: search -columns: - - width: 3/4 - sections: - seo_basic_meta: sections/generic_seo_metadata - - width: 1/3 - sections: - seo_meta_image: sections/generic_seo_meta_image +sections: + seo_basic_meta: sections/home_seo_metadata diff --git a/site/snippets/metadata.twig b/site/snippets/metadata.twig index 13b795f..0e90dc7 100644 --- a/site/snippets/metadata.twig +++ b/site/snippets/metadata.twig @@ -29,10 +29,10 @@ -{% if page.images.template('meta_image') is not empty %} - -{% elseif site.homePage.images.template('meta_image') is not empty %} - +{% if page.meta_image is not empty %} + +{% elseif site.homePage.meta_image is not empty %} + {% endif %} {% if page.template != 'error' %} @@ -44,12 +44,12 @@ {% elseif site.homePage.meta_description is not empty %} {% endif %} - {% if page.images.template('meta_image') is not empty %} - + {% if page.meta_image is not empty %} + - {% elseif site.homePage.images.template('meta_image') is not empty %} - + {% elseif site.homePage.meta_image is not empty %} + {% endif %} @@ -64,10 +64,10 @@ {% elseif site.homePage.meta_description is not empty %} {% endif %} - {% if page.images.template('meta_image') is not empty %} - - {% elseif site.homePage.images.template('meta_image') is not empty %} - + {% if page.meta_image is not empty %} + + {% elseif site.homePage.meta_image is not empty %} + {% endif %} {% endif %}