hugo-theme-next/layouts/partials/head/styles.html

33 lines
1.1 KiB
HTML
Raw Normal View History

<!-- Plugin style files -->
{{ $cssRes := .Site.Data.resources.css }}
{{ $vendor := .Site.Params.vendors.plugins }}
{{ $router := .Scratch.Get "router" }}
{{ range $css := $cssRes }}
{{ $pluginCss := partial "_funs/get_cdn_res.html" (dict "res" . "vendor" $vendor "router" $router) }}
<link type="text/css" rel="stylesheet" href="{{ $pluginCss }}" />
{{ end }}
<!-- Main Style file -->
{{ $scss := resources.Get "css/main.scss" }}
{{ $scss = $scss | resources.ExecuteAsTemplate "main.scss" . }}
{{ $css := $scss | toCSS (dict "targetPath" "/css/main.css" "outputStyle" "expanded") }}
{{ if hugo.IsProduction }}
{{ $css = $css | minify }}
{{ end }}
{{ $unixHref := partial "_funs/add_unix_param.html" $css.RelPermalink }}
<link rel="stylesheet" href="{{ $unixHref }}">
<!-- Extend Style -->
<style type="text/css">
{{ partialCached "head/style/global.html" . }}
{{ partial "head/style/plugins.html" . }}
</style>
<!-- Custom Style file -->
{{ $custom := .Scratch.Get "style" }}
{{ if $custom }}
{{ $unixHref := partial "_funs/add_unix_param.html" $custom }}
<link rel="stylesheet" type="text/css" href="{{ $unixHref }}">
{{ end }}