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: vocab description, site name, type, canonical URL #1657

Merged
merged 7 commits into from
Aug 21, 2024

Conversation

osma
Copy link
Member

@osma osma commented Aug 21, 2024

Reasons for creating this PR

This PR implements most of the remaining SEO functionality from #1533 :

  • vocabulary description on vocab home page
  • og:site_name on all pages
  • og:type="website" on all pages
  • og:url and link rel=canonical on all pages
  • drop twitter:card (shouldn't be needed since twitter/X falls back on og:type)

In addition, there is a bug fix to the Request.getLangUrl method that broke when the Skosmos 3 code was restructured by moving backend code under src/. This fix could have been a separate PR but since the bug was causing problems for the canonical URL generation, I decided to fix it here in this PR. The fix is in a separate commit 9bdb894 .

Link to relevant issue(s), if any

Description of the changes in this PR

  • add VocabularyConfig.getDescription() method + PHPUnit test
  • add new metadata elements to base-template.twig (and drop twitter:card)
  • add blocks in page type templates to populate the metadata
  • add cypress tests
  • fix bug in Request.getLangUrl() method + correct the PHPUnit tests accordingly

Known problems or uncertainties in this PR

None so far!

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 Aug 21, 2024
@osma osma self-assigned this Aug 21, 2024
Copy link

sonarcloud bot commented Aug 21, 2024

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarCloud

Copy link
Contributor

@joelit joelit left a comment

Choose a reason for hiding this comment

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

As far as I can understand, looks good to me!

@osma osma merged commit 2292821 into main Aug 21, 2024
9 of 10 checks passed
@osma osma deleted the issue1533-seo-skosmos3-vocab-description branch August 21, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done (verified in test.dev.finto.fi, set Milestone 3.0 for both issue & PR)
Development

Successfully merging this pull request may close these issues.

2 participants