feat(geocaching): images and text
feat(shortcode): introduction of fig-img shortcode
This commit is contained in:
parent
16f6070b7c
commit
e07a1bb092
23 changed files with 197 additions and 37 deletions
|
|
@ -2,7 +2,6 @@
|
|||
<article class="article">
|
||||
<div class="page-container">
|
||||
<h1>{{ .Title }}</h1>
|
||||
hello
|
||||
|
||||
{{ range .Params.tags }}
|
||||
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
|
||||
|
|
|
|||
30
layouts/shortcodes/fig-img.html
Normal file
30
layouts/shortcodes/fig-img.html
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<figure class="fig-img {{ with .Get "class" }}{{ . }}{{ end }}">
|
||||
{{- if .Get "link" -}}
|
||||
<a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>
|
||||
{{- end -}}
|
||||
|
||||
{{ $options := .Get "options" }}
|
||||
{{ $img := (.Page.Resources.GetMatch (.Get "src")).Fit $options }}
|
||||
<img src="{{ $img.RelPermalink }}"
|
||||
{{- if or (.Get "alt") (.Get "caption") }}
|
||||
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
|
||||
{{- end -}}
|
||||
/><!-- Closing img tag -->
|
||||
{{- if .Get "link" }}</a>{{ end -}}
|
||||
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
|
||||
<figcaption>
|
||||
{{ with (.Get "title") -}}
|
||||
<h4>{{ . }}</h4>
|
||||
{{- end -}}
|
||||
{{- if or (.Get "caption") (.Get "attr") -}}<p>
|
||||
{{- .Get "caption" | markdownify -}}
|
||||
{{- with .Get "attrlink" }}
|
||||
<a href="{{ . }}">
|
||||
{{- end -}}
|
||||
{{- .Get "attr" | markdownify -}}
|
||||
{{- if .Get "attrlink" }}</a>{{ end }}</p>
|
||||
{{- end }}
|
||||
</figcaption>
|
||||
{{- end }}
|
||||
</figure>
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue