Improve component rendering styles
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
26
layouts/_default/_markup/render-blockquote.html
Normal file
26
layouts/_default/_markup/render-blockquote.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{{ $emoji := dict
|
||||
"caution" ":exclamation:"
|
||||
"warning" ":warning:"
|
||||
"important" ":information_source:"
|
||||
"tip" ":bulb:"
|
||||
}}
|
||||
{{- if eq .Type "alert" -}}
|
||||
<blockquote class="alert alert-{{ .AlertType }}">
|
||||
<p class="alert-heading">
|
||||
<span class="alert-emoji">
|
||||
{{- transform.Emojify (index $emoji .AlertType) -}}
|
||||
</span>
|
||||
{{ if .AlertTitle }}
|
||||
{{- .AlertTitle -}}
|
||||
{{ else }}
|
||||
{{- .AlertType | title -}}
|
||||
{{ end }}
|
||||
</p>
|
||||
{{- .Text -}}
|
||||
</blockquote>
|
||||
{{- else -}}
|
||||
<blockquote>
|
||||
{{- .Text -}}
|
||||
</blockquote>
|
||||
{{- end -}}
|
||||
{{- /* chomp trailing newline */ -}}
|
@@ -2,3 +2,4 @@
|
||||
{{ .Text | safeHTML }}
|
||||
<a href="#{{- .Anchor | safeURL -}}" class="heading-anchor">#</a>
|
||||
</h{{ .Level }}>
|
||||
{{- /* chomp trailing newline */ -}}
|
||||
|
@@ -4,3 +4,4 @@
|
||||
"alt" .Title
|
||||
)
|
||||
}}
|
||||
{{- /* chomp trailing newline */ -}}
|
||||
|
@@ -5,5 +5,6 @@
|
||||
target="_blank" rel="noopener"
|
||||
{{ end }}
|
||||
>
|
||||
{{ .Text | safeHTML }}
|
||||
{{- .Text -}}
|
||||
</a>
|
||||
{{- /* chomp trailing newline */ -}}
|
||||
|
41
layouts/_default/_markup/render-table.html
Normal file
41
layouts/_default/_markup/render-table.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<div class="table-wrapper">
|
||||
<table
|
||||
{{- range $k, $v := .Attributes }}
|
||||
{{- if $v }}
|
||||
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
>
|
||||
<thead>
|
||||
{{- range .THead }}
|
||||
<tr>
|
||||
{{- range . }}
|
||||
<th
|
||||
{{- with .Alignment }}
|
||||
{{- printf " style=%q" (printf "text-align: %s" .) | safeHTMLAttr }}
|
||||
{{- end -}}
|
||||
>
|
||||
{{- .Text -}}
|
||||
</th>
|
||||
{{- end }}
|
||||
</tr>
|
||||
{{- end }}
|
||||
</thead>
|
||||
<tbody>
|
||||
{{- range .TBody }}
|
||||
<tr>
|
||||
{{- range . }}
|
||||
<td
|
||||
{{- with .Alignment }}
|
||||
{{- printf " style=%q" (printf "text-align: %s" .) | safeHTMLAttr }}
|
||||
{{- end -}}
|
||||
>
|
||||
{{- .Text -}}
|
||||
</td>
|
||||
{{- end }}
|
||||
</tr>
|
||||
{{- end }}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{- /* chomp trailing newline */ -}}
|
@@ -1,5 +1,5 @@
|
||||
<section class="hero">
|
||||
<h1>{{ .Title }}</h1>
|
||||
<h1 class="title">{{ .Title }}</h1>
|
||||
<div class="meta">
|
||||
<span class="date">{{ .Date | time.Format ":date_medium" }}</span>
|
||||
·
|
||||
|
@@ -3,7 +3,7 @@
|
||||
{{ if not .Params.private }}
|
||||
<a href="{{- .RelPermalink -}}" class="post">
|
||||
<h1 class="title">{{ .Title }}</h1>
|
||||
<div class="summary">{{ .Summary }}</div>
|
||||
<div class="summary">{{ .Summary | plainify }}</div>
|
||||
<div class="meta">
|
||||
<span class="date">{{ .Date | time.Format ":date_medium" }}</span>
|
||||
·
|
||||
|
Reference in New Issue
Block a user