aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorJieiku2023-05-01 15:08:23 -0700
committerJieiku2023-05-22 22:49:42 -0700
commit6c5915c04659a992635742074b2ad92d3e97a9df (patch)
treed31cb3507154c55be0ce7156664849341e3a2909 /templates
parent1010c41b8ac22e7e69177e0d02e034896fb9eadb (diff)
downloadabridge-6c5915c04659a992635742074b2ad92d3e97a9df.tar.gz
abridge-6c5915c04659a992635742074b2ad92d3e97a9df.tar.bz2
abridge-6c5915c04659a992635742074b2ad92d3e97a9df.zip
Replace import with use
Diffstat (limited to 'templates')
-rw-r--r--templates/categories/list.html2
-rw-r--r--templates/macros/head.html2
-rw-r--r--templates/shortcodes/note.html30
-rw-r--r--templates/tags/list.html2
4 files changed, 33 insertions, 3 deletions
diff --git a/templates/categories/list.html b/templates/categories/list.html
index a237591..eca6da3 100644
--- a/templates/categories/list.html
+++ b/templates/categories/list.html
@@ -19,7 +19,7 @@
<div>
<div class="c">
<h1>{{ terms | length }} {%- if lang != config.default_language %} {{ trans(key="Categories" | safe, lang=lang) }} {% else %} Categories {% endif %}</h1>
- <p>{% for term in terms %} [<a href="#{{ term.name }}">{{ term.name }}</a>] {% endfor %}</p>
+ <p>{% for term in terms %} [<a href="#{{ term.name }}">{{ term.name }}</a>]<sup>{{ term.pages | length }}</sup> {% endfor %}</p>
</div>
{%- for term in terms %}
<h2 id="{{ term.name }}"><a href="{{ term.permalink | safe }}">{{ term.name }}</a></h2>
diff --git a/templates/macros/head.html b/templates/macros/head.html
index 0690bc1..88c9781 100644
--- a/templates/macros/head.html
+++ b/templates/macros/head.html
@@ -96,7 +96,7 @@
{%- if js_theme %}
{%- set js_themeButton=config.extra.js_themeButton | default(value="theme_button.js") -%}
{%- if js_themeButton %}
- <script defer src="{{ get_url(path=js_themeButton, trailing_slash=false) | safe }}"{%- if config.extra.integrity | default(value=true) %} integrity="sha384-{{ get_hash(path=js_themeButton, sha_type=384, base64=true) | safe }}"{%- endif %}></script>
+ <script defer src="{{ get_url(path=js_themeButton, trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity | default(value=true) %} integrity="sha384-{{ get_hash(path=js_themeButton, sha_type=384, base64=true) | safe }}"{%- endif %}></script>
{%- endif %}
{%- endif %}
{%- endif %}
diff --git a/templates/shortcodes/note.html b/templates/shortcodes/note.html
new file mode 100644
index 0000000..b2420e9
--- /dev/null
+++ b/templates/shortcodes/note.html
@@ -0,0 +1,30 @@
+{# note shortcode with icon and border
+
+ type: ok / info / warning / error / neutral / other
+ display: block / icon / both
+ size: small / medium / large
+ markdown: true / false
+
+ example:
+
+ {% note(type="ok", display="block", size="small" markdown=true) %}
+ *Sample* "ok" note. With display "block"
+ And **markdown** content.
+ {% end %}
+#}
+
+{# define defaults #}
+{% if not type %}{% set type="neutral" %}{% endif %}
+{% if not display %}{% set display="block" %}{% endif %}
+{% if not size %}{% set size="small" %}{% endif %}
+{% if not markdown %}{% set markdown=true %}{% endif %}
+
+<div class="note
+{%- if display == 'icon' %} note-icon note-icon-{{size}} note-icon-{{type}}
+{%- elif display == 'block' %} note-block note-{{type}}
+{%- elif display == 'both' %} note-icon note-icon-{{size}} note-icon-{{type}} note-block note-{{type}}
+{%- endif %}">
+{% if markdown %}{{ body | markdown | safe }}
+{% else %}{{ body | safe }}
+{% endif %}
+</div>
diff --git a/templates/tags/list.html b/templates/tags/list.html
index 2184cba..c703761 100644
--- a/templates/tags/list.html
+++ b/templates/tags/list.html
@@ -19,7 +19,7 @@
<div>
<div class="c">
<h1>{{ terms | length }} {%- if lang != config.default_language %} {{ trans(key="Tags" | safe, lang=lang) }} {% else %} Tags {% endif %}</h1>
- <p>{% for term in terms %} #<a href="#{{ term.name }}">{{ term.name }}</a> {% endfor %}</p>
+ <p>{% for term in terms %} #<a href="#{{ term.name }}">{{ term.name }}</a><sup>{{ term.pages | length }}</sup> {% endfor %}</p>
</div>
{%- for term in terms %}
<h2 id="{{ term.name }}">#<a href="{{ term.permalink | safe }}">{{ term.name }}</a></h2>