diff --git a/assets/_markdown.scss b/assets/_markdown.scss index 3de296d..8dd9454 100644 --- a/assets/_markdown.scss +++ b/assets/_markdown.scss @@ -24,6 +24,7 @@ font-size: 0.75em; vertical-align: middle; text-decoration: none; + margin-inline-start: .25em; } &:hover a.anchor, diff --git a/exampleSite/content.en/docs/shortcodes/steps.md b/exampleSite/content.en/docs/shortcodes/steps.md index d4725ff..72e87de 100644 --- a/exampleSite/content.en/docs/shortcodes/steps.md +++ b/exampleSite/content.en/docs/shortcodes/steps.md @@ -32,5 +32,4 @@ Steps shortcode styles numbered list as series of points for better content orga 4. ## Curabitur sed lacinia velit. Curabitur sed lacinia velit. Nullam sed ante non quam lobortis hendrerit. Phasellus elementum, erat sit amet imperdiet pulvinar, odio massa lobortis ipsum, in tincidunt metus dolor vel ligula. - {{% /steps %}} \ No newline at end of file diff --git a/layouts/_markup/render-heading.html b/layouts/_markup/render-heading.html index 762a0f6..f94c54c 100644 --- a/layouts/_markup/render-heading.html +++ b/layouts/_markup/render-heading.html @@ -1,6 +1,6 @@ {{- .Text -}} - {{- if default true .Attributes.anchor }} + {{- if default true .Attributes.anchor -}} # {{- end -}} diff --git a/layouts/_partials/docs/links/portable-link.html b/layouts/_partials/docs/links/portable-link.html index 5a52ef3..6a68e1d 100644 --- a/layouts/_partials/docs/links/portable-link.html +++ b/layouts/_partials/docs/links/portable-link.html @@ -16,7 +16,7 @@ {{- else with (resources.Get $path) -}} {{- $destination = .RelPermalink -}} {{- else -}} - {{- warnf "Reference '%s' not found in '%s'" .Destination .Page.Permalink -}} + {{- warnf "Reference '%s' not found in '%s'" .Destination .Page.RelPermalink -}} {{- end -}} {{- with $url.RawQuery -}} diff --git a/layouts/_partials/docs/menu-hugo.html b/layouts/_partials/docs/menu-hugo.html index d1fa9de..233c187 100644 --- a/layouts/_partials/docs/menu-hugo.html +++ b/layouts/_partials/docs/menu-hugo.html @@ -19,16 +19,16 @@
  • {{- $isRemote := (urls.Parse .URL).IsAbs -}} + {{- with $class }} class="{{ delimit . " " }}"{{- end -}} + {{- with .Title }} title="{{ . }}"{{- end -}} + {{- if $isRemote }} target="_blank" rel="noopener"{{- end -}}> {{- .Pre -}} - {{ template "book-menu-title" . }} + {{- template "book-menu-title" . -}} {{- .Post -}} - {{- with .Children }} - {{ template "book-menu-hugo" (dict "Page" $.Page "Menu" .) }} - {{- end }} + {{- with .Children -}} + {{- template "book-menu-hugo" (dict "Page" $.Page "Menu" .) -}} + {{- end -}}
  • {{- end -}} diff --git a/layouts/_shortcodes/asciinema.html b/layouts/_shortcodes/asciinema.html index e68f4e7..236c533 100644 --- a/layouts/_shortcodes/asciinema.html +++ b/layouts/_shortcodes/asciinema.html @@ -1,15 +1,17 @@ {{- if not (.Page.Store.Get "asciinema") -}} - - - - -{{- .Page.Store.Set "asciinema" true -}} + + {{- /* remove whitespaces */ -}} + + {{- /* remove whitespaces */ -}} + + {{- /* remove whitespaces */ -}} + + {{- .Page.Store.Set "asciinema" true -}} {{- end -}} {{- with (partial "docs/links/portable-image" (dict "Page" .Page "Destination" (index .Params "cast"))) -}} - -{{- $opts := newScratch -}} -{{- $opts.Set "asciinema" $.Params -}} -{{- $opts.DeleteInMap "asciinema" "cast" -}} -
    + {{- $opts := newScratch -}} + {{- $opts.Set "asciinema" $.Params -}} + {{- $opts.DeleteInMap "asciinema" "cast" -}} +
    {{- end -}} diff --git a/layouts/_shortcodes/badge.html b/layouts/_shortcodes/badge.html index 0bbfcb1..4079b24 100644 --- a/layouts/_shortcodes/badge.html +++ b/layouts/_shortcodes/badge.html @@ -1,5 +1,6 @@ {{- $style := default "default" (.Get "style") -}} - {{- with .Get "title" }}{{ . | plainify }}{{ end -}} - {{- with .Get "value" }}{{ . | plainify }}{{ end -}} - \ No newline at end of file + {{- with .Get "title" -}}{{ . | plainify }}{{- end -}} + {{- with .Get "value" -}}{{ . | plainify }}{{- end -}} + +{{- /* remove whitespaces */ -}} diff --git a/layouts/_shortcodes/button.html b/layouts/_shortcodes/button.html index c9cf99a..d3c3a05 100644 --- a/layouts/_shortcodes/button.html +++ b/layouts/_shortcodes/button.html @@ -3,3 +3,4 @@ {{- .InnerDeindent -}} +{{- /* remove whitespaces */ -}} diff --git a/layouts/_shortcodes/card.html b/layouts/_shortcodes/card.html index a6e4052..5660c1e 100644 --- a/layouts/_shortcodes/card.html +++ b/layouts/_shortcodes/card.html @@ -1,9 +1,7 @@ -{{- /* remove whitespace */ -}} {{- with .Get "href" -}} -{{- $destination := partial "docs/links/portable-link" (dict "Page" $.Page "Destination" .) -}} - +
    {{- template "book-card-content" $ -}} - +
    {{- else -}}
    {{- template "book-card-content" $ -}} @@ -14,9 +12,8 @@ {{- with .Get "image" -}} {{- $destination := partial "docs/links/portable-image" (dict "Page" $.Page "Destination" .) -}} -{{- end }} + {{- end -}}
    - {{ with .Inner }}{{ . }}{{ end }} +{{ with .Inner }}{{ . }}{{ end -}}
    {{- end -}} -{{- /* remove whitespace */ -}} diff --git a/layouts/_shortcodes/columns.html b/layouts/_shortcodes/columns.html index 1d6abdd..dcffa6e 100644 --- a/layouts/_shortcodes/columns.html +++ b/layouts/_shortcodes/columns.html @@ -1,21 +1,21 @@ {{- $ratio := (split (.Get "ratio") ":") -}} {{- if strings.Contains .InnerDeindent "<--->" -}} -{{ warnf "Columns shortcode seprator '<--->' is deprecated, use markdown list instead." -}} +{{- warnf "Columns shortcode seprator '<--->' is deprecated, use markdown list instead." -}}
    -{{ range $index, $content := split .InnerDeindent "<--->" }} +{{- range $index, $content := split .InnerDeindent "<--->" -}} {{- $grow := default 1 (index $ratio $index) -}}
    - {{ $content | safeHTML }} + {{- $content | safeHTML -}}
    -{{ end }} +{{- end -}}
    -{{ else }} -{{- if .Get "ratio" }}{{ end -}} -
    -{{ .InnerDeindent | safeHTML }} +{{- end -}}{{- end -}} +
    +{{ .Inner | safeHTML -}}
    -{{ end -}} +{{- end -}} diff --git a/layouts/_shortcodes/details.html b/layouts/_shortcodes/details.html index f1518bd..89409ec 100644 --- a/layouts/_shortcodes/details.html +++ b/layouts/_shortcodes/details.html @@ -1,7 +1,9 @@ +{{- /* remove whitespaces */ -}}
    - {{- $summary := cond .IsNamedParams (.Get "title") (.Get 0) -}} - {{ $summary | .Page.RenderString }} -
    - {{ .InnerDeindent | safeHTML }} -
    -
    +{{- $summary := cond .IsNamedParams (.Get "title") (.Get 0) -}} +{{ $summary | .Page.RenderString }} +{{- /* remove whitespaces */ -}} +
    +{{ .Inner | safeHTML -}} +
    +{{- /* remove whitespaces */ -}} diff --git a/layouts/_shortcodes/hint.html b/layouts/_shortcodes/hint.html index a71f1fd..1e76688 100644 --- a/layouts/_shortcodes/hint.html +++ b/layouts/_shortcodes/hint.html @@ -1,3 +1,5 @@ +{{- /* remove whitespaces */ -}}
    - {{ .Inner | safeHTML }} +{{ .Inner | safeHTML -}}
    +{{- /* remove whitespaces */ -}} diff --git a/layouts/_shortcodes/image.html b/layouts/_shortcodes/image.html index e1b9c46..58f3d14 100644 --- a/layouts/_shortcodes/image.html +++ b/layouts/_shortcodes/image.html @@ -1,4 +1,3 @@ -{{- /* remove whitespaces */ -}} {{- $destination := partial "docs/links/portable-image" (dict "Page" .Page "Destination" (.Get "src")) -}}
    +{{- /* remove whitespaces */ -}} diff --git a/layouts/_shortcodes/tab.html b/layouts/_shortcodes/tab.html index b5a753d..5b4e4dc 100644 --- a/layouts/_shortcodes/tab.html +++ b/layouts/_shortcodes/tab.html @@ -1,9 +1,12 @@ {{- $group := printf "tabs-%v" (default .Parent.Ordinal (.Parent.Get 0)) -}} -{{- $tab := printf "%s-%d" $group .Ordinal }} +{{- $tab := printf "%s-%d" $group .Ordinal -}} +{{- /* remove whitespaces */ -}} +{{- /* remove whitespaces */ -}}
    - {{- .Inner -}} +{{ .Inner -}}
    +{{- /* remove whitespaces */ -}} diff --git a/layouts/_shortcodes/tabs.html b/layouts/_shortcodes/tabs.html index fecbbeb..f5507b7 100644 --- a/layouts/_shortcodes/tabs.html +++ b/layouts/_shortcodes/tabs.html @@ -1,3 +1,5 @@ +{{- /* remove whitespaces */ -}}
    -{{ .Inner }} +{{- .Inner -}}
    +{{- /* remove whitespaces */ -}}