feat: migrate Hugo Bootstrap theme to latest Hugo with Tailwind CSS and refactor codebase
* replace Bootstrap-based styling with Tailwind CSS * update theme compatibility for latest Hugo version * refactor templates and partials * fix outdated code and broken components * improve project structure and maintainability * optimize styling and frontend build setup
This commit is contained in:
57
layouts/_partials/essentials/script.html
Executable file
57
layouts/_partials/essentials/script.html
Executable file
@@ -0,0 +1,57 @@
|
||||
<!-- JS Plugins + Main script -->
|
||||
{{ $scripts := slice }}
|
||||
{{ $scriptsLazy := slice }}
|
||||
{{ range site.Params.plugins.js }}
|
||||
{{ if findRE "^http" .link }}
|
||||
<script
|
||||
src="{{ .link | relURL }}"
|
||||
type="application/javascript"
|
||||
{{ .attributes | safeHTMLAttr }}></script>
|
||||
{{ else }}
|
||||
{{ if not .lazy }}
|
||||
{{ $scripts = $scripts | append (resources.Get .link) }}
|
||||
{{ else }}
|
||||
{{ $scriptsLazy = $scriptsLazy | append (resources.Get .link) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<!-- main script -->
|
||||
{{ $scripts = $scripts | append (resources.Get "js/main.js") }}
|
||||
{{ $scripts = $scripts | resources.Concat "js/script.js" }}
|
||||
|
||||
{{ $scriptsLazy = $scriptsLazy | resources.Concat "js/script-lazy.js" }}
|
||||
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ $scripts = $scripts | minify | fingerprint }}
|
||||
{{ $scriptsLazy = $scriptsLazy | minify | fingerprint }}
|
||||
{{ end }}
|
||||
|
||||
{{/* scripts */}}
|
||||
<script
|
||||
crossorigin="anonymous"
|
||||
integrity="{{ $scripts.Data.Integrity }}"
|
||||
src="{{ $scripts.RelPermalink }}"></script>
|
||||
|
||||
{{/* scripts lazy */}}
|
||||
<script
|
||||
defer
|
||||
async
|
||||
crossorigin="anonymous"
|
||||
integrity="{{ $scriptsLazy.Data.Integrity }}"
|
||||
src="{{ $scriptsLazy.RelPermalink }}"></script>
|
||||
|
||||
<!-- progressive web app -->
|
||||
{{/* https://github.com/gethugothemes/hugo-modules/tree/master/pwa */}}
|
||||
{{ partialCached "pwa.html" . }}
|
||||
|
||||
|
||||
<!-- cookie consent -->
|
||||
{{/* https://github.com/gethugothemes/hugo-modules/tree/master/components/cookie-consent */}}
|
||||
{{ partialCached "cookie-consent.html" . }}
|
||||
|
||||
|
||||
<!-- google adsense -->
|
||||
{{/* https://github.com/gethugothemes/hugo-modules/tree/master/adsense */}}
|
||||
{{ partialCached "adsense-script.html" . }}
|
||||
Reference in New Issue
Block a user