From 3433a008a37d17d0d60a0bfdf84dd01ccce940ef Mon Sep 17 00:00:00 2001 From: Emil Miler Date: Thu, 2 Apr 2020 17:21:56 +0200 Subject: [PATCH] =?UTF-8?q?Filtr=20pro=20vkl=C3=A1d=C3=A1n=C3=AD=20souboru?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Filtr vyhledá všechny soubory s definovaným názvem. Název se musí definovat bez koncovky. Generátor vyhledá všechny soubory s daným názvem a vytvoří pro každou koncovku odkaz. --- sass/style.scss | 19 +++++++++++++++++++ templates/shortcodes/document.html | 14 ++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/sass/style.scss b/sass/style.scss index 6488b39..107d63e 100644 --- a/sass/style.scss +++ b/sass/style.scss @@ -133,6 +133,25 @@ body { text-align: right; } + .file { + border: 1px solid #ccc; + padding: 1em; + margin: 1em; + + .title { + margin-top: 0; + } + + .format { + margin-right: 1em; + padding: .3em .5em; + background: $primary; + color: #fff; + text-decoration: none; + border-radius: .3em; + } + } + video { width: 100%; } diff --git a/templates/shortcodes/document.html b/templates/shortcodes/document.html index e69de29..4518dac 100644 --- a/templates/shortcodes/document.html +++ b/templates/shortcodes/document.html @@ -0,0 +1,14 @@ +{% if section.assets and filename %} +
+ {% if title %} +
{{ title }}
+ {% else %} +
{{ filename }}
+ {% endif %} + {% for asset in section.assets %} + {% if asset is matching(section.path ~ filename ~ "\..*$") %} + {{ asset | split(pat=".") | last }} + {% endif %} + {% endfor %} +
+{% endif %}