Fix CSP
This commit is contained in:
parent
51dcf3441d
commit
de978b43a4
5 changed files with 89 additions and 99 deletions
8
themes/red/assets/js/site.js
Normal file
8
themes/red/assets/js/site.js
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
imagesLoaded(document.querySelector('.grid'), function(instance) {
|
||||||
|
new Masonry('.grid', {
|
||||||
|
itemSelector: '.grid-item',
|
||||||
|
columnWidth: 300,
|
||||||
|
fitWidth: true,
|
||||||
|
gutter: 10
|
||||||
|
});
|
||||||
|
});
|
|
@ -108,15 +108,9 @@
|
||||||
<a href="{{ .URL }}">Next</a>
|
<a href="{{ .URL }}">Next</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<script>
|
{{ $site := resources.Get "js/site.js" }}
|
||||||
imagesLoaded(document.querySelector('.grid'), function(instance) {
|
{{ if hugo.IsProduction }}
|
||||||
new Masonry('.grid', {
|
{{ $site = $site | minify | fingerprint | resources.PostProcess }}
|
||||||
itemSelector: '.grid-item',
|
{{ end }}
|
||||||
columnWidth: 300,
|
<script src="{{ $site.RelPermalink }}" integrity="{{ $site.Data.Integrity }}"></script>
|
||||||
fitWidth: true,
|
|
||||||
gutter: 10
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -40,16 +40,9 @@
|
||||||
</div>
|
</div>
|
||||||
{{ template "_internal/pagination.html" . }}
|
{{ template "_internal/pagination.html" . }}
|
||||||
|
|
||||||
<script>
|
{{ $site := resources.Get "js/site.js" }}
|
||||||
imagesLoaded( document.querySelector('.grid'), function( instance ) {
|
{{ if hugo.IsProduction }}
|
||||||
console.log('all images are loaded');
|
{{ $site = $site | minify | fingerprint | resources.PostProcess }}
|
||||||
var msnry = new Masonry( '.grid', {
|
{{ end }}
|
||||||
itemSelector: '.grid-item',
|
<script src="{{ $site.RelPermalink }}" integrity="{{ $site.Data.Integrity }}"></script>
|
||||||
columnWidth: 200,
|
|
||||||
fitWidth: true,
|
|
||||||
gutter: 10
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
|
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
|
|
||||||
{{ if in .File.Dir "art" }}
|
|
||||||
|
|
||||||
{{ else }}
|
|
||||||
{{ $selected_year := $.Param "selectedyear" }}
|
{{ $selected_year := $.Param "selectedyear" }}
|
||||||
{{ $art := (index site.Data ($.Param "json")) }}
|
{{ $art := (index site.Data ($.Param "json")) }}
|
||||||
{{ $pixiv_icon := resources.Get "pixiv.webp" }}
|
{{ $pixiv_icon := resources.Get "pixiv.webp" }}
|
||||||
|
@ -94,4 +91,3 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
|
||||||
|
|
|
@ -6,5 +6,4 @@
|
||||||
<li><a href="{{ "/tags/" | relLangURL }}{{ $name | urlize }}">{{ $name }}</a></li>
|
<li><a href="{{ "/tags/" | relLangURL }}{{ $name | urlize }}">{{ $name }}</a></li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Add table
Reference in a new issue