Add Subresource Integrity (SRI) support (#164)
This commit is contained in:
parent
09e037d535
commit
d1da39b34b
5 changed files with 20 additions and 6 deletions
7
_includes/ext-css.html
Normal file
7
_includes/ext-css.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
{% if include.css.sri %}
|
||||
<link href="{{ include.css.href }}" rel="stylesheet" integrity="{{ include.css.sri }}" crossorigin="anonymous">
|
||||
{% elsif include.css.href %}
|
||||
<link rel="stylesheet" href="{{ include.css.href }}" />
|
||||
{% else %}
|
||||
<link rel="stylesheet" href="{{ include.css }}" />
|
||||
{% endif %}
|
7
_includes/ext-js.html
Normal file
7
_includes/ext-js.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
{% if include.js.sri %}
|
||||
<script src="{{ include.js.href }}" integrity="{{ include.js.sri }}" crossorigin="anonymous"></script>
|
||||
{% elsif include.js.href %}
|
||||
<script src="{{ include.js.href }}"></script>
|
||||
{% else %}
|
||||
<script src="{{ include.js }}"></script>
|
||||
{% endif %}
|
|
@ -1,12 +1,12 @@
|
|||
{% if layout.common-ext-js %}
|
||||
{% for js in layout.common-ext-js %}
|
||||
<script src="{{ js }}"></script>
|
||||
{% include ext-js.html js=js %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if page.ext-js %}
|
||||
{% for js in page.ext-js %}
|
||||
<script src="{{ js }}"></script>
|
||||
{% include ext-js.html js=js %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
{% if layout.common-ext-css %}
|
||||
{% for css in layout.common-ext-css %}
|
||||
<link rel="stylesheet" href="{{ css }}" />
|
||||
{% include ext-css.html css=css %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
|||
|
||||
{% if page.ext-css %}
|
||||
{% for css in page.ext-css %}
|
||||
<link rel="stylesheet" href="{{ css }}" />
|
||||
{% include ext-css.html css=css %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue