aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2024-08-24 00:00:00 +0000
committertdro <tdro@noreply.example.com>2024-08-24 00:00:00 +0000
commit24f02f051682081c8386e79c6b62d639c9136d1c (patch)
tree9819af115c6bd85d4b0f5e17952b8f813aa430cb
parenta2aa2b5f24385c4b3f3e3380e610ee9528f9521c (diff)
downloadcanory-24f02f051682081c8386e79c6b62d639c9136d1c.tar.gz
canory-24f02f051682081c8386e79c6b62d639c9136d1c.tar.bz2
canory-24f02f051682081c8386e79c6b62d639c9136d1c.zip
themes/default/layouts/shortcodes/attach: Guess PDF
-rw-r--r--themes/default/layouts/shortcodes/attach.html6
1 files changed, 5 insertions, 1 deletions
diff --git a/themes/default/layouts/shortcodes/attach.html b/themes/default/layouts/shortcodes/attach.html
index 55b5744..7f4c672 100644
--- a/themes/default/layouts/shortcodes/attach.html
+++ b/themes/default/layouts/shortcodes/attach.html
@@ -31,7 +31,7 @@
{{- end -}}
{{- else -}}
{{- with $cache = resources.Get (path.Join "public/" $storage) -}}
- {{- $type = .MediaType -}}
+ {{- $type = $cache.MediaType -}}
{{- $cache = print ("" | absURL) (strings.TrimLeft "public" $cache) -}}
{{- end -}}
{{- end -}}
@@ -42,6 +42,10 @@
{{- $data = $url -}}
{{- end -}}
+{{- if (in $data "pdf") -}}
+ {{- $type = "application/pdf" -}}
+{{- end -}}
+
<document-attachment title="{{ $title }}">
<object type="{{ $type }}" data="{{ $data }}">
<p>