Selaa lähdekoodia

Add SRI integrity keys for RTL CSS plugins

codecalm 5 kuukautta sitten
vanhempi
commit
2b6d6b184b
1 muutettua tiedostoa jossa 4 lisäystä ja 2 poistoa
  1. 4 2
      shared/includes/layout/css.html

+ 4 - 2
shared/includes/layout/css.html

@@ -26,10 +26,12 @@
 
 
 <!-- BEGIN PLUGINS STYLES -->
 <!-- BEGIN PLUGINS STYLES -->
 {% for plugin in site.cssPlugins -%}
 {% for plugin in site.cssPlugins -%}
+	{% assign sriKey = "css-" | append: plugin -%}
 	{% if layout-rtl -%}
 	{% if layout-rtl -%}
-	<link href="{{ page | relative }}/dist/css/tabler-{{ plugin }}.rtl{% if environment != 'development' %}.min{% endif %}.css{% if environment != 'development' %}?{{ 'now' | date: '%s' }}{% endif %}" rel="stylesheet"{% if environment != 'development' %} integrity="{{ sri[`css-${plugin}-rtl`] }}"{% endif %}/>
+	{% assign sriKey = "css-" | append: plugin | append: "-rtl" -%}
+	<link href="{{ page | relative }}/dist/css/tabler-{{ plugin }}.rtl{% if environment != 'development' %}.min{% endif %}.css{% if environment != 'development' %}?{{ 'now' | date: '%s' }}{% endif %}" rel="stylesheet"{% if environment != 'development' %} integrity="{{ sri[sriKey] }}"{% endif %}/>
 	{% else -%}
 	{% else -%}
-	<link href="{{ page | relative }}/dist/css/tabler-{{ plugin }}{% if environment != 'development' %}.min{% endif %}.css{% if environment != 'development' %}?{{ 'now' | date: '%s' }}{% endif %}" rel="stylesheet"{% if environment != 'development' %} integrity="{{ sri[`css-${plugin}`] }}"{% endif %}/>
+	<link href="{{ page | relative }}/dist/css/tabler-{{ plugin }}{% if environment != 'development' %}.min{% endif %}.css{% if environment != 'development' %}?{{ 'now' | date: '%s' }}{% endif %}" rel="stylesheet"{% if environment != 'development' %} integrity="{{ sri[sriKey] }}"{% endif %}/>
 	{% endif -%}
 	{% endif -%}
 {% endfor -%}
 {% endfor -%}
 <!-- END PLUGINS STYLES -->
 <!-- END PLUGINS STYLES -->