From 0b9ea98cba83b2661f3b5f137550d9b448167097 Mon Sep 17 00:00:00 2001 From: David Lapshin Date: Mon, 27 May 2024 22:11:03 +0300 Subject: [PATCH] Allow loading additional scripts (hopefully people won't do anything horrible with this) --- config.toml | 7 ++++++- templates/partials/head.html | 14 ++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/config.toml b/config.toml index 4b333f3..e2e89bc 100644 --- a/config.toml +++ b/config.toml @@ -42,12 +42,17 @@ date_format = "%d %B %Y" issues_url = "https://codeberg.org/daudix/duckquill/issues" # URL to website's source code source_url = "https://codeberg.org/daudix/duckquill" -# Additional stylesheets; expects it to be in the "./static/" directory. +# Additional CSS stylesheets; expects them to be in the "./static/" directory. # If you are using Sass it will be generated there automatically. # stylesheets = [ # "YOUR_STYLE.css", # "ALSO_YOUR_STYLE.css" # ] +# Additional JavaScript scripts; expects them to be in the "./static/" directory. +# scripts = [ +# "YOUR_SCRIPT.js", +# "ALSO_YOUR_SCRIPT.js" +# ] # Whether to display "copy code" button on all code blocks # that have the language set. # See https://www.getzola.org/documentation/content/syntax-highlighting/ diff --git a/templates/partials/head.html b/templates/partials/head.html index 48d8f07..bdf5dbd 100644 --- a/templates/partials/head.html +++ b/templates/partials/head.html @@ -33,15 +33,21 @@ } - {% if config.extra.show_copy_button %} - - {% endif %} - {% if config.extra.goatcounter %} {% endif %} + {% if config.extra.show_copy_button %} + + {% endif %} + + {% if config.extra.scripts %} + {% for script in config.extra.scripts %} + + {% endfor %} + {% endif %} + {% if config.extra.comments %} {% endif %}