Skip to content

Commit

Permalink
set page title and metadata according to SEO spec
Browse files Browse the repository at this point in the history
  • Loading branch information
osma committed Apr 25, 2024
1 parent 80a7c9e commit 87d2c03
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/view/about.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% set pageType = 'about' %}
{% extends "base-template.twig" %}
{% block title %}: "About"{% endblock %}
{% block title %}{{ "About" | trans}} - {{ GlobalConfig.serviceName }}{% endblock %}
{% block content %}

<div class="container">
Expand Down
8 changes: 6 additions & 2 deletions src/view/base-template.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
<head>
<base href="{{ BaseHref }}">
<link rel="shortcut icon" href="favicon.ico">
<title>{% block title %}{{ GlobalConfig.serviceName }}{% endblock %}</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="format-detection" content="telephone=no">
<meta name="generator" content="Skosmos {{ request.version }}" />
<meta name="generator" content="Skosmos {{ request.version }}">
<meta name="title" content="{{ block('title') }}">
<meta property="og:title" content="{{ block('title') }}">
<meta name="twitter:title" content="{{ block('title') }}">
<meta name="twitter:card" content="summary">
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" media="screen, print" rel="stylesheet" type="text/css">
<link href="resource/css/fonts.css" media="screen, print" rel="stylesheet" type="text/css">
<link href="resource/css/skosmos.css" media="screen, print" rel="stylesheet" type="text/css">
Expand All @@ -18,7 +23,6 @@
<link href="{{ GlobalConfig.customCss }}" media="screen, print" rel="stylesheet" type="text/css">
{% endif %}
{% for plugin, files in request.plugins.pluginsCSS %}{% for file in files %}<link href="{{ file }}" media="screen, print" rel="stylesheet" type="text/css">{% endfor %}{% endfor %}
<title>{{ GlobalConfig.serviceName }}{% block title %}{% endblock %}</title>
</head>
<body{% if request.vocabid == '' and request.page != 'feedback' and request.page != 'about' and request.page != 'search' %} class="bg-light frontpage-logo"{% else %} class="bg-medium vocab-{{ request.vocabid }}"{% endif %}>
<header>
Expand Down
2 changes: 1 addition & 1 deletion src/view/concept.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% set pageType = 'concept' %}
{% extends "base-template.twig" %}
{% block title %}: {{ vocab.shortName }}: {{ concept_label }}{% endblock %}
{% block title %}{{ concept.label }} - {{ vocab.shortName }} - {{ GlobalConfig.serviceName }}{% endblock %}

{% block content %}
{% include "sidebar.inc" %}
Expand Down
2 changes: 1 addition & 1 deletion src/view/error.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% set pageType = 'error' %}
{% extends "base-template.twig" %}
{% block title %}: "Error"{% endblock %}
{% block title %}{{ "Error"| trans }} - {{ GlobalConfig.serviceName }}{% endblock %}
{% block content %}
{% set pageError = request.vocabid != '' and request.page == 'page' %}
{% if pageError %}
Expand Down
2 changes: 1 addition & 1 deletion src/view/feedback.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% set pageType = 'feedback' %}
{% extends "base-template.twig" %}

{% block title %}: "Feedback"{% endblock %}
{% block title %}{{ "Feedback"|trans }} - {{GlobalConfig.serviceName}}{% endblock %}
{% block content %}

{% if feedback_sent %}
Expand Down
2 changes: 1 addition & 1 deletion src/view/vocab-home.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% set pageType = 'vocab-home' %}
{% extends "base-template.twig" %}
{% block title %}: {{ vocab.title(request.contentLang) }}{% endblock %}
{% block title %}{{ vocab.title(request.contentLang) }} - {{ GlobalConfig.serviceName }}{% endblock %}


{% block content %}
Expand Down
2 changes: 1 addition & 1 deletion src/view/vocab-search.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% set pageType = 'vocab-search' %}
{% extends "base-template.twig" %}
{% block title %}: {{ vocab.shortName(request.contentLang) }} '{{ term }}'{% endblock %}
{% block title %}'{{ term }}' - {{ vocab.shortName(request.contentLang) }} - {{ GlobalConfig.serviceName }}{% endblock %}
{% block content %}
<main class="searchpage py-5" id="main-container" >
<div class="container">
Expand Down

0 comments on commit 87d2c03

Please sign in to comment.