Add render hooks for codeblocks, headings, and images
This commit is contained in:
parent
4bc1390b3c
commit
d73c779508
3 changed files with 22 additions and 0 deletions
4
layouts/_default/_markup/render-codeblock.html
Normal file
4
layouts/_default/_markup/render-codeblock.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
{{- $highlighted := transform.HighlightCodeBlock . -}}
|
||||
<pre class="codeblock">
|
||||
{{- $highlighted.Inner -}}
|
||||
</pre>
|
3
layouts/_default/_markup/render-heading.html
Normal file
3
layouts/_default/_markup/render-heading.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
<h{{ .Level }} id="{{ .Anchor }}" class="heading">
|
||||
{{ .Text | safeHTML }} <a class="heading__anchor" href="#{{ .Anchor }}">#</a>
|
||||
</h{{ .Level }}>
|
15
layouts/_default/_markup/render-image.html
Normal file
15
layouts/_default/_markup/render-image.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
{{- if .IsBlock }}
|
||||
<figure id="figure-{{ .Ordinal }}">
|
||||
<img src="{{ .Destination | safeURL }}"
|
||||
{{- with .Text }} alt="{{ . }}"{{ end -}}
|
||||
>
|
||||
{{- with .Title }}
|
||||
<figcaption>{{ . }}</figcaption>
|
||||
{{- end }}
|
||||
</figure>
|
||||
{{ else -}}
|
||||
<img src="{{ .Destination | safeURL }}"
|
||||
{{- with .Text }} alt="{{ . }}"{{ end -}}
|
||||
{{- with .Title }} title="{{ . }}"{{ end -}}
|
||||
>
|
||||
{{- end }}
|
Loading…
Add table
Add a link
Reference in a new issue