Fixed canonical url on changelog index.

This commit is contained in:
flash 2020-05-26 13:18:37 +00:00
parent aa9b506090
commit f3b1c9f70a
3 changed files with 5 additions and 6 deletions

View file

@ -18,7 +18,6 @@ final class TwigMisuzu extends Twig_Extension {
new Twig_Filter('perms_check', 'perms_check'),
new Twig_Filter('bg_settings', 'user_background_settings_strings'),
new Twig_Filter('clamp', 'clamp'),
new Twig_Filter('as_platform', fn(string $userAgent) => (new \WhichBrowser\Parser($userAgent))->toString()),
];
}

View file

@ -24,7 +24,7 @@ define('MSZ_URLS', [
'auth-resolve-user' => ['/auth/login.php', ['resolve_user' => '<username>']],
'auth-two-factor' => ['/auth/twofactor.php', ['token' => '<token>']],
'changelog-index' => ['/changelog', ['date' => '<date>', 'user' => '<user>', 'tags' => '<tags>']],
'changelog-index' => ['/changelog', ['date' => '<date>', 'user' => '<user>', 'tags' => '<tags>', 'p' => '<page>']],
'changelog-feed-rss' => ['/changelog.rss'],
'changelog-feed-atom' => ['/changelog.atom'],
'changelog-change' => ['/changelog/change/<change>'],

View file

@ -8,10 +8,10 @@
{% set title = 'Changelog' %}
{% set changelog_date_fmt = changelog_date|default(false) ? changelog_date|date('Y-m-d') : '' %}
{% set canonical_url = url_construct(url('changelog-index'), {
'd': changelog_date_fmt,
'u': changelog_user.id|default(0),
'p': changelog_pagination.page,
{% set canonical_url = url('changelog-index', {
'date': changelog_date_fmt,
'user': changelog_user.id|default(0),
'page': changelog_pagination.page < 2 ? 0 : changelog_pagination.page,
}) %}
{% if is_date or is_user %}