20 lines
576 B
HTML
20 lines
576 B
HTML
|
<span class="figure__source">
|
||
|
{{ if and .title .url }}
|
||
|
{{ i18n "source" }}: <a href="{{ .url }}">{{ .title }}</a>.
|
||
|
{{ else if .title }}
|
||
|
{{ .title }}
|
||
|
{{ else }}
|
||
|
{{ $sourceTitle := "" }}
|
||
|
{{ $parsedURL := urls.Parse .url }}
|
||
|
{{ if strings.Contains $parsedURL.Hostname "instagram.com" }}
|
||
|
{{ $sourceTitle = i18n "instagram" }}
|
||
|
{{ end }}
|
||
|
|
||
|
{{ if gt (len $sourceTitle) 0 }}
|
||
|
{{ i18n "source" }}: <a href="{{ .url }}">{{ $sourceTitle }}</a>
|
||
|
{{ else }}
|
||
|
<a href="{{ .url }}">{{ i18n "source" }}</a>
|
||
|
{{ end }}
|
||
|
{{ end }}
|
||
|
</span>
|