added article main image caption; added option to show toc before the main article image
This commit is contained in:
parent
a5e5a57aec
commit
3ae446e96d
3 changed files with 20 additions and 7 deletions
|
|
@ -9,14 +9,21 @@
|
|||
{{- partial "date.html" .Date -}}
|
||||
</p>
|
||||
{{ end }}
|
||||
{{ if .Params.Image }}
|
||||
<img src="{{ .Params.Image }}" alt="" />
|
||||
{{ if and (.Params.toc | default false) (.Site.Params.tocBeforeImage | default false) }}
|
||||
{{- partial "toc.html" . -}}
|
||||
{{ end }}
|
||||
{{ if (.Params.toc | default false) }}
|
||||
<div class="articleToc">
|
||||
{{ .TableOfContents }}
|
||||
<hr />
|
||||
</div>
|
||||
{{ if .Params.Image }}
|
||||
<figure style="margin: 0">
|
||||
<img src="{{ .Params.Image }}" alt="" />
|
||||
{{ if .Params.ImageCaption }}
|
||||
<figcaption>
|
||||
<p>{{ .Params.ImageCaption | markdownify }}</p>
|
||||
</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
||||
{{ end }}
|
||||
{{ if and (.Params.toc | default false) (not (.Site.Params.tocBeforeImage | default false)) }}
|
||||
{{- partial "toc.html" . -}}
|
||||
{{ end }}
|
||||
<div>{{ .Content }}</div>
|
||||
</article>
|
||||
|
|
|
|||
4
layouts/partials/toc.html
Normal file
4
layouts/partials/toc.html
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<div class="articleToc">
|
||||
{{ .TableOfContents }}
|
||||
<hr />
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue