From eb48cfa2bf595fc6ecbc34c8beb245a07b5beeab Mon Sep 17 00:00:00 2001 From: bach Date: Tue, 20 Sep 2022 10:39:35 +0200 Subject: [PATCH] fixed home metatags #1903 --- composer.json | 1 + composer.lock | 68 ++++++++++++++++++- config/sync/core.extension.yml | 1 + config/sync/metatag.metatag_defaults.403.yml | 12 ++++ config/sync/metatag.metatag_defaults.404.yml | 11 +++ .../sync/metatag.metatag_defaults.front.yml | 14 ++++ .../sync/metatag.metatag_defaults.global.yml | 11 +++ config/sync/metatag.metatag_defaults.node.yml | 12 ++++ ...metatag.metatag_defaults.taxonomy_term.yml | 12 ++++ config/sync/metatag.metatag_defaults.user.yml | 12 ++++ config/sync/views.view.content.yml | 8 +-- config/sync/views.view.taxonomy_term.yml | 2 +- config/sync/views.view.watchdog.yml | 2 +- config/sync/views.view.who_s_new.yml | 2 +- web/profiles/d8-starterkit-profile | 2 +- web/themes/custom/popsu/popsu.theme | 10 +-- 16 files changed, 167 insertions(+), 13 deletions(-) create mode 100644 config/sync/metatag.metatag_defaults.403.yml create mode 100644 config/sync/metatag.metatag_defaults.404.yml create mode 100644 config/sync/metatag.metatag_defaults.front.yml create mode 100644 config/sync/metatag.metatag_defaults.global.yml create mode 100644 config/sync/metatag.metatag_defaults.node.yml create mode 100644 config/sync/metatag.metatag_defaults.taxonomy_term.yml create mode 100644 config/sync/metatag.metatag_defaults.user.yml diff --git a/composer.json b/composer.json index f1646fe2..97155423 100644 --- a/composer.json +++ b/composer.json @@ -31,6 +31,7 @@ "drupal/leaflet_more_maps": "^2.1", "drupal/leaflet_more_markers": "^1.1", "drupal/linked_field": "^1.3", + "drupal/metatag": "^1.21", "drupal/page_manager": "4.x-dev@dev", "drupal/panelizer": "^4.4", "drupal/panels": "^4.6", diff --git a/composer.lock b/composer.lock index cc936cba..a7f28c32 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": "9d5df14ac7c6753819935b4de3da5b58", + "content-hash": "92b137f0174eb6369b1116a3fe8fa6e4", "packages": [ { "name": "ajgl/breakpoint-twig-extension", @@ -7445,6 +7445,72 @@ "issues": "https://www.drupal.org/project/issues/menu_position" } }, + { + "name": "drupal/metatag", + "version": "1.21.0", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/metatag.git", + "reference": "8.x-1.21" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/metatag-8.x-1.21.zip", + "reference": "8.x-1.21", + "shasum": "677ff7384b557390d4d1a36f335452e8172f741d" + }, + "require": { + "drupal/core": "^9", + "drupal/token": "^1.0", + "php": ">=7.0" + }, + "require-dev": { + "drupal/devel": "^4.0", + "drupal/metatag_dc": "*", + "drupal/metatag_open_graph": "*", + "drupal/page_manager": "4.x-dev", + "drupal/panelizer": "4.x-dev", + "drupal/redirect": "1.x-dev", + "mpyw/phpunit-patch-serializable-comparison": "*" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "8.x-1.21", + "datestamp": "1657971667", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "See contributors", + "homepage": "https://www.drupal.org/node/640498/committers", + "role": "Developer" + }, + { + "name": "Dave Reid", + "homepage": "https://www.drupal.org/user/53892" + } + ], + "description": "Manage meta tags for all entities.", + "homepage": "https://www.drupal.org/project/metatag", + "keywords": [ + "Drupal", + "seo" + ], + "support": { + "source": "https://git.drupalcode.org/project/metatag", + "issues": "https://www.drupal.org/project/issues/metatag", + "docs": "https://www.drupal.org/docs/8/modules/metatag" + } + }, { "name": "drupal/page_manager", "version": "dev-4.x", diff --git a/config/sync/core.extension.yml b/config/sync/core.extension.yml index 8bb0e092..e60221de 100644 --- a/config/sync/core.extension.yml +++ b/config/sync/core.extension.yml @@ -95,6 +95,7 @@ module: menu_block: 0 menu_link_content: 0 menu_ui: 0 + metatag: 0 mysql: 0 node: 0 options: 0 diff --git a/config/sync/metatag.metatag_defaults.403.yml b/config/sync/metatag.metatag_defaults.403.yml new file mode 100644 index 00000000..b30fffe0 --- /dev/null +++ b/config/sync/metatag.metatag_defaults.403.yml @@ -0,0 +1,12 @@ +uuid: 490f6c4e-b4a8-4d76-a73c-061bcc39a496 +langcode: fr +status: true +dependencies: { } +_core: + default_config_hash: RDCkFL0NDt75Gwioooxo1iuA1S50xTVsBOgX__c6wTw +id: '403' +label: 'page 403 accès refusé' +tags: + robots: noindex + canonical_url: '[site:url]' + shortlink: '[site:url]' diff --git a/config/sync/metatag.metatag_defaults.404.yml b/config/sync/metatag.metatag_defaults.404.yml new file mode 100644 index 00000000..e404740c --- /dev/null +++ b/config/sync/metatag.metatag_defaults.404.yml @@ -0,0 +1,11 @@ +uuid: b281e67b-f855-4f6b-b21a-bab4ded8378a +langcode: fr +status: true +dependencies: { } +_core: + default_config_hash: puBstSLDz8mbaWU357zaqQDBGMGsJzG0j-TQNQkjg20 +id: '404' +label: 'Page 404 non trouvée' +tags: + canonical_url: '[site:url]' + shortlink: '[site:url]' diff --git a/config/sync/metatag.metatag_defaults.front.yml b/config/sync/metatag.metatag_defaults.front.yml new file mode 100644 index 00000000..752f78a3 --- /dev/null +++ b/config/sync/metatag.metatag_defaults.front.yml @@ -0,0 +1,14 @@ +uuid: 6feef25d-03b1-4d07-92a0-87548e0d77f7 +langcode: fr +status: true +dependencies: { } +_core: + default_config_hash: 1noCXlegCr5HFehQRF1ViXy1jhU1jZ_sNN99a8Sj5jo +id: front +label: 'Front page' +tags: + canonical_url: '[site:url]' + description: '[site:slogan]' + robots: 'index, follow' + shortlink: '[site:url]' + title: '[site:name]' diff --git a/config/sync/metatag.metatag_defaults.global.yml b/config/sync/metatag.metatag_defaults.global.yml new file mode 100644 index 00000000..dc06c08f --- /dev/null +++ b/config/sync/metatag.metatag_defaults.global.yml @@ -0,0 +1,11 @@ +uuid: 3c1d8c0c-d3ab-41b3-b695-cee1135514b6 +langcode: fr +status: true +dependencies: { } +_core: + default_config_hash: sL588ui1E_8-2c_UupwyYxcqX2OVyMFp3HTLbbFqvPc +id: global +label: Global +tags: + canonical_url: '[current-page:url]' + title: '[current-page:title] | [site:name]' diff --git a/config/sync/metatag.metatag_defaults.node.yml b/config/sync/metatag.metatag_defaults.node.yml new file mode 100644 index 00000000..28304408 --- /dev/null +++ b/config/sync/metatag.metatag_defaults.node.yml @@ -0,0 +1,12 @@ +uuid: 7c8d2b8e-35c8-401d-bdf5-60ff2ba34ad1 +langcode: fr +status: true +dependencies: { } +_core: + default_config_hash: rpwvgyEURXLz_JjgMCrkS1rUv-0k3L79BpO-ReN7fDI +id: node +label: Content +tags: + title: '[node:title] | [site:name]' + description: '[node:summary]' + canonical_url: '[node:url]' diff --git a/config/sync/metatag.metatag_defaults.taxonomy_term.yml b/config/sync/metatag.metatag_defaults.taxonomy_term.yml new file mode 100644 index 00000000..6ea81ca4 --- /dev/null +++ b/config/sync/metatag.metatag_defaults.taxonomy_term.yml @@ -0,0 +1,12 @@ +uuid: 5e0f73c1-96de-4508-a2d9-b0cce7e55ef7 +langcode: fr +status: true +dependencies: { } +_core: + default_config_hash: 92bXZdyYJ5xqukdfmGRr_CYcwm1vfuS8b8aJ7X_G7E0 +id: taxonomy_term +label: 'Taxonomy term' +tags: + canonical_url: '[term:url]' + description: '[term:description]' + title: '[term:name] | [site:name]' diff --git a/config/sync/metatag.metatag_defaults.user.yml b/config/sync/metatag.metatag_defaults.user.yml new file mode 100644 index 00000000..4625f7ab --- /dev/null +++ b/config/sync/metatag.metatag_defaults.user.yml @@ -0,0 +1,12 @@ +uuid: 48b95ba1-e4a3-4dfa-9132-a3307be8cf28 +langcode: fr +status: true +dependencies: { } +_core: + default_config_hash: MvQPTbQx0Vxwy0ordSHyixdZmLCMpvMdLD69dlwkrKc +id: user +label: User +tags: + canonical_url: '[user:url]' + description: '[site:name]' + title: '[user:display-name] | [site:name]' diff --git a/config/sync/views.view.content.yml b/config/sync/views.view.content.yml index 3e9cd1ce..bb186630 100644 --- a/config/sync/views.view.content.yml +++ b/config/sync/views.view.content.yml @@ -45,7 +45,7 @@ dependencies: _core: default_config_hash: P7F4DFe8BL31DRVqsvS-ix9KZZqvvaPjZ7zEvGo9yNM id: content -label: Contenu +label: Content module: node description: 'Trouver et gérer le contenu.' tag: default @@ -58,7 +58,7 @@ display: display_plugin: default position: 0 display_options: - title: Contenu + title: Content fields: node_bulk_form: id: node_bulk_form @@ -1314,7 +1314,7 @@ display: path: admin/content/programme menu: type: 'default tab' - title: Contenu + title: Content description: '' weight: -10 expanded: false @@ -1323,7 +1323,7 @@ display: context: '0' tab_options: type: normal - title: Contenu + title: Content description: 'Trouver et gérer le contenu' weight: -10 cache_metadata: diff --git a/config/sync/views.view.taxonomy_term.yml b/config/sync/views.view.taxonomy_term.yml index c09f7024..69b2e580 100644 --- a/config/sync/views.view.taxonomy_term.yml +++ b/config/sync/views.view.taxonomy_term.yml @@ -12,7 +12,7 @@ dependencies: _core: default_config_hash: uvMAn5Qf8Uni989mhr5KY4hx66xkSpP8nFYZMHgj7kY id: taxonomy_term -label: 'Terme de taxonomie' +label: 'Taxonomy term' module: taxonomy description: 'Contenu associé à un terme de taxonomie donné.' tag: default diff --git a/config/sync/views.view.watchdog.yml b/config/sync/views.view.watchdog.yml index fc6cf20f..dc1e6477 100644 --- a/config/sync/views.view.watchdog.yml +++ b/config/sync/views.view.watchdog.yml @@ -332,7 +332,7 @@ display: entity_type: user entity_field: name plugin_id: field - label: Utilisateur + label: User exclude: false alter: alter_text: false diff --git a/config/sync/views.view.who_s_new.yml b/config/sync/views.view.who_s_new.yml index b21fd249..bee6969f 100644 --- a/config/sync/views.view.who_s_new.yml +++ b/config/sync/views.view.who_s_new.yml @@ -187,7 +187,7 @@ display: display_description: 'Une liste des nouveaux utilisateurs' display_extenders: { } block_description: 'Nouveaux membres' - block_category: Utilisateur + block_category: User cache_metadata: max-age: -1 contexts: diff --git a/web/profiles/d8-starterkit-profile b/web/profiles/d8-starterkit-profile index 5069345d..179aa994 160000 --- a/web/profiles/d8-starterkit-profile +++ b/web/profiles/d8-starterkit-profile @@ -1 +1 @@ -Subproject commit 5069345d9dffca8ff935d7a01d2bc97a1272f063 +Subproject commit 179aa994156fa9c986cf9eb9262872abb9c651a2 diff --git a/web/themes/custom/popsu/popsu.theme b/web/themes/custom/popsu/popsu.theme index f4efa6f3..f9910989 100644 --- a/web/themes/custom/popsu/popsu.theme +++ b/web/themes/custom/popsu/popsu.theme @@ -19,13 +19,15 @@ function popsu_preprocess_html(&$variables) { // $frontpage = \Drupal::service('path.matcher')->isFrontPage(); - $variables['head_title']['slogan'] = \Drupal::config('system.site')->get('slogan'); + $variables['site_name'] = \Drupal::config('system.site')->get('name'); + $variables['slogan'] = \Drupal::config('system.site')->get('slogan'); //var_dump($variables['head_title']); if( $frontpage == true){ - $variables['head_title'] = $variables['head_title']["name"]." | ".$variables['head_title']['slogan']; - }else{ - $variables['head_title'] = $variables['head_title']["name"]; + $variables['head_title'] = [$variables["site_name"], $variables['slogan']]; } + // else{ + // $variables['head_title'] = $variables['site_name']; + // } if ($node){ if($node->hasField('field_programme') && $node->get('field_programme')->getString() != ""){ $variables['attributes']['class'][] = 'programme-' . $node->get('field_programme')->getString();