From b89ce1968332bffbcd288f1c9304a22bd75efe26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anke=20H=C3=A4slich?= Date: Tue, 2 May 2023 16:37:38 +0200 Subject: [PATCH] TASK: Update documentation and add setting `Neos.Seo.alternateLanguageLinks.excludedDimensionsPresets` --- Configuration/Settings.yaml | 3 + Documentation/index.rst | 58 +++---------------- README.md | 2 +- .../Metadata/AlternateLanguageLinks.fusion | 2 +- 4 files changed, 14 insertions(+), 51 deletions(-) diff --git a/Configuration/Settings.yaml b/Configuration/Settings.yaml index 4612ad98..eeb30545 100644 --- a/Configuration/Settings.yaml +++ b/Configuration/Settings.yaml @@ -22,6 +22,9 @@ Neos: 'Neos.Seo.Image': 'Neos\Seo\Fusion\Helper\ImageHelper' Seo: + # hreflang settings + alternateLanguageLinks: + excludedDimensionsPresets: [] # robots.txt settings robotsTxt: dimensionsPresets: null diff --git a/Documentation/index.rst b/Documentation/index.rst index ed66592f..783d9781 100755 --- a/Documentation/index.rst +++ b/Documentation/index.rst @@ -252,64 +252,24 @@ Alternatively you can change the caching behavior and have a cron job that recre Alternate Language Tag ------------------------ -The `Alternate Language Tag` provides information that the site is also available in other languages. By default the tags -are rendered with the `Neos.Neos:DimensionMenu` and the `language` dimension. Given the Neos Demo Site Package as an +The `Alternate Language Tag` provides information that the site is also available in other languages. Given the Neos Demo Site Package as an example the rendered tags for the homepage would be. :: + -According to the following dimension settings, there would be a lot more tags expected. However only two variants of the -homepage exists, thus only `en_US` and its fallback `en_UK` are rendered. - -In case the dimension that contains the language is not named `language` you have to set the alternative name with the -property `ContentRepository.dimensionTypes.language`. +If you only want to render a subset of the available language dimensions (e.g., if the content is not yet ready) +you can configure this in the `Settings.yaml`:: -:: + Neos: + Seo: + alternateLanguageLinks: + # Show all but exclude German + excludedDimensionsPresets: ['de'] - ContentRepository: - contentDimensions: - 'language': - label: 'Language' - icon: 'icon-language' - default: 'en_US' - defaultPreset: 'en_US' - presets: - 'all': ~ - 'en_US': - label: 'English (US)' - values: ['en_US'] - uriSegment: 'en' - 'en_UK': - label: 'English (UK)' - values: ['en_UK', 'en_US'] - uriSegment: 'uk' - 'de': - label: 'German' - values: ['de'] - uriSegment: 'de' - 'fr': - label: 'French' - values: ['fr'] - uriSegment: 'fr' - 'nl': - label: 'Dutch' - values: ['nl', 'de'] - uriSegment: 'nl' - 'dk': - label: 'Danish' - values: ['dk'] - uriSegment: 'dk' - 'lv': - label: 'Latvian' - values: ['lv'] - uriSegment: 'lv' - dimensionTypes: - language: 'language' - -You can exclude presets by overriding `Neos.Seo:AlternateLanguageLinks`. Dynamic robots.txt ------------------ diff --git a/README.md b/README.md index 2b0abc78..ca73ceca 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Check the [documentation](https://neos-seo.readthedocs.io/en/stable/) for all fe 1. Run the following command f.e. in your site package: ```bash - composer require --no-update "neos/seo:^3.3" + composer require --no-update "neos/seo:^4.1" ``` 2. Update your dependencies by running the following command in your project root folder: diff --git a/Resources/Private/Fusion/Metadata/AlternateLanguageLinks.fusion b/Resources/Private/Fusion/Metadata/AlternateLanguageLinks.fusion index e6c74598..30a18c6b 100644 --- a/Resources/Private/Fusion/Metadata/AlternateLanguageLinks.fusion +++ b/Resources/Private/Fusion/Metadata/AlternateLanguageLinks.fusion @@ -5,7 +5,7 @@ prototype(Neos.Seo:AlternateLanguageLinks) < prototype(Neos.Fusion:Component) { node = ${documentNode} dimension = 'language' - excludedPresets = ${[]} + excludedPresets = ${Configuration.setting('Neos.Seo.alternateLanguageLinks.excludedDimensionsPresets')} # The hreflang value needs to have a format like 'en-US', therefore internally used values # like 'en_US' will be modified to match.