The big shortcode cleanup
This commit is contained in:
@ -5,30 +5,27 @@
|
||||
{%- set language_strings = load_data(path="themes/duckquill/i18n/" ~ lang ~ ".toml", required=false) -%}
|
||||
{%- endif -%}
|
||||
|
||||
<blockquote class="
|
||||
{% if note %}note{% endif %}
|
||||
{% if tip %}tip{% endif %}
|
||||
{% if important %}important{% endif %}
|
||||
{% if warning %}warning{% endif %}
|
||||
{% if caution %}caution{% endif %}
|
||||
">
|
||||
{%- if note -%}
|
||||
{%- set alert_type = "note" -%}
|
||||
{%- set alert_string = macros_translate::translate(key="note", default="Note", language_strings=language_strings) -%}
|
||||
{%- elif tip -%}
|
||||
{%- set alert_type = "tip" -%}
|
||||
{%- set alert_string = macros_translate::translate(key="tip", default="Tip", language_strings=language_strings) -%}
|
||||
{%- elif important -%}
|
||||
{%- set alert_type = "important" -%}
|
||||
{%- set alert_string = macros_translate::translate(key="important", default="Important", language_strings=language_strings) -%}
|
||||
{%- elif warning -%}
|
||||
{%- set alert_type = "warning" -%}
|
||||
{%- set alert_string = macros_translate::translate(key="warning", default="Warning", language_strings=language_strings) -%}
|
||||
{%- elif caution -%}
|
||||
{%- set alert_type = "caution" -%}
|
||||
{%- set alert_string = macros_translate::translate(key="caution", default="Caution", language_strings=language_strings) -%}
|
||||
{%- endif -%}
|
||||
|
||||
<blockquote class="{{ alert_type }}">
|
||||
<p class="alert-title">
|
||||
<i class="icon"></i>
|
||||
{%- if note -%}
|
||||
{{ macros_translate::translate(key="note", default="Note", language_strings=language_strings) }}
|
||||
{%- endif -%}
|
||||
{%- if tip -%}
|
||||
{{ macros_translate::translate(key="tip", default="Tip", language_strings=language_strings) }}
|
||||
{%- endif -%}
|
||||
{%- if important -%}
|
||||
{{ macros_translate::translate(key="important", default="Important", language_strings=language_strings) }}
|
||||
{%- endif -%}
|
||||
{%- if warning -%}
|
||||
{{ macros_translate::translate(key="warning", default="Warning", language_strings=language_strings) }}
|
||||
{%- endif -%}
|
||||
{%- if caution -%}
|
||||
{{ macros_translate::translate(key="caution", default="Caution", language_strings=language_strings) }}
|
||||
{%- endif -%}
|
||||
{{- alert_string -}}
|
||||
</p>
|
||||
{{ body | markdown | safe }}
|
||||
</blockquote>
|
||||
|
@ -1,35 +1,38 @@
|
||||
{%- set image_classes = [] -%}
|
||||
{%- if full -%}
|
||||
{%- set image_classes = image_classes | concat(with="full") -%}
|
||||
{%- endif -%}
|
||||
{%- if full_bleed -%}
|
||||
{%- set image_classes = image_classes | concat(with="full-bleed") -%}
|
||||
{%- endif -%}
|
||||
{%- if start -%}
|
||||
{%- set image_classes = image_classes | concat(with="start") -%}
|
||||
{%- endif -%}
|
||||
{%- if end -%}
|
||||
{%- set image_classes = image_classes | concat(with="end") -%}
|
||||
{%- endif -%}
|
||||
{%- if pixels -%}
|
||||
{%- set image_classes = image_classes | concat(with="pixels") -%}
|
||||
{%- endif -%}
|
||||
{%- if transparent -%}
|
||||
{%- set image_classes = image_classes | concat(with="transparent") -%}
|
||||
{%- endif -%}
|
||||
{%- if no_hover -%}
|
||||
{%- set image_classes = image_classes | concat(with="no-hover") -%}
|
||||
{%- endif -%}
|
||||
{%- if spoiler -%}
|
||||
{%- set image_classes = image_classes | concat(with="spoiler") -%}
|
||||
{%- endif -%}
|
||||
{%- if spoiler and solid -%}
|
||||
{%- set image_classes = image_classes | concat(with="solid") -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- set image_classes = image_classes | join(sep=" ") -%}
|
||||
|
||||
{%- if url_min -%}
|
||||
<a href="{{ url }}">
|
||||
<img class="
|
||||
{% if full %}full{% endif %}
|
||||
{% if full_bleed %}full-bleed{% endif %}
|
||||
{% if start %}start{% endif %}
|
||||
{% if end %}end{% endif %}
|
||||
{% if pixels %}pixels{% endif %}
|
||||
{% if transparent %}transparent{% endif %}
|
||||
{% if no_hover %}no-hover{% endif %}
|
||||
{% if spoiler %}spoiler{% endif %}
|
||||
{% if spoiler and solid %}solid{% endif %}
|
||||
"
|
||||
{%- if alt -%}alt="{{ alt }}"{%- endif -%}
|
||||
src="{{ url_min }}"
|
||||
{%- if config.markdown.lazy_async_image -%}decoding="async" loading="lazy"{%- endif -%}
|
||||
/>
|
||||
<img class="{{ image_classes }}" {%- if alt -%}alt="{{ alt }}"{%- endif -%} src="{{ url_min }}" {%- if config.markdown.lazy_async_image -%}decoding="async" loading="lazy"{%- endif -%} />
|
||||
</a>
|
||||
{%- else -%}
|
||||
<img class="
|
||||
{% if full %}full{% endif %}
|
||||
{% if full_bleed %}full-bleed{% endif %}
|
||||
{% if start %}start{% endif %}
|
||||
{% if end %}end{% endif %}
|
||||
{% if pixels %}pixels{% endif %}
|
||||
{% if transparent %}transparent{% endif %}
|
||||
{% if no_hover %}no-hover{% endif %}
|
||||
{% if spoiler %}spoiler{% endif %}
|
||||
{% if spoiler and solid %}solid{% endif %}
|
||||
"
|
||||
{%- if alt -%}alt="{{ alt }}"{%- endif -%}
|
||||
src="{{ url }}"
|
||||
{%- if config.markdown.lazy_async_image -%}decoding="async" loading="lazy"{%- endif -%}
|
||||
/>
|
||||
<img class="{{ image_classes }}" {%- if alt -%}alt="{{ alt }}"{%- endif -%} src="{{ url }}" {%- if config.markdown.lazy_async_image -%}decoding="async" loading="lazy"{%- endif -%} />
|
||||
{%- endif -%}
|
||||
|
16
templates/shortcodes/mastodon.html
Normal file
16
templates/shortcodes/mastodon.html
Normal file
@ -0,0 +1,16 @@
|
||||
{%- if host -%}
|
||||
{%- set host = host -%}
|
||||
{%- else -%}
|
||||
{%- set host = config.extra.comments.host -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- if user -%}
|
||||
{%- set user = user -%}
|
||||
{%- else -%}
|
||||
{%- set user = config.extra.comments.user -%}
|
||||
{%- endif -%}
|
||||
|
||||
<iframe
|
||||
class="mastodon-embed"
|
||||
src="https://{{ host }}/@{{ user }}/{{ id }}/embed">
|
||||
</iframe>
|
@ -1,12 +1,50 @@
|
||||
<video class="
|
||||
{% if full %}full{% endif %}
|
||||
{% if full_bleed %}full-bleed{% endif %}
|
||||
{% if start %}start{% endif %}
|
||||
{% if end %}end{% endif %}
|
||||
{% if pixels %}pixels{% endif %}
|
||||
{% if transparent %}transparent{% endif %}
|
||||
{% if spoiler %}spoiler{% endif %}
|
||||
{% if spoiler and solid %}solid{% endif %}
|
||||
"
|
||||
{%- if alt -%}aria-title="{{ alt }}"{%- endif -%}
|
||||
controls src="{{ url }}"></video>
|
||||
{# Video classes #}
|
||||
{%- set video_classes = [] -%}
|
||||
{%- if full -%}
|
||||
{%- set video_classes = video_classes | concat(with="full") -%}
|
||||
{%- endif -%}
|
||||
{%- if full_bleed -%}
|
||||
{%- set video_classes = video_classes | concat(with="full-bleed") -%}
|
||||
{%- endif -%}
|
||||
{%- if start -%}
|
||||
{%- set video_classes = video_classes | concat(with="start") -%}
|
||||
{%- endif -%}
|
||||
{%- if end -%}
|
||||
{%- set video_classes = video_classes | concat(with="end") -%}
|
||||
{%- endif -%}
|
||||
{%- if pixels -%}
|
||||
{%- set video_classes = video_classes | concat(with="pixels") -%}
|
||||
{%- endif -%}
|
||||
{%- if transparent -%}
|
||||
{%- set video_classes = video_classes | concat(with="transparent") -%}
|
||||
{%- endif -%}
|
||||
{%- if spoiler -%}
|
||||
{%- set video_classes = video_classes | concat(with="spoiler") -%}
|
||||
{%- endif -%}
|
||||
{%- if spoiler and solid -%}
|
||||
{%- set video_classes = video_classes | concat(with="solid") -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- set video_classes = video_classes | join(sep=" ") -%}
|
||||
|
||||
{# Video attributes #}
|
||||
{%- set video_attributes = [] -%}
|
||||
{%- if autoplay -%}
|
||||
{%- set video_attributes = video_attributes | concat(with="autoplay") -%}
|
||||
{%- endif -%}
|
||||
{%- if controls -%}
|
||||
{%- set video_attributes = video_attributes | concat(with="controls") -%}
|
||||
{%- endif -%}
|
||||
{%- if loop -%}
|
||||
{%- set video_attributes = video_attributes | concat(with="loop") -%}
|
||||
{%- endif -%}
|
||||
{%- if muted -%}
|
||||
{%- set video_attributes = video_attributes | concat(with="muted") -%}
|
||||
{%- endif -%}
|
||||
{%- if playsinline -%}
|
||||
{%- set video_attributes = video_attributes | concat(with="playsinline") -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- set video_attributes = video_attributes | join(sep=" ") -%}
|
||||
|
||||
<video class="{{ video_classes }}" src="{{ url }}" {%- if alt -%}aria-title="{{ alt }}"{%- endif -%} {{ video_attributes }}></video>
|
||||
|
@ -1,4 +1,6 @@
|
||||
<iframe class="vimeo-embed"
|
||||
<iframe
|
||||
class="vimeo-embed"
|
||||
src="https://player.vimeo.com/video/{{ id }}{% if autoplay %}?autoplay=1{% endif %}"
|
||||
allow="autoplay; fullscreen; picture-in-picture"
|
||||
allowfullscreen></iframe>
|
||||
allowfullscreen>
|
||||
</iframe>
|
||||
|
@ -1,5 +1,6 @@
|
||||
<iframe class="youtube-embed"
|
||||
<iframe
|
||||
class="youtube-embed"
|
||||
src="https://www.youtube-nocookie.com/embed/{{ id }}{% if autoplay %}?autoplay=1{% endif %}{% if autoplay and start %}&start={{ start }}{% elif start %}?start={{ start }}{% endif %}"
|
||||
title="YouTube video player"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
|
||||
referrerpolicy="strict-origin-when-cross-origin" allowfullscreen>
|
||||
</iframe>
|
||||
|
Reference in New Issue
Block a user