feat: add column size attribute (#455)

This commit is contained in:
Robert Kaussow 2022-07-11 20:46:01 +02:00 committed by GitHub
parent c39eee4368
commit 66d456f552
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 51 additions and 10 deletions

View file

@ -7,7 +7,7 @@
--code
{{- end }}"
href="{{ .Destination | safeURL }}"
{{ with .Title }}title="{{ . }}"{{ end }}
{{- with .Title }}{{ printf "title=\"%s\"" . | safeHTMLAttr }}{{- end }}
>
{{- .Text | safeHTML -}}
</a>

View file

@ -1,4 +1,11 @@
<div class="gdoc-columns flex flex-wrap flex-mobile-column">
{{- $size := default "regular" (.Get "size" | lower) }}
{{- if not (in (slice "regular" "large" "small") $size) }}
{{- $size = "regular" }}
{{- end }}
<div class="gdoc-columns gdoc-columns--{{ $size }} flex flex-gap flex-mobile-column">
{{ range split .Inner "<--->" }}
<div class="gdoc-columns__content gdoc-markdown--nested flex-even">
{{ . | $.Page.RenderString }}