Skip to content

Commit

Permalink
Whitespace cleanup in selected layouts (#1580)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin committed Jun 26, 2023
1 parent 6f03b4b commit bf65c18
Show file tree
Hide file tree
Showing 11 changed files with 100 additions and 100 deletions.
18 changes: 9 additions & 9 deletions layouts/_default/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
<h1>{{ .Title }}</h1>
{{ with .Params.description }}<div class="lead">{{ . | markdownify }}</div>{{ end }}
<header class="article-meta">
{{ 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 -}}
</header>
{{ .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 }}
<br />
{{ end }}
{{ if (.Site.Params.DisqusShortname) }}
{{ end -}}
{{ if (.Site.Params.DisqusShortname) -}}
<br />
{{ partial "disqus-comment.html" . }}
{{ end }}
{{- partial "disqus-comment.html" . -}}
{{ end -}}
{{ partial "page-meta-lastmod.html" . }}
</div>
{{/**/ -}}
8 changes: 4 additions & 4 deletions layouts/_default/taxonomy.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ <h3><a href="{{ $manualLink }}"{{ with .Params.manualLinkTitle }} title="{{ . }}
{{ end -}}
<p>{{ .Description | markdownify }}</p>
<header class="article-meta">
{{ 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 -}}
</header>
</article>
{{ end }}
Expand Down
6 changes: 3 additions & 3 deletions layouts/_default/terms.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{ define "main" }}
{{ define "main" -}}
<div class="td-content">
<main class="taxonomy-terms-page">
<h1>{{ .Title }}</h1>
{{ partial "taxonomy_terms_cloud.html" (dict "context" . "taxo" ( lower .Title ) ) }}
{{ partial "taxonomy_terms_cloud.html" (dict "context" . "taxo" ( lower .Title ) ) -}}
</main>
</div>
{{ end }}
{{- end }}
14 changes: 7 additions & 7 deletions layouts/blog/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ <h1>{{ .Title }}</h1>
<time datetime="{{ $.Date.Format "2006-01-02" }}" class="text-muted">{{ $.Date.Format $.Site.Params.time_format_blog }}</time>
</div>
<header class="article-meta">
{{ 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 -}}
</header>
{{ .Content }}
{{ if (.Site.Params.DisqusShortname) }}
{{ if (.Site.Params.DisqusShortname) -}}
<br />
{{ partial "disqus-comment.html" . }}
{{- partial "disqus-comment.html" . -}}
<br />
{{ end }}
{{ end -}}

{{ partial "pager.html" . }}
</div>
4 changes: 2 additions & 2 deletions layouts/blog/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<div class="td-blog-posts">
{{ if .Pages -}}
{{ $pag := .Paginate (( $.Scratch.Get "blog-pages").GroupByDate "2006" ) -}}
{{ range $pag.PageGroups }}
{{ range $pag.PageGroups -}}
<div class="h2">{{ T "post_posts_in" }} {{ .Key }}</div>
<ul class="td-blog-posts-list">
{{ range .Pages }}
{{ range .Pages -}}
<li class="td-blog-posts-list__item">
<div class="td-blog-posts-list__body">
<h5 class="mt-0 mb-1"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h5>
Expand Down
26 changes: 13 additions & 13 deletions layouts/docs/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
<h1>{{ .Title }}</h1>
{{ with .Params.description }}<div class="lead">{{ . | markdownify }}</div>{{ end }}
<header class="article-meta">
{{ 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 -}}
</header>
{{ .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 -}}
<br />
{{ end }}
{{ if (.Site.DisqusShortname) }}
{{ end -}}
{{ if (.Site.DisqusShortname) -}}
<br />
{{ partial "disqus-comment.html" . }}
{{ end }}
{{ partial "page-meta-lastmod.html" . }}
{{- partial "disqus-comment.html" . -}}
{{ end -}}
{{ partial "page-meta-lastmod.html" . -}}
</div>
{{ end }}
{{ end -}}
12 changes: 6 additions & 6 deletions layouts/partials/taxonomy_terms_article.html
Original file line number Diff line number Diff line change
@@ -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) -}}
<div class="taxonomy taxonomy-terms-article taxo-{{ urlize $taxo }}">
<h5 class="taxonomy-title">{{ humanize $taxo }}:</h5>
<ul class="taxonomy-terms">
{{ range ($context.GetTerms $taxo) }}
{{ range ($context.GetTerms $taxo) -}}
<li><a class="taxonomy-term" href="{{ .Permalink }}" data-taxonomy-term="{{ urlize .LinkTitle }}"><span class="taxonomy-label">{{ .LinkTitle }}</span></a></li>
{{ end }}
{{ end -}}
</ul>
</div>
{{ end }}
{{ end -}}
26 changes: 13 additions & 13 deletions layouts/partials/taxonomy_terms_article_wrapper.html
Original file line number Diff line number Diff line change
@@ -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 }}
{{ end -}}
24 changes: 12 additions & 12 deletions layouts/partials/taxonomy_terms_cloud.html
Original file line number Diff line number Diff line change
@@ -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) -}}
<div class="taxonomy taxonomy-terms-cloud taxo-{{ urlize $taxo }}">
{{ with $title }}
{{ with $title -}}
<h5 class="taxonomy-title">{{ . }}</h5>
{{ end }}
{{ end -}}
<ul class="taxonomy-terms">
{{ range $taxonomy }}
{{ range $taxonomy -}}
<li><a class="taxonomy-term" href="{{ .Page.Permalink }}" data-taxonomy-term="{{ urlize .Page.Title }}"><span class="taxonomy-label">{{ .Page.Title }}</span><span class="taxonomy-count">{{ .Count }}</span></a></li>
{{ end }}
{{ end -}}
</ul>
</div>
{{ end }}
{{ end }}
{{ end -}}
{{ end -}}
36 changes: 18 additions & 18 deletions layouts/partials/taxonomy_terms_clouds.html
Original file line number Diff line number Diff line change
@@ -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 }}
{{ end -}}
26 changes: 13 additions & 13 deletions layouts/swagger/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
<h1>{{ .Title }}</h1>
{{ with .Params.description }}<div class="lead">{{ . | markdownify }}</div>{{ end }}
<header class="article-meta">
{{ 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 -}}
</header>
{{ .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 -}}
<br />
{{ end }}
{{ if (.Site.DisqusShortname) }}
{{ end -}}
{{ if (.Site.DisqusShortname) -}}
<br />
{{ partial "disqus-comment.html" . }}
{{ end }}
{{ partial "page-meta-lastmod.html" . }}
{{ partial "disqus-comment.html" . -}}
{{ end -}}
{{ partial "page-meta-lastmod.html" . -}}
</div>
{{ end }}
{{ end -}}

0 comments on commit bf65c18

Please sign in to comment.