Remove most class and style params

This commit is contained in:
Will Faught
2023-01-06 17:23:56 -08:00
parent 9f89cd3f0f
commit cefc10bbe1
7 changed files with 27 additions and 125 deletions

View File

@@ -3,4 +3,4 @@
{{ $href := .href }}
{{ $style := .style }}
<a {{ with $class }} {{ . }} {{ end }} {{ with $href }} href="{{ . }}" {{ end }} {{ with $style }} {{ . | safeCSS }} {{ end }}>{{ $content }}</a>
<a {{ with $class }} class="{{ . }}" {{ end }} {{ with $href }} href="{{ . }}" {{ end }} {{ with $style }} style="{{ . | safeCSS }}" {{ end }}>{{ $content }}</a>

View File

@@ -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 }}
<figure {{ with $class }} class="{{ . }}" {{ end }} {{ with $style }} style="{{ . | safeCSS }}" {{ end }}>
<div {{ with $contentclass }} class="{{ . }}" {{ end }} {{ with $contentstyle }} style="{{ . | safeCSS }}" {{ end }}>{{ $content }}</div>
<figure class="align-items-center d-flex flex-column justify-content-center paige-figure">
<div {{ if $caption }} class="mb-2" {{ end }}>{{ $content }}</div>
{{ with $caption }}
<figcaption {{ with $captionclass }} class="{{ . }}" {{ end }} {{ with $captionstyle }} style="{{ . | safeCSS }}" {{ end }}>{{ . }}</figcaption>
<figcaption class="figure-caption">{{ . }}</figcaption>
{{ end }}
</figure>

View File

@@ -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
) }}
<figure class="{{ if $table }} d-table mb-0 {{ end }} paige-figure text-center">
{{ $content }}
{{ with $caption }}
<figcaption class="figure-caption" {{ if $table }} style="caption-side: bottom; display: table-caption" {{ end }}>{{ . }}</figcaption>
{{ end }}
</figure>