Use Sub Resource Integrity
parent
97ef0bab82
commit
b79056d561
11
config.toml
11
config.toml
|
@ -25,12 +25,13 @@ favicon = "/favicon.svg"
|
||||||
stylesheets = []
|
stylesheets = []
|
||||||
|
|
||||||
use_cdn = true
|
use_cdn = true
|
||||||
|
# include hashes for SRI
|
||||||
cdns = [
|
cdns = [
|
||||||
"https://cdn.jsdelivr.net/npm/firacode@6.2.0/distr/fira_code.min.css",
|
{ url = "https://cdn.jsdelivr.net/npm/firacode@6.2.0/distr/fira_code.min.css", hash = "sWIpcFPnJFfPqQU7FWn8H9+Xax/h5ihI8hVjQTBa5WmUde6CZZLw9DUAaIyA6j5u" },
|
||||||
"https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.5/dist/web/static/pretendard-std-dynamic-subset.min.css",
|
{ url = "https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.5/dist/web/static/pretendard-std-dynamic-subset.min.css", hash = "UzN3sOqBetZN9G2CDFfxg1PNJ+Qrv8/HZIoBp6XsCD+2DOehpvXGqkj2WFCNge5Q" },
|
||||||
"https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.5/dist/web/variable/pretendardvariable-std.min.css",
|
{ url = "https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.5/dist/web/variable/pretendardvariable-std.min.css", hash = "3OYJp8uUv2MJWyKGgrZOrSjf+WP+nD7ifpJ04kAsI02PYi+nghC4TF37YkN/2Qxt" },
|
||||||
"https://cdn.jsdelivr.net/gh/codex-src/iA-Fonts@master/iA%20Writer%20Quattro/Webfonts/index.min.css",
|
{ url = "https://cdn.jsdelivr.net/gh/codex-src/iA-Fonts@master/iA%20Writer%20Quattro/Webfonts/index.min.css", hash = "Vx6OU3QBwm96rTUebUtdfD/AW3d3uzT896pixaUYg9Nb87zqHuXmjmv9aGwBmFjP" },
|
||||||
"https://cdn.jsdelivr.net/gh/codex-src/iA-Fonts@master/iA%20Writer%20Quattro/Variable/index.min.css",
|
{ url = "https://cdn.jsdelivr.net/gh/codex-src/iA-Fonts@master/iA%20Writer%20Quattro/Variable/index.min.css", hash = "sFJyxW2UhZcJ0SAweDcoU6dBgqox5PbLK5nZStQSQitBeRHigPu7OPWDvoIHEXeo" },
|
||||||
]
|
]
|
||||||
|
|
||||||
menu = [
|
menu = [
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
{# Font from cdn or disk #}
|
{# Font from cdn or disk #}
|
||||||
{% if config.extra.use_cdn | default(value=false) %}
|
{% if config.extra.use_cdn | default(value=false) %}
|
||||||
{% for cdn in config.extra.cdns %}
|
{% for cdn in config.extra.cdns %}
|
||||||
<link href={{ cdn }} rel="stylesheet">
|
<link href={{ cdn.url }} rel="stylesheet" integrity="sha384-{{ cdn.hash }}" crossorigin="anonymous">
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<link href="{{ get_url(path='fonts.css') }}" rel="stylesheet" />
|
<link href="{{ get_url(path='fonts.css') }}" rel="stylesheet" />
|
||||||
|
|
Loading…
Reference in New Issue