Commit 7ace4ceb authored by Carl Schwan's avatar Carl Schwan 🚴

Add hreflang and fix some urls

parent c0ad3441
Pipeline #27113 passed with stage
in 3 minutes and 47 seconds
......@@ -65,7 +65,8 @@ class MainController extends AbstractController
if ($categoryObject) {
return $this->render('main/category.html.twig', [
'category' => $categoryObject,
'locale' => $_locale
'locale' => $_locale,
'translations' => $this->getParameter('app.translations'),
]);
}
$applicationObj = AppData::fromBinary($category);
......@@ -76,6 +77,7 @@ class MainController extends AbstractController
'_locale' => $_locale,
'category' => strtolower($applicationObj->getPrimaryCategory()),
'application' => $applicationObj->getId(),
'translations' => $this->getParameter('app.translations'),
]);
}
......@@ -105,7 +107,8 @@ class MainController extends AbstractController
return $this->render('main/application.html.twig', [
'application' => $applicationObj,
'category' => $category,
'locale' => $_locale
'locale' => $_locale,
'translations' => $this->getParameter('app.translations'),
]);
}
......@@ -129,6 +132,7 @@ class MainController extends AbstractController
'application' => $application,
'category' => $category,
'locale' => $_locale,
'translations' => $this->getParameter('app.translations'),
]);
}
}
......@@ -49,6 +49,9 @@ SPDX-License-Identifier: AGPL-3.0-or-later
{% endfor %}
{% endblock %}
<link href="https://cdn.kde.org/breeze-icons/icons.css" rel="stylesheet" />
{% block hreflang %}
{% endblock %}
</head>
<body>
<header id="KGlobalHeader" class="header clearfix">
......
......@@ -11,7 +11,14 @@ SPDX-License-Identifier: AGPL-3.0-or-later
{% block title %}{{ name }}{% endblock %}
{% block description %}{{ application.summary | l10n(locale) }}{% endblock %}
{% block image %}{% if application.screenshots | length > 0 %}{{ application.screenshots[0].sourceImage }}{% else %}https://kde.org/products/apps.png{% endif %}{% endblock %}
{% block canonical %}{{ app.request.getSchemeAndHttpHost ~ "/applications" ~ path('app_main_application_intl', {'_locale': locale, 'category': category, 'application': application.id}) }}{% endblock %}
{% block canonical %}https://kde.org{{ path('app_main_application_intl', {'_locale': locale, 'category': category, 'application': application.id}) }}{% endblock %}
{% block hreflang %}
<link rel="alternate" href="https://kde.org{{ path('app_main_application_intl', {'_locale': 'en', 'category': category | lower, 'application' : application.id }) }}" hreflang="en" />
{% for translation in translations %}
<link rel="alternate" href="https://kde.org{{ path('app_main_application_intl', {'_locale': translation, 'category': category, 'application' : application.id }) }}" hreflang="{{ translation }}" />
{% endfor %}
{% endblock %}
{% block body %}
<main itemscope itemtype="http://schema.org/SoftwareApplication">
......
......@@ -11,7 +11,14 @@ SPDX-License-Identifier: AGPL-3.0-or-later
{% block title %}{{ name }} - Developmnt information{% endblock %}
{% block description %}{{ application.summary | l10n(locale) }}{% endblock %}
{% block image %}{% if application.screenshots | length > 0 %}{{ application.screenshots[0].sourceImage }}{% else %}https://kde.org/products/apps.png{% endif %}{% endblock %}
{% block canonical %}{{ app.request.getSchemeAndHttpHost ~ "/applications" ~ path('app_main_application_dev_intl', {'_locale': locale, 'category': category, 'application': application.id}) }}{% endblock %}
{% block canonical %}https://kde.org{{ path('app_main_application_dev_intl', {'_locale': locale, 'category': category, 'application': application.id}) }}{% endblock %}
{% block hreflang %}
<link rel="alternate" href="https://kde.org{{ path('app_main_application_dev_intl', {'_locale': "en", 'category': category | lower, 'application' : application.id }) }}" hreflang="en" />
{% for translation in translations %}
<link rel="alternate" href="https://kde.org{{ path('app_main_application_dev_intl', {'_locale': translation, 'category': category | lower, 'application' : application.id }) }}" hreflang="{{ translation }}" />
{% endfor %}
{% endblock %}
{% block body %}
<main>
......
......@@ -9,9 +9,16 @@ SPDX-License-Identifier: AGPL-3.0-or-later
{% block title %}{{ category.name }}{% endblock %}
{% block description %}{% endblock %}
{% block image %}https://kde.org/products/apps.png{% endblock %}
{% block canonical %}{{ app.request.getSchemeAndHttpHost ~ "/applications" ~ path('app_main_category_intl', {'_locale': locale, 'category': category.name | lower }) }}{% endblock %}
{% block canonical %}https://kde.org{{ path('app_main_category_intl', {'_locale': locale, 'category': category.name | lower }) }}{% endblock %}
{% block imageSize %}summary{% endblock %}
{% block hreflang %}
<link rel="alternate" href="https://kde.org{{ path('app_main_category_intl', {'_locale': "en", 'category': category.name | lower }) }}" hreflang="en" />
{% for translation in translations %}
<link rel="alternate" href="https://kde.org{{ path('app_main_category_intl', {'_locale': translation, 'category': category.name | lower }) }}" hreflang="{{ translation }}" />
{% endfor %}
{% endblock %}
{% block body %}
<main class="container">
<h1><a href="{{ path('app_main_index', {'_locale': locale}) }}">
......
......@@ -9,9 +9,16 @@ SPDX-License-Identifier: AGPL-3.0-or-later
{% block title %}{% trans %}KDE's Applications{% endtrans %}{% endblock %}
{% block description %}{% trans %}KDE is a community of friendly people who create over 200 apps which run on any Linux desktop, and often other platforms too. Here is the complete list.{% endtrans %}{% endblock %}
{% block image %}https://kde.org/products/apps.png{% endblock %}
{% block canonical %}{{ app.request.getSchemeAndHttpHost }}/applications/{% endblock %}
{% block canonical %}https://kde.org{{ path('app_main_index', {'_locale': locale}) }}{% endblock %}
{% block imageSize %}summary{% endblock %}
{% block hreflang %}
<link rel="alternate" href="https://kde.org{{ path('app_main_index', {'_locale': "en"}) }}" hreflang="en" />
{% for translation in translations %}
<link rel="alternate" href="https://kde.org{{ path('app_main_index', {'_locale': translation}) }}" hreflang="{{ translation }}" />
{% endfor %}
{% endblock %}
{% block body %}
<main class="container">
<h1>{{ block('title') }}</h1>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment