From bf65c18d2845055b4a3f1b922d5b6761f0671448 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Mon, 26 Jun 2023 15:16:24 -0400 Subject: [PATCH] Whitespace cleanup in selected layouts (#1580) --- layouts/_default/content.html | 18 +++++----- layouts/_default/taxonomy.html | 8 ++--- layouts/_default/terms.html | 6 ++-- layouts/blog/content.html | 14 ++++---- layouts/blog/list.html | 4 +-- layouts/docs/list.html | 26 +++++++------- layouts/partials/taxonomy_terms_article.html | 12 +++---- .../taxonomy_terms_article_wrapper.html | 26 +++++++------- layouts/partials/taxonomy_terms_cloud.html | 24 ++++++------- layouts/partials/taxonomy_terms_clouds.html | 36 +++++++++---------- layouts/swagger/list.html | 26 +++++++------- 11 files changed, 100 insertions(+), 100 deletions(-) diff --git a/layouts/_default/content.html b/layouts/_default/content.html index ca8259310c..193927abb1 100644 --- a/layouts/_default/content.html +++ b/layouts/_default/content.html @@ -2,20 +2,20 @@

{{ .Title }}

{{ with .Params.description }}
{{ . | markdownify }}
{{ end }}
- {{ partial "taxonomy_terms_article_wrapper.html" . }} - {{ if (and (not .Params.hide_readingtime) (.Site.Params.ui.readingtime.enable)) }} - {{ partial "reading-time.html" . }} - {{ end }} + {{ partial "taxonomy_terms_article_wrapper.html" . -}} + {{ if (and (not .Params.hide_readingtime) (.Site.Params.ui.readingtime.enable)) -}} + {{ partial "reading-time.html" . -}} + {{ end -}}
{{ .Content }} - {{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.GoogleAnalytics)) }} + {{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.GoogleAnalytics)) -}} {{ partial "feedback.html" .Site.Params.ui.feedback }}
- {{ end }} - {{ if (.Site.Params.DisqusShortname) }} + {{ end -}} + {{ if (.Site.Params.DisqusShortname) -}}
- {{ partial "disqus-comment.html" . }} - {{ end }} + {{- partial "disqus-comment.html" . -}} + {{ end -}} {{ partial "page-meta-lastmod.html" . }} {{/**/ -}} diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html index b59a677d0e..ff6b8deef8 100644 --- a/layouts/_default/taxonomy.html +++ b/layouts/_default/taxonomy.html @@ -18,10 +18,10 @@

- {{ partial "taxonomy_terms_article_wrapper.html" . }} - {{ if (and (not .Params.hide_readingtime) (.Site.Params.ui.readingtime.enable)) }} - {{ partial "reading-time.html" . }} - {{ end }} + {{ partial "taxonomy_terms_article_wrapper.html" . -}} + {{ if (and (not .Params.hide_readingtime) (.Site.Params.ui.readingtime.enable)) -}} + {{ partial "reading-time.html" . -}} + {{ end -}} {{ end }} diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html index 0190198635..74af83e26e 100644 --- a/layouts/_default/terms.html +++ b/layouts/_default/terms.html @@ -1,8 +1,8 @@ -{{ define "main" }} +{{ define "main" -}}

{{ .Title }}

- {{ partial "taxonomy_terms_cloud.html" (dict "context" . "taxo" ( lower .Title ) ) }} + {{ partial "taxonomy_terms_cloud.html" (dict "context" . "taxo" ( lower .Title ) ) -}}
-{{ end }} \ No newline at end of file +{{- end }} diff --git a/layouts/blog/content.html b/layouts/blog/content.html index c74806a6f8..d95b8e00c7 100644 --- a/layouts/blog/content.html +++ b/layouts/blog/content.html @@ -6,17 +6,17 @@

{{ .Title }}

{{ .Content }} - {{ if (.Site.Params.DisqusShortname) }} + {{ if (.Site.Params.DisqusShortname) -}}
- {{ partial "disqus-comment.html" . }} + {{- partial "disqus-comment.html" . -}}
- {{ end }} + {{ end -}} {{ partial "pager.html" . }} diff --git a/layouts/blog/list.html b/layouts/blog/list.html index 4c95d2206f..8abbe1c6c9 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -8,10 +8,10 @@
{{ if .Pages -}} {{ $pag := .Paginate (( $.Scratch.Get "blog-pages").GroupByDate "2006" ) -}} - {{ range $pag.PageGroups }} + {{ range $pag.PageGroups -}}
{{ T "post_posts_in" }} {{ .Key }}
    - {{ range .Pages }} + {{ range .Pages -}}
  • {{ .Title }}
    diff --git a/layouts/docs/list.html b/layouts/docs/list.html index e2679fb2f9..376ed81cd4 100644 --- a/layouts/docs/list.html +++ b/layouts/docs/list.html @@ -3,21 +3,21 @@

    {{ .Title }}

    {{ with .Params.description }}
    {{ . | markdownify }}
    {{ end }} {{ .Content }} - {{ partial "section-index.html" . }} - {{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.GoogleAnalytics)) }} - {{ partial "feedback.html" .Site.Params.ui.feedback }} + {{ partial "section-index.html" . -}} + {{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.GoogleAnalytics)) -}} + {{ partial "feedback.html" .Site.Params.ui.feedback -}}
    - {{ end }} - {{ if (.Site.DisqusShortname) }} + {{ end -}} + {{ if (.Site.DisqusShortname) -}}
    - {{ partial "disqus-comment.html" . }} - {{ end }} - {{ partial "page-meta-lastmod.html" . }} + {{- partial "disqus-comment.html" . -}} + {{ end -}} + {{ partial "page-meta-lastmod.html" . -}}
    -{{ end }} +{{ end -}} diff --git a/layouts/partials/taxonomy_terms_article.html b/layouts/partials/taxonomy_terms_article.html index c1684a5068..79ef364f74 100644 --- a/layouts/partials/taxonomy_terms_article.html +++ b/layouts/partials/taxonomy_terms_article.html @@ -1,12 +1,12 @@ -{{ $context := .context }} -{{ $taxo := .taxo }} -{{ if (gt (len ($context.GetTerms $taxo)) 0)}} +{{ $context := .context -}} +{{ $taxo := .taxo -}} +{{ if (gt (len ($context.GetTerms $taxo)) 0) -}}
    {{ humanize $taxo }}:
      - {{ range ($context.GetTerms $taxo) }} + {{ range ($context.GetTerms $taxo) -}}
    • {{ .LinkTitle }}
    • - {{ end }} + {{ end -}}
    -{{ end }} \ No newline at end of file +{{ end -}} diff --git a/layouts/partials/taxonomy_terms_article_wrapper.html b/layouts/partials/taxonomy_terms_article_wrapper.html index e20af69a89..a99ffc359c 100644 --- a/layouts/partials/taxonomy_terms_article_wrapper.html +++ b/layouts/partials/taxonomy_terms_article_wrapper.html @@ -1,16 +1,16 @@ -{{ $context := . }} -{{ if .Site.Params.Taxonomy }} - {{ if .Site.Params.Taxonomy.taxonomyPageHeader }} - {{ range $index, $taxo := .Site.Params.Taxonomy.taxonomyPageHeader }} - {{ partial "taxonomy_terms_article.html" (dict "context" $context "taxo" $taxo) }} +{{ $context := . -}} +{{ if .Site.Params.Taxonomy -}} + {{ if .Site.Params.Taxonomy.taxonomyPageHeader -}} + {{ range $index, $taxo := .Site.Params.Taxonomy.taxonomyPageHeader -}} + {{ partial "taxonomy_terms_article.html" (dict "context" $context "taxo" $taxo) -}} {{ end }} - {{ else }} - {{ range $taxo, $taxo_map := .Site.Taxonomies }} - {{ partial "taxonomy_terms_article.html" (dict "context" $context "taxo" $taxo) }} + {{ else -}} + {{ range $taxo, $taxo_map := .Site.Taxonomies -}} + {{ partial "taxonomy_terms_article.html" (dict "context" $context "taxo" $taxo) -}} {{ end }} + {{ end -}} +{{ else -}} + {{ range $taxo, $taxo_map := .Site.Taxonomies -}} + {{ partial "taxonomy_terms_article.html" (dict "context" $context "taxo" $taxo) -}} {{ end }} -{{ else }} - {{ range $taxo, $taxo_map := .Site.Taxonomies }} - {{ partial "taxonomy_terms_article.html" (dict "context" $context "taxo" $taxo) }} - {{ end }} -{{ end }} \ No newline at end of file +{{ end -}} diff --git a/layouts/partials/taxonomy_terms_cloud.html b/layouts/partials/taxonomy_terms_cloud.html index 24e116f810..43656f5ed2 100644 --- a/layouts/partials/taxonomy_terms_cloud.html +++ b/layouts/partials/taxonomy_terms_cloud.html @@ -1,18 +1,18 @@ -{{ $context := .context }} -{{ $taxo := .taxo }} -{{ $title := .title }} -{{ if isset $context.Site.Taxonomies (lower $taxo) }} - {{ $taxonomy := index $context.Site.Taxonomies (lower $taxo) }} - {{ if (gt (len $taxonomy) 0)}} +{{ $context := .context -}} +{{ $taxo := .taxo -}} +{{ $title := .title -}} +{{ if isset $context.Site.Taxonomies (lower $taxo) -}} + {{ $taxonomy := index $context.Site.Taxonomies (lower $taxo) -}} + {{ if (gt (len $taxonomy) 0) -}}
    - {{ with $title }} + {{ with $title -}}
    {{ . }}
    - {{ end }} + {{ end -}}
    - {{ end }} -{{ end }} \ No newline at end of file + {{ end -}} +{{ end -}} diff --git a/layouts/partials/taxonomy_terms_clouds.html b/layouts/partials/taxonomy_terms_clouds.html index 472e5f0fc6..1588fb26db 100644 --- a/layouts/partials/taxonomy_terms_clouds.html +++ b/layouts/partials/taxonomy_terms_clouds.html @@ -1,21 +1,21 @@ -{{ $context := . }} -{{ if .Site.Params.taxonomy }} - {{ if .Site.Params.Taxonomy.taxonomyCloud }} - {{ range $index, $taxo := .Site.Params.Taxonomy.taxonomyCloud }} - {{ if $.Site.Params.Taxonomy.taxonomyCloudTitle }} - {{ $.Scratch.Set "title" (index $.Site.Params.Taxonomy.taxonomyCloudTitle $index) }} - {{ else }} - {{ $.Scratch.Set "title" (humanize $taxo) }} - {{ end }} - {{ partial "taxonomy_terms_cloud.html" (dict "context" $context "taxo" $taxo "title" ($.Scratch.Get "title")) }} +{{ $context := . -}} +{{ if .Site.Params.taxonomy -}} + {{ if .Site.Params.Taxonomy.taxonomyCloud -}} + {{ range $index, $taxo := .Site.Params.Taxonomy.taxonomyCloud -}} + {{ if $.Site.Params.Taxonomy.taxonomyCloudTitle -}} + {{ $.Scratch.Set "title" (index $.Site.Params.Taxonomy.taxonomyCloudTitle $index) -}} + {{ else -}} + {{ $.Scratch.Set "title" (humanize $taxo) -}} + {{ end -}} + {{ partial "taxonomy_terms_cloud.html" (dict "context" $context "taxo" $taxo "title" ($.Scratch.Get "title")) -}} {{ end }} - {{ else }} - {{ range $taxo, $taxo_map := .Site.Taxonomies }} - {{ partial "taxonomy_terms_cloud.html" (dict "context" $context "taxo" $taxo "title" (humanize $taxo)) }} + {{ else -}} + {{ range $taxo, $taxo_map := .Site.Taxonomies -}} + {{ partial "taxonomy_terms_cloud.html" (dict "context" $context "taxo" $taxo "title" (humanize $taxo)) -}} {{ end }} + {{ end -}} +{{ else -}} + {{ range $taxo, $taxo_map := .Site.Taxonomies -}} + {{ partial "taxonomy_terms_cloud.html" (dict "context" $context "taxo" $taxo "title" (humanize $taxo)) -}} {{ end }} -{{ else }} - {{ range $taxo, $taxo_map := .Site.Taxonomies }} - {{ partial "taxonomy_terms_cloud.html" (dict "context" $context "taxo" $taxo "title" (humanize $taxo)) }} - {{ end }} -{{ end }} \ No newline at end of file +{{ end -}} diff --git a/layouts/swagger/list.html b/layouts/swagger/list.html index aa1d781909..d988ee8966 100644 --- a/layouts/swagger/list.html +++ b/layouts/swagger/list.html @@ -3,21 +3,21 @@

    {{ .Title }}

    {{ with .Params.description }}
    {{ . | markdownify }}
    {{ end }} {{ .Content }} - {{ partial "section-index.html" . }} - {{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.GoogleAnalytics)) }} - {{ partial "feedback.html" .Site.Params.ui.feedback }} + {{ partial "section-index.html" . -}} + {{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.GoogleAnalytics)) -}} + {{ partial "feedback.html" .Site.Params.ui.feedback -}}
    - {{ end }} - {{ if (.Site.DisqusShortname) }} + {{ end -}} + {{ if (.Site.DisqusShortname) -}}
    - {{ partial "disqus-comment.html" . }} - {{ end }} - {{ partial "page-meta-lastmod.html" . }} + {{ partial "disqus-comment.html" . -}} + {{ end -}} + {{ partial "page-meta-lastmod.html" . -}}
-{{ end }} +{{ end -}}