From a2ea06d513a5802964f8f0ef5795cec7e548ed7b Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sat, 13 Sep 2025 14:55:15 -0600 Subject: Squashed 'themes/tabi-lean/' content from commit 95c8796 git-subtree-dir: themes/tabi-lean git-subtree-split: 95c879696445ede40daa7a30a88dae5dd74d5c0c --- templates/partials/extra_features.html | 88 ++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 templates/partials/extra_features.html (limited to 'templates/partials/extra_features.html') diff --git a/templates/partials/extra_features.html b/templates/partials/extra_features.html new file mode 100644 index 0000000..50c3337 --- /dev/null +++ b/templates/partials/extra_features.html @@ -0,0 +1,88 @@ +{%- set page_or_section = page | default(value=section) -%} + +{# prepare parameters for evaluate_setting_priority macro #} +{%- set page_s = page | default(value="") -%} +{%- set section_s = section | default(value="") -%} + +{# Quick navigation buttons #} +{% if macros_settings::evaluate_setting_priority(setting="quick_navigation_buttons", page=page_s, section=section_s, default_global_value=false) == "true" %} +
+ {# Button to go show a floating Table of Contents #} + {% if page_or_section.toc %} +
+ + + +
+ {{ macros_toc::toc(page=page_or_section, header=false, language_strings=language_strings) }} +
+
+ {% endif %} + + {# Button to go to the comment/webmentions section #} + {% if comment_system or config.extra.webmentions.enable %} + {%- if comment_system -%} + {#- Comments are shown above webmentions -#} + {%- set comments_id = "comments" -%} + {%- else -%} + {%- set comments_id = "webmentions" -%} + {%- endif -%} + + + + + {% endif %} + + {# Button to go to the top of the page #} + + + +
+{% endif %} + +{# Add KaTeX functionality #} +{%- if macros_settings::evaluate_setting_priority(setting="katex", page=page_s, section=section_s, default_global_value=false) == "true" -%} + + +{%- endif -%} + +{# Load mermaid.js #} +{%- if macros_settings::evaluate_setting_priority(setting="mermaid", page=page_s, section=section_s, default_global_value=false) == "true" -%} + {%- if config.extra.serve_local_mermaid | default(value=true) -%} + + {%- else -%} + + {%- endif -%} +{%- endif -%} + +{# Add copy button to code blocks #} +{%- if macros_settings::evaluate_setting_priority(setting="copy_button", page=page_s, section=section_s, default_global_value=true) == "true" -%} + {#- Add hidden HTML elements with the translated strings for the button's interactions -#} + + + +{%- endif -%} + +{# JavaScript to make code block names clickable when they are URLs: https://welpo.github.io/tabi/blog/shortcodes/#show-source-or-path #} +{# Note: "add_src_to_code_block" is deprecated in favor of "code_block_name_links". It will be removed in a future release. #} +{# See https://github.com/welpo/tabi/pull/489 #} +{%- if macros_settings::evaluate_setting_priority(setting="code_block_name_links", page=page_s, section=section_s, default_global_value=false) == "true" + or macros_settings::evaluate_setting_priority(setting="add_src_to_code_block", page=page_s, section=section_s, default_global_value=false) == "true" -%} + +{%- endif -%} + +{# Add backlinks to footnotes #} +{%- if macros_settings::evaluate_setting_priority(setting="footnote_backlinks", page=page_s, section=section_s, default_global_value=false) == "true" -%} + +{%- endif -%} + +{# Add iine.js for the like button #} +{%- if macros_settings::evaluate_setting_priority(setting="iine", page=page_s, section=section_s, default_global_value=false) == "true" -%} + +{%- endif -%} -- cgit v1.2.3