diff options
author | tdro <tdro@noreply.example.com> | 2022-05-03 04:25:49 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-05-03 04:25:49 -0400 |
commit | e92dc018e28ba8d44f1c6cbc9fb0b779dec271e6 (patch) | |
tree | 3667043819ab91065019dfe3b4ff83ad625c2b49 /themes/default/layouts/shortcodes | |
download | canory-e92dc018e28ba8d44f1c6cbc9fb0b779dec271e6.tar.gz canory-e92dc018e28ba8d44f1c6cbc9fb0b779dec271e6.tar.bz2 canory-e92dc018e28ba8d44f1c6cbc9fb0b779dec271e6.zip |
config.yaml: Commission
Diffstat (limited to 'themes/default/layouts/shortcodes')
23 files changed, 315 insertions, 0 deletions
diff --git a/themes/default/layouts/shortcodes/abbr.html b/themes/default/layouts/shortcodes/abbr.html new file mode 100644 index 0000000..d661bd5 --- /dev/null +++ b/themes/default/layouts/shortcodes/abbr.html @@ -0,0 +1,4 @@ +{{- $abbr := default "TL;DR:" (.Get "abbr" | default (.Get 0)) -}} +{{- $title := default "Too long, didn't read" (.Get "title" | default (.Get 1)) -}} + +<abbr title="{{ $title }}">{{ $abbr | markdownify }}</abbr> diff --git a/themes/default/layouts/shortcodes/asciicast.html b/themes/default/layouts/shortcodes/asciicast.html new file mode 100644 index 0000000..10da091 --- /dev/null +++ b/themes/default/layouts/shortcodes/asciicast.html @@ -0,0 +1,17 @@ +{{- $id := default "" (.Get "id" | default (.Get 0)) -}} +{{- $title := default "" (.Get "title" | default (.Get 1)) -}} +{{- $theme := default "" (.Get "theme" | default (.Get 2)) -}} +{{- $speed := default "" (.Get "speed" | default (.Get 3)) -}} +{{- $preload := default "" (.Get "preload" | default (.Get 4)) -}} +{{- $autoplay := default "" (.Get "autoplay" | default (.Get 5)) -}} +{{- $startat := default "" (.Get "startat" | default (.Get 6)) -}} + +<ascii-cast> + <script + src="https://asciinema.org/a/14.js" + id="asciicast-14" + async + data-autoplay="false" + data-size="big" + ></script> +</ascii-cast> diff --git a/themes/default/layouts/shortcodes/audio.html b/themes/default/layouts/shortcodes/audio.html new file mode 100644 index 0000000..4df2f51 --- /dev/null +++ b/themes/default/layouts/shortcodes/audio.html @@ -0,0 +1,18 @@ +{{- $src := default + "https://ia600701.us.archive.org/12/items/firstchaptercollection001_1109_librivox/firstchapter001_02_taletwocities_dickens_law.mp3" + (.Get "src" | default (.Get 0)) +-}} +{{- $caption := default "A Tale of Two Cities by Charles Dickens" (.Get "caption" | default (.Get 1)) -}} +{{- $controls := default "" (.Get "controls" | default (.Get 2)) -}} + +<audio-player> + <figure> + <figcaption>{{ $caption }}</figcaption> + <audio controls {{ $controls | safeHTMLAttr }} src="{{ $src }}"> + <p> + Your browser doesn't support HTML5 <code>audio</code>. Here is a + <a href="{{ $src }}">link to the audio file</a> instead. + </p> + </audio> + </figure> +</audio-player> diff --git a/themes/default/layouts/shortcodes/gist.html b/themes/default/layouts/shortcodes/gist.html new file mode 100644 index 0000000..c475672 --- /dev/null +++ b/themes/default/layouts/shortcodes/gist.html @@ -0,0 +1,9 @@ +{{- $user := default "gdb" (.Get "user" | default (.Get 0)) -}} +{{- $gist := default "b6365e79be6052e7531e7ba6ea8caf23" (.Get "gist" | default (.Get 1)) -}} +{{- $file := default "" (.Get "file" | default (.Get 2)) -}} + +<github-gist> + <script + src="https://gist.github.com/{{ $user }}/{{ $gist }}.js?file={{ $file }}"> + </script> +</github-gist> diff --git a/themes/default/layouts/shortcodes/iframe.html b/themes/default/layouts/shortcodes/iframe.html new file mode 100644 index 0000000..cd72763 --- /dev/null +++ b/themes/default/layouts/shortcodes/iframe.html @@ -0,0 +1,13 @@ +{{- $url := default "https://example.org/" (.Get "url" | default (.Get 0)) -}} +{{- $title := default "Content Embed" (.Get "title" | default (.Get 1)) -}} +{{- $caption := default $title (.Get "caption" | default (.Get 2)) -}} +{{- $sandbox := default "" (.Get "sandbox" | default (.Get 3)) -}} + +<iframe-embed> + <iframe + sandbox="{{ $sandbox }}" + src="{{ $url }}" + title="{{ $title }}" + ></iframe> + <figcaption>{{ $caption | markdownify }}</figcaption> +</iframe-embed> diff --git a/themes/default/layouts/shortcodes/imgur-video.html b/themes/default/layouts/shortcodes/imgur-video.html new file mode 100644 index 0000000..e6fabdd --- /dev/null +++ b/themes/default/layouts/shortcodes/imgur-video.html @@ -0,0 +1,20 @@ +{{- $id := default "uVrh84e" (.Get "id" | default (.Get 0)) -}} +{{- $title := default "Imgur Gif" (.Get "title" | default (.Get 1)) -}} + +<imgur-video> + <blockquote + class="imgur-embed-pub" + lang="en" + data-id="{{ $id }}" + data-context="false"> + <a href="//imgur.com/{{ $id }}"></a> + </blockquote> + <script async src="//s.imgur.com/min/embed.js" charset="utf-8"></script> + <noscript> + <a href="//imgur.com/{{ $id }}">imgur.com/{{ $id }}</a> + </noscript> + <figcaption> + {{ $title | markdownify }}: + {{ print "[Link](https://imgur.com/" $id ")" | markdownify }} + </figcaption> +</imgur-video> diff --git a/themes/default/layouts/shortcodes/imgur.html b/themes/default/layouts/shortcodes/imgur.html new file mode 100644 index 0000000..f51bcef --- /dev/null +++ b/themes/default/layouts/shortcodes/imgur.html @@ -0,0 +1,13 @@ +{{- $id := default "mkVcxUi" (.Get "id" | default (.Get 0)) -}} + +<imgur-image> + <blockquote + class="imgur-embed-pub" + lang="en" + data-id="a/{{ $id }}" + data-context="false" + > + <a href="//imgur.com/a/{{ $id }}"></a> + </blockquote> + <script async src="//s.imgur.com/min/embed.js" charset="utf-8"></script> +</imgur-image> diff --git a/themes/default/layouts/shortcodes/ins.html b/themes/default/layouts/shortcodes/ins.html new file mode 100644 index 0000000..3c68f1f --- /dev/null +++ b/themes/default/layouts/shortcodes/ins.html @@ -0,0 +1,3 @@ +{{- $text := default "inserted text" (.Get "text" | default (.Get 0)) -}} + +<ins title="{{ $text }}">{{ $text | markdownify }}</ins> diff --git a/themes/default/layouts/shortcodes/kbd.html b/themes/default/layouts/shortcodes/kbd.html new file mode 100644 index 0000000..b24fd9d --- /dev/null +++ b/themes/default/layouts/shortcodes/kbd.html @@ -0,0 +1,3 @@ +{{- $key := default "Ctrl" (.Get "key" | default (.Get 0)) -}} + +<kbd title="{{ $key }}">{{ $key | markdownify }}</kbd> diff --git a/themes/default/layouts/shortcodes/mark.html b/themes/default/layouts/shortcodes/mark.html new file mode 100644 index 0000000..02af225 --- /dev/null +++ b/themes/default/layouts/shortcodes/mark.html @@ -0,0 +1,5 @@ +{{- $text := default "highligted text" (.Get "text" | default (.Get 0)) -}} +{{- $title := default $text (.Get "title" | default (.Get 1)) -}} + +<mark title="{{ $title }}">{{ $text }}</mark> +{{- /* This comment removes trailing newlines and white spaces. */ -}} diff --git a/themes/default/layouts/shortcodes/odysee.html b/themes/default/layouts/shortcodes/odysee.html new file mode 100644 index 0000000..91f03c0 --- /dev/null +++ b/themes/default/layouts/shortcodes/odysee.html @@ -0,0 +1,14 @@ +{{- $url := default "https://odysee.com/$/embed/odysee/7a416c44a6888d94fe045241bbac055c726332aa" (.Get "url" | default (.Get 0)) -}} +{{- $title := default "Odysee Video" (.Get "title" | default (.Get 1)) -}} +{{- $caption := default (print $title ": [Link](" $url ")") (.Get "caption" | default (.Get 2)) -}} + +<odysee-video> + <iframe + sandbox="allow-scripts allow-same-origin allow-presentation" + id="odysee-iframe" + src="{{ $url }}" + title="{{ $title }}" + allowfullscreen> + </iframe> + <figcaption>{{ $caption | markdownify }}</figcaption> +</odysee-video> diff --git a/themes/default/layouts/shortcodes/pdf.html b/themes/default/layouts/shortcodes/pdf.html new file mode 100644 index 0000000..f766190 --- /dev/null +++ b/themes/default/layouts/shortcodes/pdf.html @@ -0,0 +1,11 @@ +{{- $url := default "https://www.gutenberg.org/files/98/old/2city12p.pdf" (.Get "url" | default (.Get 0)) -}} +{{- $title := default "PDF Document" (.Get "title" | default (.Get 1)) -}} +{{- $caption := default (print $title ": [Download](" $url ")") (.Get "caption" | default (.Get 2)) -}} + +<pdf-container title="{{ $title }}"> + <iframe loading="lazy" + sandbox="allow-scripts allow-presentation allow-same-origin" + src="https://docs.google.com/gview?url={{ $url }}&embedded=true"> + </iframe> + <figcaption>{{ $caption | markdownify }}</figcaption> +</pdf-container> diff --git a/themes/default/layouts/shortcodes/quote.html b/themes/default/layouts/shortcodes/quote.html new file mode 100644 index 0000000..b933286 --- /dev/null +++ b/themes/default/layouts/shortcodes/quote.html @@ -0,0 +1,13 @@ +{{- $text := default "Speech is silver, silence is golden" (.Get "text" | default (.Get 0)) -}} +{{- $cite := default "" (.Get "cite" | default (.Get 1)) -}} + +<q cite="$cite" title="{{ $text | markdownify }}"> + {{- if $cite -}} + <a rel="noopener" href="{{ $cite }}" target="_blank"> + {{- end -}} + {{ $text | markdownify }} + {{- if $cite -}} + </a> + {{- end -}} +</q> +{{- /* This comment removes trailing newlines and white spaces. */ -}} diff --git a/themes/default/layouts/shortcodes/reddit.html b/themes/default/layouts/shortcodes/reddit.html new file mode 100644 index 0000000..10ef0b9 --- /dev/null +++ b/themes/default/layouts/shortcodes/reddit.html @@ -0,0 +1,29 @@ +{{- $path := default "linux/comments/aeufh6/vlc_has_now_reached_3_billions_downloads_and/edsvibz" (.Get "path" | default (.Get 0)) -}} +{{- $depth := default "2" (.Get "depth" | default (.Get 1)) -}} +{{- $context := default "1" (.Get "context" | default (.Get 2)) -}} +{{- $theme := default "light" (.Get "theme" | default (.Get 3)) -}} +{{- $showtitle := default "true" (.Get "showtitle" | default (.Get 4)) -}} +{{- $showedits := default "false" (.Get "showedits" | default (.Get 5)) -}} +{{- $showmedia := default "false" (.Get "showmedia" | default (.Get 6)) -}} +{{- $showmore := default "false" (.Get "showmore" | default (.Get 7)) -}} + +<reddit-comment> + <iframe loading="lazy" + id="reddit-embed" + src="https://www.redditmedia.com/r/{{ trim $path "/" }}/ +?depth={{ $depth }} +&embed=true +&showmore={{ $showmore }} +&showtitle={{ $showtitle }} +&context={{ $context }} +&showmedia={{ $showmedia }} +&theme={{ $theme }} +&showedits={{ $showedits }} +&created={{ now.Format "2006-01-02T15:04:05Z" }}" + sandbox="allow-scripts allow-same-origin allow-popups" + style="border: none;" + height="452" + width="640" + scrolling="no" + ></iframe> +</reddit-comment> diff --git a/themes/default/layouts/shortcodes/self.html b/themes/default/layouts/shortcodes/self.html new file mode 100644 index 0000000..3b620b7 --- /dev/null +++ b/themes/default/layouts/shortcodes/self.html @@ -0,0 +1,13 @@ +{{- $url := default "https://example.org/" (.Get "url" | default (.Get 0)) -}} +{{- $title := default "Self Embed" (.Get "title" | default (.Get 1)) -}} +{{- $caption := default (print $title ": [Link](" $url ")") (.Get "caption" | default (.Get 2)) -}} +{{- $sandbox := default "" (.Get "sandbox" | default (.Get 3)) -}} + +<self-embed> + <iframe + sandbox="{{ $sandbox }}" + src="{{ $url }}" + title="{{ $title }}" + ></iframe> + <figcaption>{{ $caption | markdownify }}</figcaption> +</self-embed> diff --git a/themes/default/layouts/shortcodes/smallcaps.html b/themes/default/layouts/shortcodes/smallcaps.html new file mode 100644 index 0000000..8c18621 --- /dev/null +++ b/themes/default/layouts/shortcodes/smallcaps.html @@ -0,0 +1,6 @@ +{{- $text := default "Small Caps" (.Get "text" | default (.Get 0)) -}} + +<samp title="{{ $text }}"> + {{- $text | markdownify -}} +</samp> +{{- /* This comment removes trailing newlines and white spaces. */ -}} diff --git a/themes/default/layouts/shortcodes/spoiler.html b/themes/default/layouts/shortcodes/spoiler.html new file mode 100644 index 0000000..9267876 --- /dev/null +++ b/themes/default/layouts/shortcodes/spoiler.html @@ -0,0 +1,9 @@ +{{- $text := default "This is a spoiler." (.Get "text" | default (.Get 0)) -}} +{{- $title := default "Click to show/hide text." (.Get "title" | default (.Get 1)) -}} + +{{ if gt (len .Inner) 1 }} + {{ $text = .Inner }} +{{ end }} + +<input hidden type="checkbox" id="spoiler-text-{{ md5 $text }}" /> +<s title="{{ $title }}"><label for="spoiler-text-{{ md5 $text }}">{{ $text | markdownify }}</label></s> diff --git a/themes/default/layouts/shortcodes/spoiler.rss.xml b/themes/default/layouts/shortcodes/spoiler.rss.xml new file mode 100644 index 0000000..ad80424 --- /dev/null +++ b/themes/default/layouts/shortcodes/spoiler.rss.xml @@ -0,0 +1,4 @@ +{{- $text := default "This is a spoiler." (.Get "text" | default (.Get 0)) -}} +{{- $title := default "Click to show/hide text." (.Get "title" | default (.Get 1)) -}} + +<s title="{{ $title }}">{{ $text | markdownify }}</s> diff --git a/themes/default/layouts/shortcodes/tweet.html b/themes/default/layouts/shortcodes/tweet.html new file mode 100644 index 0000000..b4adfba --- /dev/null +++ b/themes/default/layouts/shortcodes/tweet.html @@ -0,0 +1,18 @@ +{{- $user := default "jack" (.Get "user" | default (.Get 0)) -}} +{{- $status := default "20" (.Get "status" | default (.Get 1)) -}} +{{- $caption := default "Twitter Tweet" (.Get "caption" | default (.Get 2)) -}} + +<twitter-tweet> + <blockquote class="twitter-tweet"> + <a href="https://twitter.com/{{ $user }}/status/{{ $status }}"> + https://twitter.com/{{ $user }}/status/{{ $status }} + </a> + </blockquote> + <script + async + src="https://platform.twitter.com/widgets.js" + charset="utf-8"> + </script> +</twitter-tweet> + +<figcaption>{{ $caption }}</figcaption> diff --git a/themes/default/layouts/shortcodes/video.html b/themes/default/layouts/shortcodes/video.html new file mode 100644 index 0000000..7c0c95f --- /dev/null +++ b/themes/default/layouts/shortcodes/video.html @@ -0,0 +1,36 @@ +{{- + $source := default + "https://raw.githubusercontent.com/benhosmer/HTML5-Test-Videos/9a6c2db46472454c634963cbeb0900fd37901fac/big_buck_bunny" + (.Get "source" | default (.Get 0)) +-}} +{{- $poster := default "" (.Get "poster" | default (.Get 1)) -}} +{{- $width := default "" (.Get "width" | default (.Get 2)) -}} +{{- $height := default "" (.Get "height" | default (.Get 3)) -}} +{{- $preload := default "metadata" (.Get "preload" | default (.Get 4)) -}} +{{- $controls := default "" (.Get "controls" | default (.Get 5)) -}} +{{- $caption := default "`HTML5` Video" (.Get "caption" | default (.Get 6)) -}} +{{- $title := default "HTML5 Video" (.Get "title" | default (.Get 7)) -}} +{{- $start := default "" (.Get "start" | default (.Get 8)) -}} +{{- $end := default "" (.Get "end" | default (.Get 9)) -}} + +<video-container> + <video + title="{{ $title }}" + preload="{{ $preload }}" + poster="{{ $poster }}" + width="{{ $width }}" + height="{{ $height }}" + controls {{ $controls | safeHTMLAttr }}> + <source src="{{ $source }}.mp4#t={{ $start }},{{ $end }}" type="video/mp4"> + <source src="{{ $source }}.webm#t={{ $start }},{{ $end }}" type="video/webm"> + <source src="{{ $source }}.flv#t={{ $start }},{{ $end }}" type="video/flv"> + <source src="{{ $source }}.ogv#t={{ $start }},{{ $end }}" type="video/ogv"> + <p> + Sorry, your browser doesn't support embedded videos. Here is a + <a href="{{ $source }}.mp4#t={{ $start }},{{ $end }}"> + link to the video + </a> instead. + </p> + </video> + <figcaption>{{ $caption | markdownify }}</figcaption> +</video-container> diff --git a/themes/default/layouts/shortcodes/vimeo.html b/themes/default/layouts/shortcodes/vimeo.html new file mode 100644 index 0000000..009ebb0 --- /dev/null +++ b/themes/default/layouts/shortcodes/vimeo.html @@ -0,0 +1,12 @@ +{{- $id := default "1084537" (.Get "id" | default (.Get 0)) -}} +{{- $title := default "Vimeo Video" (.Get "title" | default (.Get 1)) -}} + +<vimeo-video> + <div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"> + <iframe loading="lazy" + src="https://player.vimeo.com/video/{{ $id }}?dnt=1" + style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" + title="{{ $title }}" webkitallowfullscreen mozallowfullscreen allowfullscreen> + </iframe> + </div> +</vimeo-video> diff --git a/themes/default/layouts/shortcodes/wikipedia.html b/themes/default/layouts/shortcodes/wikipedia.html new file mode 100644 index 0000000..7b9e51f --- /dev/null +++ b/themes/default/layouts/shortcodes/wikipedia.html @@ -0,0 +1,16 @@ +{{- $id := default "Knowledge" (.Get "id" | default (.Get 0)) -}} +{{- $title := default "Wikipedia Article" (.Get "title" | default (.Get 1)) -}} +{{- + $caption := default + (print $title ": [Link](" "https://en.m.wikipedia.org/wiki/" $id ")") + (.Get "caption" | default (.Get 2)) +-}} + +<wikipedia-container title="{{ $title }}"> + <iframe loading="lazy" + src="https://en.m.wikipedia.org/wiki/{{ $id }}" + title="{{ $title }}" + height="300" + ></iframe> + <figcaption>{{ $caption | markdownify }}</figcaption> +</wikipedia-container> diff --git a/themes/default/layouts/shortcodes/youtube.html b/themes/default/layouts/shortcodes/youtube.html new file mode 100644 index 0000000..791e3da --- /dev/null +++ b/themes/default/layouts/shortcodes/youtube.html @@ -0,0 +1,29 @@ +{{- $url := "www.youtube-nocookie.com" -}} +{{- $id := default "aqz-KE-bpKQ" (.Get "id" | default (.Get 0)) -}} +{{- $title := default "YouTube Video" (.Get "title" | default (.Get 1)) -}} +{{- $start := default "" (.Get "start" | default (.Get 2)) -}} +{{- $end := default "" (.Get "end" | default (.Get 3)) -}} +{{- $muted := default "" (.Get "muted" | default (.Get 4)) -}} + +{{- if (and $start $end) -}} + {{ $start = print "&start=" $start }} + {{ $end = print "&end=" $end }} +{{- end -}} + +{{- if $muted -}} + {{ $muted = "&mute=1" }} +{{- end -}} + +<youtube-video> + <div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"> + <iframe loading="lazy" sandbox="allow-scripts allow-same-origin" + src="https://{{ $url }}/embed/{{ $id }}{{ "?controls=1" }}{{ $start }}{{ $end }}{{ $muted }}" + style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" + allowfullscreen title="{{ $title }}"> + </iframe> + </div> + <figcaption> + {{ $title | markdownify }}: + {{ print "[Link](https://www.youtube.com/watch?v=" $id ")" | markdownify }} + </figcaption> +</youtube-video> |