Browse Source

Merge pull request #120 from divinerites/Use-fingerprint-for-.resources

Add fingerprint + integrity when use resources.
tags/v1.0.0
Evan 4 years ago
parent
commit
39e30adc92
No account linked to committer's email address
2 changed files with 4 additions and 4 deletions
  1. 2
    2
      layouts/partials/footer.html
  2. 2
    2
      layouts/partials/head.html

+ 2
- 2
layouts/partials/footer.html View File

@@ -38,5 +38,5 @@
{{ end }}

{{ "<!-- Main Script -->" | safeHTML }}
{{ $script := resources.Get "js/script.js" | minify}}
<script src="{{ $script.Permalink }}"></script>
{{ $script := resources.Get "js/script.js" | minify | fingerprint "sha384"}
<script src="{{ $script.Permalink }}" integrity="{{ $script.Data.Integrity }}"></script>

+ 2
- 2
layouts/partials/head.html View File

@@ -15,8 +15,8 @@
{{ end }}

{{"<!-- Main Stylesheet -->"|safeHTML}}
{{ $styles := resources.Get "css/style.css" | minify}}
<link rel="stylesheet" href="{{ $styles.Permalink }}" media="screen">
{{ $styles := resources.Get "css/style.css" | minify | fingerprint "sha384" }}
<link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}" media="screen">

{{"<!-- Custom stylesheet - for your changes -->" |safeHTML}}
<link rel="stylesheet" href="{{ `css/custom.css` | relURL}}" media="screen">

Loading…
Cancel
Save