assets: improvements

- rm redundant minify's
    - url as //assets/<js or css>/<path>
This commit is contained in:
Aditya Telange 2020-10-03 18:31:08 +05:30
parent 46d5200714
commit 8a8652fbf0
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77
2 changed files with 16 additions and 16 deletions

View File

@ -11,8 +11,8 @@
<path d="M12 6H0l6-6z" /></svg>
</button>
</a>
{{- if in site.Params.mainSections .Type }}
{{- $highlight := resources.Get "js/highlight.min.js" | minify | fingerprint}}
{{ if in site.Params.mainSections .Type }}
{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify | fingerprint -}}
<script src="{{ $highlight.Permalink }}" integrity="{{ $highlight.Data.Integrity }}"></script>
<script>hljs.initHighlightingOnLoad();</script>
{{- end }}

View File

@ -17,23 +17,23 @@
<meta name="google-site-verification" content="{{ .Site.Params.analytics.google.SiteVerificationTag }}" />
{{- end}}
<!-- Styles -->
{{- $anoldhope := resources.Get "css/an-old-hope.min.css" | minify }}
{{- $theme := resources.Get "css/theme-vars.css" | minify }}
{{- $reset := resources.Get "css/reset.css" | minify }}
{{- $header := resources.Get "css/header.css" | minify }}
{{- $main := resources.Get "css/main.css" | minify }}
{{- $postentry := resources.Get "css/post-entry.css" | minify }}
{{- $postsingle := resources.Get "css/post-single.css" | minify }}
{{- $terms := resources.Get "css/terms.css" | minify }}
{{- $archive := resources.Get "css/archive.css" | minify }}
{{- $footer := resources.Get "css/footer.css" | minify }}
{{- $404 := resources.Get "css/404.css" | minify }}
{{- $style := slice $theme $reset $header $main $postentry $postsingle $terms $archive $footer $404 | resources.Concat "stylesheet.css" | minify }}
{{- $stylesheet := slice $anoldhope $style | resources.Concat "css/stylesheet.css" | minify | fingerprint -}}
{{- $anoldhope := resources.Get "css/an-old-hope.min.css" }}
{{- $theme := resources.Get "css/theme-vars.css" }}
{{- $reset := resources.Get "css/reset.css" }}
{{- $header := resources.Get "css/header.css" }}
{{- $main := resources.Get "css/main.css" }}
{{- $postentry := resources.Get "css/post-entry.css" }}
{{- $postsingle := resources.Get "css/post-single.css" }}
{{- $terms := resources.Get "css/terms.css" }}
{{- $archive := resources.Get "css/archive.css" }}
{{- $footer := resources.Get "css/footer.css" }}
{{- $404 := resources.Get "css/404.css" }}
{{- $style := slice $theme $reset $header $main $postentry $postsingle $terms $archive $footer $404 | resources.Concat "stylesheet.css" }}
{{- $stylesheet := slice $anoldhope $style | resources.Concat "assets/css/stylesheet.css" | minify | fingerprint -}}
<link href="{{ $stylesheet.Permalink }}" integrity="{{ $stylesheet.Data.Integrity }}" rel="preload stylesheet"
as="style">
{{- if (and (.Site.Params.profileMode.enabled) (.IsHome)) }}
{{- $profileMode := resources.Get "css/profile-mode.css" | minify | fingerprint }}
{{- $profileMode := slice (resources.Get "css/profile-mode.css") | resources.Concat "assets/css/profile-mode.css" | minify | fingerprint }}
<link href="{{ $profileMode.Permalink }}" integrity="{{ $profileMode.Data.Integrity }}" rel="preload stylesheet"
as="style">
{{- end -}}