-
Notifications
You must be signed in to change notification settings - Fork 913
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
95 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,16 @@ | ||
<div class="td-card card"> | ||
{{ $lang := "" }} | ||
{{ with $.Get "lang" }} | ||
{{ $lang = $.Get "lang" }} | ||
{{ end }} | ||
{{ $highlight := "" }} | ||
{{ with $.Get "highlight" }} | ||
{{ $highlight = $.Get "highlight" }} | ||
{{ end }} | ||
{{- with $.Get "header" -}} | ||
{{ warnf `shortcode 'card-code' is deprecated: use shortcode 'card' with named parameter 'code=true' instead.` -}} | ||
{{ $lang := default "" ($.Get "lang") -}} | ||
{{ $highlight := default "" ($.Get "highlight") -}} | ||
|
||
<div class="td-card card border me-4"> | ||
{{ with $.Get "header" -}} | ||
<div class="card-header bg-white"> | ||
{{- $.Get "header" | markdownify -}} | ||
{{ . | markdownify -}} | ||
</div> | ||
{{end}} | ||
<div class="card-body code p-l0 m-0"> | ||
{{ with $.Inner }} | ||
{{- highlight $.Inner $lang $highlight -}} | ||
{{ end }} | ||
{{ end -}} | ||
<div class="card-body code p-0 m-0"> | ||
{{ with $.Inner -}} | ||
{{ highlight . $lang $highlight -}} | ||
{{ end -}} | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,47 @@ | ||
<div class="td-card card mb-4"> | ||
{{ with $.Get "header" }} | ||
<div class="card-header"> | ||
{{ if eq $.Page.File.Ext "md" }} | ||
{{ $.Get "header" | markdownify }} | ||
{{ else }} | ||
{{ $.Get "header" | htmlUnescape | safeHTML }} | ||
{{ end }} | ||
{{/* Check parameter type */ -}} | ||
{{ $code := false -}} | ||
{{ with .Get "code" -}} | ||
{{ $type := printf "%T" . -}} | ||
{{ if ne $type "bool" -}} | ||
{{ errorf `shortcode 'card': boolean value expected for parameter 'code', but got %s` $type -}} | ||
{{ else }} | ||
{{ $code = . -}} | ||
{{ end -}} | ||
{{ end -}} | ||
|
||
{{ $lang := default "" (.Get "lang") -}} | ||
{{ $highlight := default "" (.Get "highlight") -}} | ||
|
||
<div class="td-card card border me-4"> | ||
{{ with $.Get "header" -}} | ||
<div class="card-header{{- cond $code " bg-white" "" -}}"> | ||
{{ . | markdownify }} | ||
</div> | ||
{{ end }} | ||
<div class="card-body"> | ||
{{ with $.Get "title" }} | ||
{{ end -}} | ||
<div class="card-body{{- cond $code " code p-0 m-0" "" -}}"> | ||
{{ with $.Get "title" -}} | ||
<h5 class="card-title"> | ||
{{ if eq $.Page.File.Ext "md" }} | ||
{{ $.Get "title" | markdownify }} | ||
{{ else }} | ||
{{ $.Get "title" | htmlUnescape | safeHTML }} | ||
{{ end }} | ||
{{ . | markdownify -}} | ||
</h5> | ||
{{ end }} | ||
{{ with $.Get "subtitle" }} | ||
<h6 class="card-title mb-2 text-muted"> | ||
{{ if eq $.Page.File.Ext "md" }} | ||
{{ $.Get "subtitle" | markdownify }} | ||
{{ else }} | ||
{{ $.Get "subtitle" | htmlUnescape | safeHTML }} | ||
{{ end }} | ||
{{ end -}} | ||
{{ with $.Get "subtitle" -}} | ||
<h6 class="card-title ms-2 text-muted"> | ||
{{ . | markdownify -}} | ||
</h6> | ||
{{ end }} | ||
{{ with $.Inner }} | ||
{{ end -}} | ||
{{ with $.Inner -}} | ||
{{ if $code -}} | ||
{{ highlight . $lang $highlight -}} | ||
{{ else -}} | ||
<p class="card-text"> | ||
{{ if eq $.Page.File.Ext "md" }} | ||
{{ $.Inner | markdownify }} | ||
{{ else }} | ||
{{ $.Inner | htmlUnescape | safeHTML }} | ||
{{ end }} | ||
{{ . -}} | ||
</p> | ||
{{ end }} | ||
{{ end -}} | ||
{{ end -}} | ||
</div> | ||
{{ with $.Get "footer" }} | ||
{{ with $.Get "footer" -}} | ||
<div class="card-footer"> | ||
{{ if eq $.Page.File.Ext "md" }} | ||
{{ $.Get "footer" | markdownify }} | ||
{{ else }} | ||
{{ $.Get "footer" | htmlUnescape | safeHTML }} | ||
{{ end }} | ||
{{ . | markdownify -}} | ||
</div> | ||
{{ end }} | ||
{{ end -}} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<div class="td-card-deck card-deck mb-4"> | ||
<div class="td-card-group card-group p-0 mb-4"> | ||
{{- .Inner -}} | ||
</div> | ||
</div> |
Oops, something went wrong.