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: add description metadata to concept page #1659

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions resource/translations/skosmos_en.po
Original file line number Diff line number Diff line change
Expand Up @@ -885,3 +885,6 @@ msgstr "Copy to clipboard"

msgid "Error"
msgstr "Error"

msgid "Concept %term% in vocabulary %vocab%"
msgstr "Concept %term% in vocabulary %vocab%"
3 changes: 3 additions & 0 deletions resource/translations/skosmos_fi.po
Original file line number Diff line number Diff line change
Expand Up @@ -894,3 +894,6 @@ msgstr "Kopioi leikepöydälle"

msgid "Error"
msgstr "Virhe"

msgid "Concept %term% in vocabulary %vocab%"
msgstr "Käsite %term% sanastossa %vocab%"
3 changes: 3 additions & 0 deletions resource/translations/skosmos_se.po
Original file line number Diff line number Diff line change
Expand Up @@ -881,3 +881,6 @@ msgstr "Diehtu"

msgid "Error"
msgstr "Error"

msgid "Concept %term% in vocabulary %vocab%"
msgstr "Doaba %term% sátnerájus %vocab%"
3 changes: 3 additions & 0 deletions resource/translations/skosmos_sv.po
Original file line number Diff line number Diff line change
Expand Up @@ -893,3 +893,6 @@ msgstr "Kopiera till urklipp"

msgid "Error"
msgstr "Fel"

msgid "Concept %term% in vocabulary %vocab%"
msgstr "Begreppet %term% i vokabulären %vocab%"
1 change: 1 addition & 0 deletions src/view/concept.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% set pageType = 'concept' %}
{% extends "base-template.twig" %}
{% block title %}{{ concept.label }} - {{ vocab.shortName }} - {{ GlobalConfig.serviceName }}{% endblock %}
{% block description %}{{ "Concept %term% in vocabulary %vocab%" | trans({'%term%': concept.label, '%vocab%': vocab.title(request.contentLang)}) }}{% endblock %}
{% block url %}{{ BaseHref }}{{ concept.uri|link_url(vocab,request.lang,'page',request.contentLang) }}{% endblock %}

{% block content %}
Expand Down
8 changes: 8 additions & 0 deletions tests/cypress/template/concept.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@ describe('Concept page', () => {
cy.get('head meta[name="title"]').should('have.attr', 'content', expectedTitle);
cy.get('head meta[property="og:title"]').should('have.attr', 'content', expectedTitle);
})
it('Contains description metadata', () => {
cy.visit('/yso/en/page/p1265') // go to "archaeology" concept page

const expectedDescription = 'Concept archaeology in vocabulary YSO - General Finnish ontology (archaeology)'
// check that the page has description metadata
cy.get('head meta[name="description"]').should('have.attr', 'content', expectedDescription);
cy.get('head meta[property="og:description"]').should('have.attr', 'content', expectedDescription);
})
it('Contains site name metadata', () => {
cy.visit('/yso/en/page/p1265') // go to "archaeology" concept page

Expand Down
Loading