` tag, and the
+element is returned.
+
+### Usage
+```rs
+{{/* video(sources=["over9000_av1.mp4", "over9000_vp9.webm"]) */}}
+```
+### Output
+```html
+{{ video(sources=["over9000_av1.mp4", "over9000_vp9.webm"]) }}
+```
+{{ video(sources=["over9000_av1.mp4", "over9000_vp9.webm"]) }}
+
+## Image
+
+The `image` shortcode returns a `` tag and accepts three
+parameters: `sources` (an array of strings), `fallback_path`, and
+`fallback_alt` (both strings).
+
+Each string in the `sources` array should be a path to an image file of
+a different type (`webp`, `png`, `jpg`, etc). `fpath` and
+`falt` are used to create an `
` tag for the browser to fall
+back on if the other formats aren't yet supported, fw and fh set the width and height of the fallback
+
+### Usage
+```rs
+{{/* image(sources=["over9000-960.webp", "over9000-640.webp", "over9000-400.webp"], fpath="over9000-640.webp", fw=640, fh=480, falt="ITS OVER 9000!") */}}
+```
+### Output
+```html
+{{ image(sources=["over9000-960.webp", "over9000-640.webp", "over9000-400.webp"], fpath="over9000-640.webp", fw=640, fh=480, falt="ITS OVER 9000!") }}
+```
+{{ image(sources=["over9000-960.webp", "over9000-640.webp", "over9000-400.webp"], fpath="over9000-640.webp", fw=640, fh=480, falt="ITS OVER 9000!") }}
+
+## GIF
+
+The `gif` shortcode is exactly the same as the [video shortcode][video]
+– it takes an array of strings called `sources` and returns a
+`
diff --git a/templates/shortcodes/imagehover.html b/templates/shortcodes/imagehover.html
deleted file mode 100644
index 99dd4e4..0000000
--- a/templates/shortcodes/imagehover.html
+++ /dev/null
@@ -1,41 +0,0 @@
-{%- set_global bg = " " %}
-{%- set_global bgname = " " %}
-{%- for source in sources %}
- {%- set sourcename = source | split(pat=".") | first %}
- {%- if loop.first %}
- {%- set_global bg = source %}
- {%- set_global bgname = source | split(pat=".") | first %}
- {%- else %}
-
- ## {{ sourcename }}
-
-
- {%- endif %}
-{%- endfor %}
-
-{%- if w and h and p %}
- {%- set padding = h / w * p %}
-{%- elif w and h %}
- {%- set padding = h / w * 50 %}
-{%- else %}
- {%- set padding = 50 %}
-{%- endif %}
-
-
diff --git a/templates/shortcodes/img.html b/templates/shortcodes/img.html
index d003eeb..46fb39d 100644
--- a/templates/shortcodes/img.html
+++ b/templates/shortcodes/img.html
@@ -1,45 +1,23 @@
-{# {{ img(path="", alt="", caption="", extended_width_pct=1.3, quality=90) }} #}
+{# {{ img(src="ferris.svg" class="" alt="" w=600 h=400) }} #}
-{# container_width = (pixel size, px) * (.container's max-width) #}
-{% set container_width = 16 * 42 %}
+{%- set dirtest = src | trim_start_matches(pat="./") %}
+{%- if dirtest is containing("/") %}
+ {%- set reldir = true %}
+{%- endif %}
-{# figure_width = container_width - (figure margin_blocks) #}
-{% set figure_width = container_width - (40 * 2) %}
+{%- if src is starting_with("./") and reldir %} {# Relative Path #}
+ {%- set path = src | trim_start_matches(pat="./") | split(pat="/") | slice(end=-1) | join(sep="/") | trim_start_matches(pat="/") %}
+ {%- set path = path ~ "/" %}
-{% if path is starting_with("./") %}
- {% set relative_path = page.relative_path | split(pat="/") | slice(end=-1) | join(sep="/") %}
- {% set img_path = path | trim_start_matches(pat="./") %}
- {% set img_path = relative_path ~ "/" ~ img_path %}
-{% else %}
- {% set img_path = path %}
-{% endif %}
+{%- elif src is starting_with("/") %} {# Root Path #}
+ {%- set rootpath = src | split(pat="/") | slice(end=-1) | join(sep="/") %}
+ {%- set path = config.base_url ~ rootpath ~ "/" %}
-{% if path is not ending_with(".svg") %}
+{%- else %} {# Same Directory Path #}
+ {%- set path = "" %}
- {% set resize = true %}
- {% set image_quality = 90 %}
- {% if quality %}
- {% set image_quality = quality %}
- {% endif %}
+{%- endif %}
- {% if extended_width_pct %}
-
- {% if extended_width_pct == -1 %}
- {# adjust extended width to container width #}
- {% set extended_width_pct = 0.042 %}
- {% endif %}
- {% set _width = config.extra.images.max_width - figure_width %}
- {% set extended_width = (extended_width_pct * _width + figure_width) | round | int %}
- {% if extended_width > config.extra.images.max_width %}
- {% set extended_width = config.extra.images.max_width %}
- {% endif %}
- {% set resized_image = resize_image(path=img_path, width=extended_width, op="fit_width", quality=image_quality) %}
-
- {% else %}
- {% set resized_image = resize_image(path=img_path, width=figure_width, op="fit_width", quality=image_quality) %}
- {% endif %}
-{% endif %}
-
-
- {% if caption %}{{ caption | safe }}{% endif %}
-
+{%- set img = src | split(pat="/") | last %}
+{%- set name = img | split(pat=".") | first %}
+
diff --git a/templates/shortcodes/imghover.html b/templates/shortcodes/imghover.html
new file mode 100644
index 0000000..8063378
--- /dev/null
+++ b/templates/shortcodes/imghover.html
@@ -0,0 +1,85 @@
+{%- set_global bg = "" %}
+
+{%- for source in src %}
+
+ {%- set dirtest = source | trim_start_matches(pat="./") %}
+ {%- if dirtest is containing("/") %}
+ {%- set reldir = true %}
+ {%- endif %}
+
+ {%- if source is starting_with("./") and reldir %} {# Relative Path #}
+ {%- set pathtype = "rel-" %}
+ {%- set path = source | trim_start_matches(pat="./") | split(pat="/") | slice(end=-1) | join(sep="/") | trim_start_matches(pat="/") %}
+ {%- set path = path ~ "/" %}
+
+ {%- elif source is starting_with("/") %} {# Root Path #}
+ {%- set pathtype = "root-" %}
+ {%- set rootpath = source | split(pat="/") | slice(end=-1) | join(sep="/") %}
+ {%- set path = config.base_url ~ rootpath ~ "/" %}
+
+ {%- else %} {# Same Directory Path #}
+ {%- set pathtype = "same-" %}
+ {%- set path = "" %}
+ {%- endif %}
+
+ {%- set sourcepath = source | split(pat="/") | last %}
+ {%- set sourcename = pathtype ~ sourcepath | split(pat=".") | first %}
+
+ {%- if loop.first %}
+ {%- set_global bg = source | split(pat="/") | last %}
+ {%- else %}
+ {{ sourcename }} on hover
+
+ {%- endif %}
+
+{%- endfor %}
+
+{%- if w and h and p %}
+ {%- set padding = h / w * p %}
+{%- elif w and h %}
+ {%- set padding = h / w * 50 %}
+{%- else %}
+ {%- set padding = 50 %}
+{%- endif %}
+
+
diff --git a/templates/shortcodes/katex.html b/templates/shortcodes/katex.html
index cac8e97..9b9a1f7 100644
--- a/templates/shortcodes/katex.html
+++ b/templates/shortcodes/katex.html
@@ -1 +1 @@
-
+
diff --git a/templates/shortcodes/quote.html b/templates/shortcodes/quote.html
deleted file mode 100644
index 8238b71..0000000
--- a/templates/shortcodes/quote.html
+++ /dev/null
@@ -1,6 +0,0 @@
-
- {{body}}
- {% if author %}
- -- {{ author }}
- {% endif %}
-
--
cgit v1.3.1