diff options
| author | JP Appel <jeanpierre.appel01@gmail.com> | 2024-04-06 00:16:20 -0400 |
|---|---|---|
| committer | JP Appel <jeanpierre.appel01@gmail.com> | 2024-04-06 00:16:20 -0400 |
| commit | c4299ddc538de551e0a3fcbe998e43e8f78c744c (patch) | |
| tree | 3fd9b4d0a7a4e0bc879ef9e073526de0b51aef22 | |
| parent | 7283025f43ac273139c5fd6975bf7688590ee88f (diff) | |
created pdf embed shortcode and style
| -rw-r--r-- | layouts/shortcodes/embedded_pdf.html | 13 | ||||
| -rw-r--r-- | static/css/styles.css | 22 |
2 files changed, 35 insertions, 0 deletions
diff --git a/layouts/shortcodes/embedded_pdf.html b/layouts/shortcodes/embedded_pdf.html new file mode 100644 index 0000000..4b066ec --- /dev/null +++ b/layouts/shortcodes/embedded_pdf.html @@ -0,0 +1,13 @@ +<!-- <iframe class="pdf-embed" src="{{ .Get "src" }}" width="{{ .Get "width" }}" height="{{ .Get "height" }}"></iframe> --> +<div class="embed-container"> +<iframe class="pdf-embed embed" src="{{ .Get "src" }}" loading="lazy" +{{ with .Get "name" }} name="{{ . }}" {{ end }} +{{ with .Get "title" }} title="{{ . }}" {{ end }} +{{ with .Get "width" }} width="{{ . }}" {{ end }} +{{ with .Get "height" }} height="{{ . }}" {{ end }}> + <a href="{{ .Get "src" }}">{{ .Get "title" }}</a> +</iframe> +<div class="embed-fallback"> + <a href="{{ .Get "src" }}">{{ .Get "title" }} ↓</a> +</div> +</div> diff --git a/static/css/styles.css b/static/css/styles.css index a904220..54c98f2 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -304,3 +304,25 @@ nav > h1 { /* filter: brightness(0.5); */ fill: var(--link-color); } + +.pdf-embed { + display: flex; + width: 100%; + height: 50em; +} + +.embed-fallback { + display : none; +} + +@media (width < 700px) { + .embed { + display: none; + } + + .embed-fallback { + display: flex; + justify-content: center; + } + +} |
