From 0c09ae8bf0fd1a3856fc6b4a72d1a5f03d2d9173 Mon Sep 17 00:00:00 2001 From: David Garcia Date: Tue, 5 Dec 2023 12:36:53 +0000 Subject: [PATCH] feat: add local-scripts support (#949) --- docs/source/configuration/template.rst | 4 ++++ sphinx_scylladb_theme/layout.html | 5 ++++- sphinx_scylladb_theme/local-scripts.html | 2 ++ .../{custom-scripts.html => scylladb-scripts.html} | 3 --- sphinx_scylladb_theme/theme.conf | 1 + 5 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 sphinx_scylladb_theme/local-scripts.html rename sphinx_scylladb_theme/{custom-scripts.html => scylladb-scripts.html} (94%) diff --git a/docs/source/configuration/template.rst b/docs/source/configuration/template.rst index aace1e05e..af151d953 100644 --- a/docs/source/configuration/template.rst +++ b/docs/source/configuration/template.rst @@ -17,6 +17,10 @@ General configuration options. - Type - Default Value - Description + * - ``local_scripts`` + - string + - true + - When set to ``true``, this option enables the loading of the ``local-scripts.html`` file from the template. This file is customizable per project, providing a convenient way to insert project-specific tags and scripts. * - ``scylladb_scripts`` - string - true diff --git a/sphinx_scylladb_theme/layout.html b/sphinx_scylladb_theme/layout.html index f2dcfc5c1..bcf603de2 100644 --- a/sphinx_scylladb_theme/layout.html +++ b/sphinx_scylladb_theme/layout.html @@ -73,8 +73,11 @@ {% endblock %} {% block scripts %} {{ script() }} + {% if theme_local_scripts|lower == 'true' %} + {% include 'local-scripts.html' %} + {% endif %} {% if theme_scylladb_scripts|lower == 'true' %} - {% include 'custom-scripts.html' %} + {% include 'scylladb-scripts.html' %} {% endif %} {% endblock %} diff --git a/sphinx_scylladb_theme/local-scripts.html b/sphinx_scylladb_theme/local-scripts.html new file mode 100644 index 000000000..1fcdaf672 --- /dev/null +++ b/sphinx_scylladb_theme/local-scripts.html @@ -0,0 +1,2 @@ + + diff --git a/sphinx_scylladb_theme/custom-scripts.html b/sphinx_scylladb_theme/scylladb-scripts.html similarity index 94% rename from sphinx_scylladb_theme/custom-scripts.html rename to sphinx_scylladb_theme/scylladb-scripts.html index fe2dffcba..87a3c0277 100644 --- a/sphinx_scylladb_theme/custom-scripts.html +++ b/sphinx_scylladb_theme/scylladb-scripts.html @@ -1,6 +1,3 @@ - - -