浏览代码

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

Add fingerprint + integrity when use resources.
tags/v1.0.0
Evan 4 年前
父节点
当前提交
39e30adc92
没有帐户链接到提交者的电子邮件
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 2
    2
      layouts/partials/footer.html
  2. 2
    2
      layouts/partials/head.html

+ 2
- 2
layouts/partials/footer.html 查看文件

@@ -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 查看文件

@@ -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">

正在加载...
取消
保存