{{ define "main" }}

{{ .Title }}

{{ .Description }}

{{- with .GetTerms "author" }} {{- range . -}}
di {{ .LinkTitle }}
{{- end }} {{- end }} {{ if .Site.Params.show_post_dates | default true }} {{- with .Date }}{{ end }} {{ end }} {{- with .Params.location_link -}}
{{ T "location" }}: {{ . | markdownify }}
{{ end }} {{- with .Params.license -}}
{{ T "license" }}: {{ . | markdownify }}
{{ end }} {{ partial "tags.html" . }}
{{- $image_src := "" }} {{- $image_alt := "" }} {{- $image_caption := "" }} {{/* priorità maggiore: image_post */}} {{- if .Params.image_post }} {{- $image_src = .Params.image_post.src }} {{- with .Params.image_post.alt }} {{- $image_alt = . }} {{- end }} {{- with .Params.image_post.caption }} {{- $image_caption = . }} {{- end }} {{- end }} {{/* in alternativa uso il metodo vecchio */}} {{- if and (not $image_src) .Params.image }} {{- $image_src = .Params.image }} {{- with .Params.image_alt }} {{- $image_alt = . }} {{- end }} {{- with .Params.image_caption }} {{- $image_caption = . }} {{- end }} {{- end }} {{- if $image_src }} {{- $image := .Page.Resources.GetMatch $image_src }} {{- $maxHeight := 600 -}} {{- $ratio := 2.33 -}}
{{- if gt $image.Height $maxHeight -}} {{- $image = $image.Resize (printf "x%d webp q50" $maxHeight) -}} {{- end -}} {{ $image_alt }} {{- with $image_caption -}}
{{- . | markdownify -}}
{{- end -}}
{{ end }} {{- .Content }} {{ if (findRE " function addCopyButtons(clipboard) { document.querySelectorAll('pre > code').forEach(function (codeBlock) { var button = document.createElement('button'); button.className = 'copy-code-button'; button.type = 'button'; button.innerText = 'Copy'; button.addEventListener('click', function () { clipboard.writeText(codeBlock.innerText).then(function () { /* Chrome doesn't seem to blur automatically, leaving the button in a focused state. */ button.blur(); button.innerText = 'Copied!'; setTimeout(function () { button.innerText = 'Copy'; }, 2000); }, function (error) { button.innerText = 'Error'; }); }); var pre = codeBlock.parentNode; if (pre.parentNode.classList.contains('highlight')) { var highlight = pre.parentNode; highlight.parentNode.insertBefore(button, highlight); } else { pre.parentNode.insertBefore(button, pre); } }); } if (navigator && navigator.clipboard) { addCopyButtons(navigator.clipboard); } {{ end }} {{ end }}