diff options
| author | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2020-10-03 18:31:08 +0530 |
|---|---|---|
| committer | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2020-10-03 18:31:08 +0530 |
| commit | 8a8652fbf03faa9a830d77b6429f47dda3152e03 (patch) | |
| tree | f44be88320171c660c32e106a544975de0e7ac39 | |
| parent | 46d5200714dda2dc9d92b1ab7bccd3615f33f208 (diff) | |
assets: improvements
- rm redundant minify's
- url as //assets/<js or css>/<path>
| -rw-r--r-- | layouts/partials/footer.html | 4 | ||||
| -rw-r--r-- | layouts/partials/head.html | 28 |
2 files changed, 16 insertions, 16 deletions
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 3264b91..ff5cdd5 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -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 }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 685548f..5b5df65 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -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 -}} |
