Refactor some templating to avoid spurious whitespace
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -1,24 +1,23 @@
|
|||||||
{{ define "main" }}
|
{{- define "main" }}
|
||||||
<main>
|
<main>
|
||||||
<article>
|
<article>
|
||||||
{{ if in site.Params.mainSections .Page.Section }}
|
{{- if in site.Params.mainSections .Page.Section }}
|
||||||
<h1 class="page-title blog">{{ .Title }}</h1>
|
<h1 class="page-title blog">{{ .Title }}</h1>
|
||||||
{{ else }}
|
{{- else }}
|
||||||
<h1 class="page-title">{{ .Title }}</h1>
|
<h1 class="page-title">{{ .Title }}</h1>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
|
{{- /* Show post information if it's a post, otherwise just the content */ -}}
|
||||||
{{- /* Show post information if it's a post, otherwise just the content */ -}}
|
{{- if in site.Params.mainSections .Page.Section }}
|
||||||
{{ if in site.Params.mainSections .Page.Section }}
|
<p class="blog-post-info">Posted: <time>{{- .Date.Format "2006-01-02" -}}</time>
|
||||||
<p class="blog-post-info">Posted: <time>{{ .Date.Format "2006-01-02" }}</time>
|
{{- partial "blog-taxonomy-info" . }}
|
||||||
{{ partial "blog-taxonomy-info" . }}</p>
|
</p>
|
||||||
|
<div class="blog-post-content">
|
||||||
<div class="blog-post-content">
|
{{ .Content }}
|
||||||
{{ .Content }}
|
</div>
|
||||||
</div>
|
{{- template "_internal/disqus.html" . }}
|
||||||
{{ template "_internal/disqus.html" . }}
|
{{- else }}
|
||||||
{{ else }}
|
{{- .Content }}
|
||||||
{{ .Content }}
|
{{- end }}
|
||||||
{{ end }}
|
|
||||||
</article>
|
</article>
|
||||||
</main>
|
</main>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
|
@ -38,5 +38,4 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
<br />
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -1,17 +1,16 @@
|
|||||||
{{ with .Params.Categories }}
|
{{- with .Params.Categories }}
|
||||||
<span class="blog-taxonomy-info"> | Categories:
|
<span class="blog-taxonomy-info"> | Categories:
|
||||||
{{ $sort := sort . }}
|
{{- $sort := sort . }}
|
||||||
{{ $links := apply $sort "partial" "post-category-link" "." }}
|
{{- $links := apply $sort "partial" "post-category-link" "." }}
|
||||||
{{ $clean := apply $links "chomp" "." }}
|
{{- $clean := apply $links "chomp" "." }}
|
||||||
{{ delimit $clean ", " | safeHTML }}
|
{{- delimit $clean ", " | safeHTML }}
|
||||||
</span>
|
</span>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
|
{{- with .Params.Tags }}
|
||||||
{{ with .Params.Tags }}
|
|
||||||
<span class="blog-taxonomy-info"> | Tags:
|
<span class="blog-taxonomy-info"> | Tags:
|
||||||
{{ $sort := sort . }}
|
{{- $sort := sort . }}
|
||||||
{{ $links := apply $sort "partial" "post-tag-link" "." }}
|
{{- $links := apply $sort "partial" "post-tag-link" "." }}
|
||||||
{{ $clean := apply $links "chomp" "." }}
|
{{- $clean := apply $links "chomp" "." }}
|
||||||
{{ delimit $clean ", " | safeHTML }}
|
{{- delimit $clean ", " | safeHTML }}
|
||||||
</span>
|
</span>
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
|
@ -1,18 +1,19 @@
|
|||||||
|
|
||||||
<footer class='page-footer'>
|
<footer class='page-footer'>
|
||||||
{{ $socialMap := .Site.Data.notrack.social }}
|
{{- $socialMap := .Site.Data.notrack.social }}
|
||||||
{{ with $.Site.Params.social }}
|
{{- with $.Site.Params.social }}
|
||||||
<div class="social">
|
<div class="social">
|
||||||
<ul>
|
<ul>
|
||||||
{{- $socialArray := slice -}}
|
{{- $socialArray := slice -}}
|
||||||
{{ range $website, $user := $.Site.Params.social }}
|
{{- range $website, $user := $.Site.Params.social }}
|
||||||
{{- $social := $website | lower | index $socialMap | default dict -}}
|
{{- $social := $website | lower | index $socialMap | default dict -}}
|
||||||
{{- $social := dict "user" $user | merge $social -}}
|
{{- $social := dict "user" $user | merge $social -}}
|
||||||
|
|
||||||
{{- $data := index $socialMap $website -}}
|
{{- $data := index $socialMap $website -}}
|
||||||
|
|
||||||
{{- $socialArray = $socialArray | append $social -}}
|
{{- $socialArray = $socialArray | append $social -}}
|
||||||
{{ end }}
|
{{- end }}
|
||||||
{{ range sort $socialArray "weight" -}}
|
{{- range sort $socialArray "weight" -}}
|
||||||
{{- if .prefix -}}
|
{{- if .prefix -}}
|
||||||
<li><a href="{{- .prefix -}}{{ .user }}" rel="me"><i class="{{- .icon.class -}}"></i>{{ .title }}</a></li>
|
<li><a href="{{- .prefix -}}{{ .user }}" rel="me"><i class="{{- .icon.class -}}"></i>{{ .title }}</a></li>
|
||||||
{{- else if .template -}}
|
{{- else if .template -}}
|
||||||
@ -23,6 +24,6 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
{{ printf "<!-- Icons are from Awesome Font, licensed under SIL OFL 1.1 (https://scripts.sil.org/OFL) -->" | safeHTML }}
|
{{ printf " <!-- Icons are from Awesome Font, licensed under SIL OFL 1.1 (https://scripts.sil.org/OFL) -->" | safeHTML }}
|
||||||
</footer>
|
</footer>
|
||||||
|
@ -1,32 +1,30 @@
|
|||||||
<figure class="image-shortcode{{ with .Get "class" }} {{ . }}{{ end }}
|
<figure class="image-shortcode{{ with .Get "class" }} {{ . }}{{ end }}
|
||||||
{{- with .Get "wide" }}{{- if eq . "true" }} wide{{ end -}}{{ end -}}
|
{{- with .Get "wide" }}{{- if eq . "true" }} wide{{ end -}}{{ end -}}
|
||||||
{{- with .Get "frame" }}{{- if eq . "true" }} frame{{ end -}}{{ end -}}
|
{{- with .Get "frame" }}{{- if eq . "true" }} frame{{ end -}}{{ end -}}
|
||||||
{{- with .Get "float" }} {{ . }}{{ end -}}"
|
{{- with .Get "float" }} {{ . }}{{ end -}}" style="
|
||||||
style="
|
|
||||||
{{- with .Get "width" }}width: {{ . }};{{ end -}}
|
{{- with .Get "width" }}width: {{ . }};{{ end -}}
|
||||||
{{- with .Get "height" }}height: {{ . }};{{ end -}}">
|
{{- with .Get "height" }}height: {{ . }};{{ end -}}">
|
||||||
{{- if .Get "link" -}}
|
{{- if .Get "link" -}}
|
||||||
<a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>
|
<a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<img src="{{ .Get "src" | relURL }}"
|
<img src="{{ .Get "src" | relURL }}"
|
||||||
{{- if or (.Get "alt") (.Get "caption") }}
|
{{- if or (.Get "alt") (.Get "caption") }} alt="{{ with .Get "alt" }}{{ replace . "'" "'" }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
|
||||||
alt="{{ with .Get "alt" }}{{ replace . "'" "'" }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
/> <!-- Closing img tag -->
|
/> <!-- Closing img tag -->
|
||||||
{{- if .Get "link" }}</a>{{ end -}}
|
{{- if .Get "link" }}</a>{{ end -}}
|
||||||
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
|
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") }}
|
||||||
<figcaption>
|
<figcaption>
|
||||||
{{ with (.Get "title") -}}
|
{{ with (.Get "title") -}}
|
||||||
<h4>{{ . }}</h4>
|
<h4>{{ . }}</h4>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if or (.Get "caption") (.Get "attr") -}}<p>
|
{{- if or (.Get "caption") (.Get "attr") -}}<p>
|
||||||
{{- .Get "caption" | markdownify -}}
|
{{- .Get "caption" | markdownify -}}
|
||||||
{{- with .Get "attrlink" }}
|
{{- with .Get "attrlink" }}
|
||||||
<a href="{{ . }}">
|
<a href="{{ . }}">
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- .Get "attr" | markdownify -}}
|
{{- .Get "attr" | markdownify -}}
|
||||||
{{- if .Get "attrlink" }}</a>{{ end }}</p>
|
{{- if .Get "attrlink" }}</a>{{ end }}</p>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</figcaption>
|
</figcaption>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</figure>
|
</figure>
|
||||||
|
Reference in New Issue
Block a user