1
0
Fork 0

Merge pull request #14 from matomo-org/seotweaks

SEO tweaks
This commit is contained in:
Thomas Steur 2019-03-11 10:25:55 +13:00 committed by GitHub
commit d6f88b0caa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 1 deletions

View file

@ -53,11 +53,13 @@ class Markdown extends \Parsedown
private function purifyHtml($html) { private function purifyHtml($html) {
$config = \HTMLPurifier_Config::createDefault(); $config = \HTMLPurifier_Config::createDefault();
$config->set('HTML.Doctype', 'XHTML 1.0 Transitional'); $config->set('HTML.Doctype', 'XHTML 1.0 Transitional');
$config->set('HTML.Allowed', 'p,strong,em,b,a[href],i,span,ul,ol,li,cite,code,pre,br,blockquote,img'); $config->set('HTML.Allowed', 'p,strong,em,b,a[href],i,span,ul,ol,li,cite,code,pre,br,blockquote,img');
$config->set('HTML.AllowedAttributes', 'src, height, width, alt, href, class'); $config->set('HTML.AllowedAttributes', 'src, height, width, alt, href, class, rel');
$config->set('URI.AllowedSchemes', array('http' => true, 'https' => true, 'mailto' => true, 'ftp' => true)); $config->set('URI.AllowedSchemes', array('http' => true, 'https' => true, 'mailto' => true, 'ftp' => true));
$config->set('HTML.TargetBlank', true); $config->set('HTML.TargetBlank', true);
$config->set('HTML.Nofollow', true);
$purifier = new \HTMLPurifier($config); $purifier = new \HTMLPurifier($config);

View file

@ -1,6 +1,10 @@
{% extends "layout.twig" %} {% extends "layout.twig" %}
{% import "macros.twig" as macro %} {% import "macros.twig" as macro %}
{% block head %}
<link rel="canonical" href="https://github.com/matomo-org/matomo/{{ pull_request ? "pulls" : "issues" }}/{{ number|e('html_attr') }}" />
{% endblock %}
{% block title %} {% block title %}
<title>{{ projectName }} {{ pull_request ? "Pull Request" : "Issue" }} #{{ number }} - {{ title }}</title> <title>{{ projectName }} {{ pull_request ? "Pull Request" : "Issue" }} #{{ number }} - {{ title }}</title>
{% endblock %} {% endblock %}

View file

@ -7,6 +7,7 @@
<link href="/css/style.css" rel="stylesheet"> <link href="/css/style.css" rel="stylesheet">
{% block head %} {% block head %}
<link rel="canonical" href="https://github.com/matomo-org/matomo/issues/" />
{% endblock %} {% endblock %}
{% block title %} {% block title %}

View file

@ -9,6 +9,8 @@
{% if currentPage != numPages %} {% if currentPage != numPages %}
<link rel="next" href="{{ path_for('page', [], { 'page': nextPage }) }}"/> <link rel="next" href="{{ path_for('page', [], { 'page': nextPage }) }}"/>
{% endif %} {% endif %}
<link rel="canonical" href="https://github.com/matomo-org/matomo/issues/" />
{% endblock %} {% endblock %}
{% block content %} {% block content %}