| 123456789101112131415161718192021 |
- {{ $src := .Get "src" | }}
- {{ $width := .Get "width" | default "100%" }}
- {{ $tryautoheight := .Get "tryautoheight" | default true }}
- {{ $style := .Get "style" | default "min-height:98vh; border:none;" }}
- {{ $sandbox := .Get "sandbox" | default false }}
- {{ $name := .Get "name" | default "iframe-name" }}
- {{ $id := .Get "id" | default "iframe-id" }}
- {{ $class := .Get "class" }}
- {{ $sub := .Get "sub" | default "Your browser can not display embedded frames. You can access the embedded page via the following link:" }}
- {{ with $src }}
- {{ if $tryautoheight }}
- <script type="text/javascript">
- function resizeIframe(iframe) {
- iframe.height = iframe.contentWindow.document.body.scrollHeight + "px";
- }
- </script>
- {{ end }}
- <iframe id="{{ $id }}"{{ with $class }} class="{{ $class }}"{{ end }} src="{{ $src }}" width="{{ $width }}" name="{{ $name }}"{{ with $style }} style="{{ $style | safeCSS }}"{{ end }}{{ if $tryautoheight }} onload="resizeIframe(this)"{{ end }} referrerpolicy="no-referrer"{{ if (eq $sandbox false)}}{{ else if (eq $sandbox true) }} sandbox{{ else }} sandbox="{{ $sandbox }}"{{ end }}>
- <p>{{ $sub }} <a href="{{ $src }}">{{ $src }}</a></p>
- </iframe>
- {{ end }}
|