mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-21 20:50:40 +00:00
fix: ensure render template contains no empty newlines (#35)
This commit is contained in:
parent
609aa3574f
commit
14502ab963
@ -1,6 +1,6 @@
|
||||
{{ $showAnchor := (and (default true .Page.Params.GeekblogAnchor) (default true .Page.Site.Params.GeekblogAnchor)) }}
|
||||
{{- $showAnchor := (and (default true .Page.Params.GeekblogAnchor) (default true .Page.Site.Params.GeekblogAnchor)) -}}
|
||||
|
||||
{{ if $showAnchor }}
|
||||
{{- if $showAnchor -}}
|
||||
<div class="gblog-post__anchorwrap">
|
||||
<h{{ .Level }} id="{{ .Anchor | safeURL }}">
|
||||
{{ .Text | safeHTML }}
|
||||
@ -9,10 +9,10 @@
|
||||
</a>
|
||||
</h{{ .Level }}>
|
||||
</div>
|
||||
{{ else }}
|
||||
{{- else -}}
|
||||
<div class="gblog-post__anchorwrap">
|
||||
<h{{ .Level }} id="{{ .Anchor | safeURL }}">
|
||||
{{ .Text | safeHTML }}
|
||||
</h{{ .Level }}>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
@ -1 +1,2 @@
|
||||
<img src="{{ .Destination | safeURL | relURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} />
|
||||
{{- /* Drop trailing newlines */ -}}
|
||||
|
@ -1,2 +1,3 @@
|
||||
{{- $raw := or (hasPrefix .Text "<img") (hasPrefix .Text "<figure") -}}
|
||||
<a class="gblog-post__link{{ if $raw }}--raw{{ end }}" href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}>{{ .Text | safeHTML }}</a>
|
||||
{{- /* Drop trailing newlines */ -}}
|
||||
|
Loading…
Reference in New Issue
Block a user