hugo-theme-next/layouts/partials/_funs/get_plugin.html

11 lines
458 B
HTML
Raw Permalink Normal View History

{{/* Get third party js plugins resource */}}
{{ $pluginPath := printf "%s/%s/%s" "js/3rd" .class .plugin }}
{{ $targetPath := printf "js/%s" .plugin }}
{{ $plugin := resources.Get $pluginPath | resources.ExecuteAsTemplate $targetPath .ctx }}
{{ if hugo.IsProduction }}
{{ $plugin = $plugin | minify }}
{{ end }}
{{ $unixSrc := partial "_funs/add_unix_param.html" $plugin.RelPermalink }}
<script type="text/javascript" src="{{ $unixSrc }}" defer></script>