Skip to content

Commit

Permalink
Add CSP (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiklein and llarsson authored Feb 15, 2022
1 parent 3e8a769 commit 0751786
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,12 @@
</script>
<!-- End Matomo Code -->
{% endblock %}

{% block extrahead %}
<meta http-equiv="Content-Security-Policy" content="
default-src 'self';
img-src 'self' data:;
connect-src 'self' https://matomo.elastisys.com/;
script-src 'self' 'unsafe-inline';
">
{% endblock %}
12 changes: 12 additions & 0 deletions overrides/partials/source.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% import "partials/language.html" as lang with context %}

<a
href="{{ config.repo_url }}"
title="{{ lang.t('source.link.title') }}"
style="display: block; font-size: .65rem; line-height: 1.2; white-space: nowrap; -webkit-backface-visibility: hidden; backface-visibility: hidden; transition: opacity 250ms;"
>
<div class="md-source__icon md-icon">
{% set icon = config.theme.icon.repo or "fontawesome/brands/git-alt" %}
{% include ".icons/" ~ icon ~ ".svg" %}
</div>
</a>

0 comments on commit 0751786

Please sign in to comment.