From e51d42c92a92d850e52b42a1be682537c8400365 Mon Sep 17 00:00:00 2001
From: weru <fromweru@gmail.com>
Date: Mon, 31 Jan 2022 23:33:12 +0000
Subject: [PATCH] make icons dir configurable #69
---
assets/js/variables.js | 1 +
assets/js/functions.js | 2 +-
exampleSite/config/_default/params.toml | 3 +++
3 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/assets/js/functions.js b/assets/js/functions.js
index 0d5095b..e57e804 100644
--- a/assets/js/functions.js
+++ b/assets/js/functions.js
@@ -173,7 +173,7 @@
}
}
-function loadSvg(file, parent, path = 'icons/') {
+function loadSvg(file, parent, path = iconsPath) {
const link = new URL(`${path}${file}.svg`, rootURL).href;
fetch(link)
.then((response) => {
diff --git a/assets/js/variables.js b/assets/js/variables.js
index f6ddc1d..6deb393 100644
--- a/assets/js/variables.js
+++ b/assets/js/variables.js
@@ -10,6 +10,7 @@
// config defined values
const codeBlockConfig = JSON.parse('{{ partial "functions/getCodeConfig" . }}');
+const iconsPath = `{{ partialCached "functions/getIconPath" . }}`;
// defined in i18n / translation files
const quickLinks = '{{ T "quick_links" }}';
diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml
index dac2e04..9b92c5f 100644
--- a/exampleSite/config/_default/params.toml
+++ b/exampleSite/config/_default/params.toml
@@ -16,6 +16,9 @@
# disable showing line numbers by default. Switch to `true` if you'd rather have them on.
codeLineNumbers = false
+# By default the template will look for icons under the icons directory. In some situations you might wanna change that. edit the line below
+# iconsPath = 'icons/'
+
# Site logo
[logo]
lightMode = "images/compose.svg"
--
Gitblit v1.10.0