Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEO: improved titles for Skosmos 3 generated HTML pages #1625

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

osma
Copy link
Member

@osma osma commented Apr 18, 2024

Reasons for creating this PR

Improve search engine optimization in Skosmos 3 by making the <title> values and related metadata (title, twitter:title, og:title) conform to the specification in #1533 (comment) .

This PR only handles the titles, not descriptions. The descriptions will have to be implemented in a subsequent PR.

Link to relevant issue(s), if any

Description of the changes in this PR

  • refactor: pass the GlobalConfig instance to the Twig templates, instead of individual configuration settings in separate variables
  • adapt the Twig templates to use the GlobalConfig instance, and set their title metadata to match the specification
  • add Cypress tests to verify the title values

Known problems or uncertainties in this PR

Checklist

  • phpUnit tests pass locally with my changes
  • I have added tests that show that the new code works, or tests are not relevant for this PR (e.g. only HTML/CSS changes)
  • The PR doesn't reduce accessibility of the front-end code (e.g. tab focus, scaling to different resolutions, use of .sr-only class, color contrast)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

@osma osma added this to the 3.0 milestone Apr 18, 2024
@osma osma self-assigned this Apr 18, 2024
@osma osma added this to In progress in Skosmos 3.0 Backlog Apr 18, 2024
Copy link

sonarcloud bot commented Apr 25, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
54.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@osma osma changed the title WIP: SEO for Skosmos 3 SEO: improved titles for Skosmos 3 generated HTML pages Apr 25, 2024
@osma osma moved this from In progress to Needs review in Skosmos 3.0 Backlog Apr 25, 2024
@@ -1,6 +1,6 @@
{% set pageType = 'error' %}
{% extends "base-template.twig" %}
{% block title %}: "Error"{% endblock %}
{% block title %}{{ "Error"| trans }} - {{ GlobalConfig.serviceName }}{% endblock %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There does not seem to be a translation string for 'Error':

The 'error' msgid should probably be added to the translation templates.

@osma osma marked this pull request as ready for review April 25, 2024 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Skosmos 3.0 Backlog
  
Needs review
Development

Successfully merging this pull request may close these issues.

None yet

2 participants