From cefc10bbe187329f5ee79f2b031ed5ba9d26776d Mon Sep 17 00:00:00 2001 From: Will Faught Date: Fri, 6 Jan 2023 17:23:56 -0800 Subject: [PATCH] Remove most class and style params --- layouts/partials/paige/a.html | 2 +- layouts/partials/paige/figure.html | 12 ++---- layouts/partials/paige/image-figure.html | 33 +++++---------- layouts/shortcodes/paige/code.html | 16 -------- layouts/shortcodes/paige/figure.html | 16 -------- layouts/shortcodes/paige/gallery.html | 51 +++++------------------- layouts/shortcodes/paige/image.html | 22 +--------- 7 files changed, 27 insertions(+), 125 deletions(-) diff --git a/layouts/partials/paige/a.html b/layouts/partials/paige/a.html index 255e0bc9..d5282bd0 100644 --- a/layouts/partials/paige/a.html +++ b/layouts/partials/paige/a.html @@ -3,4 +3,4 @@ {{ $href := .href }} {{ $style := .style }} -{{ $content }} +{{ $content }} diff --git a/layouts/partials/paige/figure.html b/layouts/partials/paige/figure.html index 8e11b198..dd6d04a8 100644 --- a/layouts/partials/paige/figure.html +++ b/layouts/partials/paige/figure.html @@ -1,15 +1,9 @@ {{ $caption := .caption | markdownify }} -{{ $captionclass := .captionclass | default "figure-caption" }} -{{ $captionstyle := .captionstyle }} -{{ $class := .class | default "align-items-center d-flex flex-column justify-content-center paige-figure" }} {{ $content := .content | markdownify }} -{{ $contentclass := .contentclass }} -{{ $contentstyle := .contentstyle }} -{{ $style := .style }} -
-
{{ $content }}
+
+
{{ $content }}
{{ with $caption }} -
{{ . }}
+
{{ . }}
{{ end }}
diff --git a/layouts/partials/paige/image-figure.html b/layouts/partials/paige/image-figure.html index 4b21efb1..d458a7df 100644 --- a/layouts/partials/paige/image-figure.html +++ b/layouts/partials/paige/image-figure.html @@ -1,37 +1,30 @@ {{ $alt := .alt }} {{ $caption := .caption }} -{{ $captionclass := .captionclass }} -{{ $captionstyle := .captionstyle }} -{{ $class := .class }} -{{ $contentclass := .contentclass }} -{{ $contentstyle := .contentstyle }} {{ $height := .height }} -{{ $imageclass := .imageclass | default "img-fluid" }} -{{ $imagestyle := .imagestyle }} {{ $link := .link }} {{ $method := .method }} {{ $options := .options }} {{ $page := .page }} {{ $resource := .resource }} {{ $src := .src }} -{{ $style := .style }} +{{ $table := .table }} {{ $title := .title }} {{ $width := .width }} -{{ if and (not $contentclass) $caption }} - {{ $contentclass = "figure-img" }} +{{ $class := "img-fluid" }} +{{ if $caption }} + {{ $class = "figure-img img-fluid" }} {{ end }} {{ $content := partial "paige/img.html" (dict "alt" $alt - "class" $imageclass + "class" $class "height" $height "method" $method "options" $options "page" $page "resource" $resource "src" $src - "style" $imagestyle "title" $title "width" $width ) }} @@ -43,13 +36,9 @@ ) }} {{ end }} -{{ partial "paige/figure.html" (dict - "caption" $caption - "captionclass" $captionclass - "captionstyle" $captionstyle - "class" $class - "content" $content - "contentclass" $contentclass - "contentstyle" $contentstyle - "style" $style -) }} +
+ {{ $content }} + {{ with $caption }} +
{{ . }}
+ {{ end }} +
diff --git a/layouts/shortcodes/paige/code.html b/layouts/shortcodes/paige/code.html index c41095e6..f849f9d9 100644 --- a/layouts/shortcodes/paige/code.html +++ b/layouts/shortcodes/paige/code.html @@ -1,26 +1,10 @@ {{ $caption := .Get "caption" }} -{{ $captionclass := .Get "captionclass" }} -{{ $captionstyle := .Get "captionstyle" }} -{{ $class := .Get "class" }} -{{ $contentclass := .Get "contentclass" | default "mb-2" }} -{{ $contentstyle := .Get "contentstyle" }} {{ $lang := .Get 0 | default (.Get "lang") | default "plaintext" }} {{ $options := .Get "options" }} -{{ $style := .Get "style" }} - -{{ if $caption }} - {{ $contentclass = $contentclass | default "mb-2" }} -{{ end }} {{ $content := highlight (.Inner | replaceRE "^\n" "") $lang $options }} {{ partial "paige/figure.html" (dict "caption" $caption - "captionclass" $captionclass - "captionstyle" $captionstyle - "class" $class "content" $content - "contentclass" $contentclass - "contentstyle" $contentstyle - "style" $style ) }} diff --git a/layouts/shortcodes/paige/figure.html b/layouts/shortcodes/paige/figure.html index ec90ec1e..7d005971 100644 --- a/layouts/shortcodes/paige/figure.html +++ b/layouts/shortcodes/paige/figure.html @@ -1,24 +1,8 @@ {{ $caption := .Get 0 | default (.Get "caption") }} -{{ $captionclass := .Get "captionclass" }} -{{ $captionstyle := .Get "captionstyle" }} -{{ $class := .Get "class" }} -{{ $contentclass := .Get "contentclass" }} -{{ $contentstyle := .Get "contentstyle" }} -{{ $style := .Get "style" }} - -{{ if $caption }} - {{ $contentclass = $contentclass | default "mb-2" }} -{{ end }} {{ $content := .Inner }} {{ partial "paige/figure.html" (dict "caption" $caption - "captionclass" $captionclass - "captionstyle" $captionstyle - "class" $class "content" $content - "contentclass" $contentclass - "contentstyle" $contentstyle - "style" $style ) }} diff --git a/layouts/shortcodes/paige/gallery.html b/layouts/shortcodes/paige/gallery.html index e2946a2a..0e2215d3 100644 --- a/layouts/shortcodes/paige/gallery.html +++ b/layouts/shortcodes/paige/gallery.html @@ -1,25 +1,15 @@ +{{ $align := .Get "align" | default "center" }} {{ $caption := .Get "caption" }} -{{ $captionclass := .Get "captionclass" }} -{{ $captionstyle := .Get "captionstyle" }} -{{ $class := .Get "class" }} -{{ $contentclass := .Get "contentclass" }} -{{ $contentstyle := .Get "contentstyle" }} +{{ $height := .Get "height" }} {{ $image := .Get "image" }} -{{ $imageclass := .Get "imageclass" }} {{ $images := .Get 0 | default (.Get "images") }} -{{ $imagestyle := .Get "imagestyle" }} -{{ $innercaptionclass := .Get "innercaptionclass" }} -{{ $innercaptionstyle := .Get "innercaptionstyle" }} -{{ $innerclass := .Get "innerclass" | default "d-table mb-0" }} -{{ $innerstyle := .Get "innerstyle" }} +{{ $justify := .Get "justify" | default "center" }} {{ $method := .Get "method" | default "resize" }} {{ $options := .Get "options" | default "550x webp picture Lanczos" }} -{{ $style := .Get "style" }} {{ $type := .Get "type" | default "rows" }} +{{ $width := .Get "width" }} {{ if $image }} - {{ $captionclass = $captionclass | default "figure-caption text-center" }} - {{ $captionstyle = $captionstyle | default "caption-side: bottom; display: table-caption" }} {{ $resource := partial "paige/func-resource.html" (dict "page" .Page "url" $image @@ -27,20 +17,13 @@ {{ partial "paige/image-figure.html" (dict "caption" $caption - "captionclass" $captionclass - "captionstyle" $captionstyle - "class" $innerclass - "contentclass" $contentclass - "contentstyle" $contentstyle - "imageclass" $imageclass - "imagestyle" $imagestyle "link" $resource.RelPermalink "method" $method "options" $options "page" .Page "resource" $resource "src" $image - "style" $innerstyle + "table" true ) }} {{ else }} {{ $inner := chomp .Inner }} @@ -63,49 +46,35 @@
{{ if eq $type "grid" }}
-
+
{{ with $inner }} {{ . }} {{ else }} {{ range $resources }} {{ partial "paige/image-figure.html" (dict - "captionclass" $captionclass - "captionstyle" $captionstyle - "class" $innerclass - "contentclass" $contentclass - "contentstyle" $contentstyle - "imageclass" $imageclass - "imagestyle" $imagestyle "link" .RelPermalink "method" $method "options" $options "resource" . - "style" $innerstyle + "table" true ) }} {{ end }} {{ end }}
{{ else if eq $type "rows" }} - {{ $imagestyle = $imagestyle | default "max-height: 10rem" }} -
+
{{ with $inner }} {{ . }} {{ else }} {{ range $resources }} {{ partial "paige/image-figure.html" (dict - "captionclass" $captionclass - "captionstyle" $captionstyle - "class" $innerclass - "contentclass" $contentclass - "contentstyle" $contentstyle - "imageclass" $imageclass - "imagestyle" $imagestyle + "height" "10rem" "link" .RelPermalink "method" $method "options" $options "resource" . - "style" $innerstyle + "table" true ) }} {{ end }} {{ end }} diff --git a/layouts/shortcodes/paige/image.html b/layouts/shortcodes/paige/image.html index 3dcbab9f..c71ff3d7 100644 --- a/layouts/shortcodes/paige/image.html +++ b/layouts/shortcodes/paige/image.html @@ -1,39 +1,21 @@ {{ $alt := .Get "alt" }} {{ $caption := .Get "caption" }} -{{ $captionclass := .Get "captionclass" }} -{{ $captionstyle := .Get "captionstyle" }} -{{ $class := .Get "class" }} -{{ $contentclass := .Get "contentclass" }} -{{ $contentstyle := .Get "contentstyle" }} {{ $height := .Get "height" }} -{{ $imageclass := .Get "imageclass" }} -{{ $imagestyle := .Get "imagestyle" }} {{ $link := .Get "link" }} {{ $method := .Get "method" }} {{ $options := .Get "options" }} {{ $src := .Get 0 | default (.Get "src") }} -{{ $style := .Get "style" }} {{ $title := .Get "title" }} {{ $width := .Get "width" }} {{ partial "paige/image-figure.html" (dict - "caption" $caption - "captionclass" $captionclass - "captionstyle" $captionstyle - "class" $class - "contentclass" $contentclass - "contentstyle" $contentstyle - "style" $style - "alt" $alt + "caption" $caption "height" $height - "imageclass" $imageclass - "imagestyle" $imagestyle + "link" $link "method" $method "options" $options "src" $src "title" $title "width" $width - - "link" $link ) }}