1313bd9779
Having the CSS and JS in the html template produces pages larger than necessary, as each page need to contain all the js/css. Separating them in appropriate files allow the browser to just download them once and use them for all the pages. This is even more effective with an aggressive cache policy for the js and css, something that can be done without fear thanks to the implemented cache-busting. Also, having then in separate files allows us to use Hugo pipelines for minimizing the code.
7 lines
263 B
HTML
7 lines
263 B
HTML
{{if $.Site.Data.config.enableLinkPreview}}
|
|
{{ $js := resources.Get "js/popover.js" | resources.Fingerprint "md5" | resources.Minify }}
|
|
<script src="{{ $js.Permalink }}"></script>
|
|
<script>
|
|
initPopover({{strings.TrimRight "/" .Site.BaseURL }})
|
|
</script>
|
|
{{end}} |