#153, Remove extra spaces in generated tabs html
This commit is contained in:
parent
5d7f257e30
commit
08519158f4
2 changed files with 30 additions and 2 deletions
28
exampleSite/content/docs/example/tabs.md
Normal file
28
exampleSite/content/docs/example/tabs.md
Normal file
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
weight: 99
|
||||
title: This is a layout test doc
|
||||
---
|
||||
|
||||
# Doc Title
|
||||
|
||||
{{< columns >}}
|
||||
This is content for col 1
|
||||
<--->
|
||||
|
||||
This is content for col 2 - tabs inside a column:
|
||||
{{< tabs "noneworkingtabs" >}}
|
||||
{{< tab "Thing1" >}}This information on Thing1 does not appear.{{< /tab >}}
|
||||
{{< tab "Thing2" >}}This information on Thing2 does not appear.{{< /tab >}}
|
||||
{{< /tabs >}}
|
||||
|
||||
More content for col 2
|
||||
{{< /columns >}}
|
||||
|
||||
Back to one wide col. Here are some tabs outside columns which work fine:
|
||||
|
||||
{{< tabs "workingtabs" >}}
|
||||
{{< tab "Thing3" >}}This information on Thing3 is fine.{{< /tab >}}
|
||||
{{< tab "Thing4" >}}This information on Thing4 is fine.{{< /tab >}}
|
||||
{{< /tabs >}}
|
||||
|
||||
end of doc
|
|
@ -3,7 +3,7 @@
|
|||
{{ $group := printf "tabs-%s" $id }}
|
||||
|
||||
<div class="book-tabs">
|
||||
{{ range $index, $tab := .Scratch.Get $group }}
|
||||
{{- range $index, $tab := .Scratch.Get $group -}}
|
||||
<input type="radio" class="hidden" name="{{ $group }}" id="{{ printf "%s-%d" $group $index }}" {{ if not $index }}checked="checked"{{ end }} />
|
||||
<label for="{{ printf "%s-%d" $group $index }}">
|
||||
{{ $tab.Name }}
|
||||
|
@ -11,5 +11,5 @@
|
|||
<div class="book-tabs-content markdown-inner">
|
||||
{{ .Content | markdownify }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue