Remove newlines from group dict info

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
Danila Fedorin 2024-05-21 21:31:37 -07:00
parent b1334455ea
commit 48bdf9ef08
3 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,5 @@
{{ partial "geturl.html" (dict "scratch" .Scratch "path" (.Get 1) "siteSourceUrl" .Site.Params.siteSourceUrl "submoduleLinks" .Site.Data.submodules) }} {{ partial "geturl.html" (dict "scratch" .Scratch "path" (.Get 1) "siteSourceUrl" .Site.Params.siteSourceUrl "submoduleLinks" .Site.Data.submodules) }}
{{ $groupconfig := dict {{- $groupconfig := dict
"url" (.Scratch.Get "bestUrl") "url" (.Scratch.Get "bestUrl")
"basePath" (.Scratch.Get "bestPath") "basePath" (.Scratch.Get "bestPath")
"path" (.Get 1) "path" (.Get 1)
@ -7,5 +7,5 @@
"code" (readFile (printf "code/%s" (.Get 1))) "code" (readFile (printf "code/%s" (.Get 1)))
"language" (.Get 0) "language" (.Get 0)
"opts" "linenos=table" "opts" "linenos=table"
}} -}}
{{ partial "highlightgroup.html" $groupconfig }} {{ partial "highlightgroup.html" $groupconfig }}

View File

@ -23,7 +23,7 @@
{{ with (.Scratch.Get "hidden") }} {{ with (.Scratch.Get "hidden") }}
<details><summary>{{ . | markdownify }}</summary> <details><summary>{{ . | markdownify }}</summary>
{{ end }} {{ end }}
{{ $groupconfig := dict {{- $groupconfig := dict
"url" (.Scratch.Get "bestUrl") "url" (.Scratch.Get "bestUrl")
"basePath" (.Scratch.Get "bestPath") "basePath" (.Scratch.Get "bestPath")
"path" (.Get 1) "path" (.Get 1)
@ -33,7 +33,7 @@
"lastLine" (int (.Get 3)) "lastLine" (int (.Get 3))
"language" (.Get 0) "language" (.Get 0)
"opts" (printf "linenos=table,linenostart=%d%s" (.Get 2) (.Scratch.Get "opts")) "opts" (printf "linenos=table,linenostart=%d%s" (.Get 2) (.Scratch.Get "opts"))
}} -}}
{{ partial "highlightgroup.html" $groupconfig }} {{ partial "highlightgroup.html" $groupconfig }}
{{ with (.Scratch.Get "hidden") }} {{ with (.Scratch.Get "hidden") }}
</details> </details>

View File

@ -1,9 +1,9 @@
{{ partial "geturl.html" (dict "scratch" .Scratch "path" (.Get 0) "siteSourceUrl" .Site.Params.siteSourceUrl "submoduleLinks" .Site.Data.submodules) }} {{ partial "geturl.html" (dict "scratch" .Scratch "path" (.Get 0) "siteSourceUrl" .Site.Params.siteSourceUrl "submoduleLinks" .Site.Data.submodules) }}
{{ $groupconfig := dict {{- $groupconfig := dict
"url" (.Scratch.Get "bestUrl") "url" (.Scratch.Get "bestUrl")
"basePath" (.Scratch.Get "bestPath") "basePath" (.Scratch.Get "bestPath")
"path" (.Get 0) "path" (.Get 0)
"comment" ", entire file" "comment" ", entire file"
"content" (safeHTML (printf "<pre><code>%s</code></pre>" (htmlEscape (readFile (printf "code/%s" (.Get 0)))))) "content" (safeHTML (printf "<pre><code>%s</code></pre>" (htmlEscape (readFile (printf "code/%s" (.Get 0))))))
}} -}}
{{ partial "group.html" $groupconfig }} {{ partial "group.html" $groupconfig }}