mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 07:18:57 +00:00
Merge branch 'main' into v1
* main: fix: Dart Sass compatibility + feat: add imagePreview config for home page (#741)
This commit is contained in:
@@ -721,6 +721,8 @@ disclaimer = ""
|
||||
enable = true
|
||||
# special amount of posts in each home posts page
|
||||
paginate = 6
|
||||
# whether to show featured image preview in home page post list
|
||||
imagePreview = true
|
||||
|
||||
# FixIt 0.2.16 | CHANGED Social config about the author
|
||||
[params.social]
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
{{- $resource = $resource | resources.ExecuteAsTemplate . $.Context -}}
|
||||
{{- end -}}
|
||||
{{- with .ToCSS -}}
|
||||
{{- $options := . | merge (dict "outputStyle" "compressed") -}}
|
||||
{{- $options := . | merge (dict "outputStyle" "compressed" "transpiler" "dartsass" "silenceDeprecations" (slice "import" "global-builtin" "color-functions" "function-units")) -}}
|
||||
{{- $resource = $resource | toCSS $options -}}
|
||||
{{- end -}}
|
||||
{{- if .Minify -}}
|
||||
@@ -62,3 +62,4 @@
|
||||
<link rel="stylesheet" {{ $attrs | safeHTMLAttr }}>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
+20
-18
@@ -2,24 +2,26 @@
|
||||
|
||||
<article class="single summary" itemscope itemtype="http://schema.org/Article">
|
||||
{{- /* Featured image */ -}}
|
||||
{{- $image := $params.featuredimagepreview | default $params.featuredimage -}}
|
||||
{{- $matches := slice -}}
|
||||
{{- if .Resources.GetMatch "featured-image-preview" -}}
|
||||
{{- $matches = $matches | append "featured-image-preview" -}}
|
||||
{{- else if .Resources.GetMatch "featured-image" -}}
|
||||
{{- $matches = $matches | append "featured-image" -}}
|
||||
{{- end -}}
|
||||
{{- if $image | or (gt (len $matches) 0) -}}
|
||||
<div class="featured-image-preview">
|
||||
<a href="{{ $.RelPermalink }}" aria-label="{{ $.Title }}">
|
||||
{{- $optim := slice
|
||||
(dict "Process" "fill 800x336 Center webp" "descriptor" "800w")
|
||||
(dict "Process" "fill 1200x504 Center webp" "descriptor" "1200w")
|
||||
(dict "Process" "fill 1600x672 Center webp" "descriptor" "1600w")
|
||||
-}}
|
||||
{{- dict "Src" $image "Title" $.Title "Resources" $.Resources "Matches" $matches "Loading" "eager" "Width" "800" "Height" "336" "Sizes" "(max-width: 680px) 100vw, (max-width: 960px) 80vw, (max-width: 1440px) 56vw, 800px" "OptimConfig" $optim "Alt" (printf "Featured image for %v" $.Title) | partial "plugin/image.html" -}}
|
||||
</a>
|
||||
</div>
|
||||
{{- if ne .Site.Params.home.posts.imagePreview false -}}
|
||||
{{- $image := $params.featuredimagepreview | default $params.featuredimage -}}
|
||||
{{- $matches := slice -}}
|
||||
{{- if .Resources.GetMatch "featured-image-preview" -}}
|
||||
{{- $matches = $matches | append "featured-image-preview" -}}
|
||||
{{- else if .Resources.GetMatch "featured-image" -}}
|
||||
{{- $matches = $matches | append "featured-image" -}}
|
||||
{{- end -}}
|
||||
{{- if $image | or (gt (len $matches) 0) -}}
|
||||
<div class="featured-image-preview">
|
||||
<a href="{{ $.RelPermalink }}" aria-label="{{ $.Title }}">
|
||||
{{- $optim := slice
|
||||
(dict "Process" "fill 800x336 Center webp" "descriptor" "800w")
|
||||
(dict "Process" "fill 1200x504 Center webp" "descriptor" "1200w")
|
||||
(dict "Process" "fill 1600x672 Center webp" "descriptor" "1600w")
|
||||
-}}
|
||||
{{- dict "Src" $image "Title" $.Title "Resources" $.Resources "Matches" $matches "Loading" "eager" "Width" "800" "Height" "336" "Sizes" "(max-width: 680px) 100vw, (max-width: 960px) 80vw, (max-width: 1440px) 56vw, 800px" "OptimConfig" $optim "Alt" (printf "Featured image for %v" $.Title) | partial "plugin/image.html" -}}
|
||||
</a>
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Title */ -}}
|
||||
|
||||
Reference in New Issue
Block a user