Skip to content

Commit

Permalink
add description metadata to concept page
Browse files Browse the repository at this point in the history
  • Loading branch information
osma committed Aug 21, 2024
1 parent 2292821 commit 9768447
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 0 deletions.
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

0 comments on commit 9768447

Please sign in to comment.