Skip to content

Commit

Permalink
Merge branch 'main' into xmr/scss
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR authored Mar 30, 2024
2 parents d625036 + 6c8768e commit 5c75f8a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@
</div>

{{ partial "footer" . }}
{{ partial "scripts" . }}
</body>
</html>
2 changes: 1 addition & 1 deletion src/layouts/partials/analytics.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<script defer src="https://cdn.usefathom.com/script.js" data-site="{{ .Site.Params.analytics.fathom_site }}"></script>
<script async src="https://cdn.usefathom.com/script.js" data-site="{{ .Site.Params.analytics.fathom_site }}"></script>
4 changes: 2 additions & 2 deletions src/layouts/partials/author-info.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<img class="mb-0 me-2 rounded-2"
srcset="{{ $imgUrl }}, {{ $imgUrl2x }} 2x"
src="{{ $imgUrl }}"
alt=""
{{ if eq .lazyload true }}loading="lazy"{{ end }}
alt=""{{ if eq .lazyload true }}
loading="lazy"{{ end }}
width="{{ $avatarWidth }}"
height="{{ $avatarHeight }}">
<span>@{{ $author }}</span>
Expand Down
7 changes: 5 additions & 2 deletions src/layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="preconnect" href="https://github.com">
<link rel="preconnect" href="https://avatars.githubusercontent.com">
<link rel="preconnect" href="https://github.com" crossorigin>
<link rel="preconnect" href="https://avatars.githubusercontent.com" crossorigin>
<link rel="preload" href="/assets/brand/bootstrap-logo-shadow.png" imagesrcset="/assets/brand/bootstrap-logo-shadow.png, /assets/brand/[email protected] 2x" as="image">

<link rel="profile" href="https://gmpg.org/xfn/11">
Expand All @@ -24,4 +24,7 @@
{{ partial "stylesheet" . -}}
{{ partial "favicons" . -}}
{{ partial "social" . -}}
{{ partial "scripts" . -}}
{{- if hugo.IsProduction }}
{{ partial "analytics" . -}}
{{- end }}
11 changes: 5 additions & 6 deletions src/layouts/partials/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
{{- $esbuildOptions = merge $esbuildOptions (dict "minify" "true") -}}
{{- end -}}

{{- $bootstrapJs := resources.Get "/js/vendor/bootstrap.bundle.min.js" | fingerprint | resources.Copy "/assets/js/vendor/bootstrap.bundle.min.js" -}}
{{- $bootstrapJs := resources.Get "js/vendor/bootstrap.bundle.min.js" | fingerprint | resources.Copy "/assets/js/vendor/bootstrap.bundle.min.js" }}
<script defer src="{{ $bootstrapJs.RelPermalink }}"></script>

{{- $scripts := slice "js/application.js" "js/lazyload.js" -}}
{{- range $scriptFile := $scripts -}}
{{- $script := resources.Get $scriptFile | js.Build $esbuildOptions | fingerprint | resources.Copy (path.Join "/assets" $scriptFile) -}}

{{- $script := resources.Get $scriptFile | js.Build $esbuildOptions | fingerprint | resources.Copy (path.Join "/assets" $scriptFile) }}
<script defer src="{{ $script.RelPermalink }}"></script>
{{- end -}}
{{- end }}

{{ range .Page.Params.extra_js -}}
{{- range .Page.Params.extra_js }}
<script{{ with .async }} async{{ end }}{{ with .defer }} defer{{ end }} src="{{ .src }}"{{ with .integrity }} {{ printf "integrity=%q" . | safeHTMLAttr }} crossorigin="anonymous"{{ end }}></script>
{{- end -}}
{{- end }}
5 changes: 2 additions & 3 deletions src/layouts/partials/stylesheet.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{{ $sassOptions := dict "targetPath" "/assets/css/style.css" "outputStyle" "expanded" "precision" 6 -}}
{{- $sassOptions := dict "targetPath" "/assets/css/style.css" "outputStyle" "expanded" "precision" 6 -}}
{{- $postcssOptions := dict "use" "autoprefixer" "noMap" true -}}

{{- if hugo.IsProduction -}}
{{- $sassOptions = merge $sassOptions (dict "outputStyle" "compressed") -}}
{{- end -}}

{{- $style := resources.Get "scss/style.scss" | toCSS $sassOptions | postCSS $postcssOptions | fingerprint -}}

{{- $style := resources.Get "scss/style.scss" | toCSS $sassOptions | postCSS $postcssOptions | fingerprint }}
<link href="{{ $style.RelPermalink }}" rel="stylesheet">

0 comments on commit 5c75f8a

Please sign in to comment.