From 103ff01d0ece0f3c0112b48015750300d907d8fa Mon Sep 17 00:00:00 2001 From: Jieiku Date: Tue, 31 May 2022 02:09:53 -0700 Subject: Improve Shortcodes, example content, page scores, fonts --- templates/shortcodes/imghover.html | 85 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 templates/shortcodes/imghover.html (limited to 'templates/shortcodes/imghover.html') 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 %} +