Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/onweru/compose.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorweru <fromweru@gmail.com>2022-02-01 02:33:12 +0300
committerweru <fromweru@gmail.com>2022-02-01 02:33:12 +0300
commite51d42c92a92d850e52b42a1be682537c8400365 (patch)
treea183c4343884177e72a30c008e078b260c7606bc
parentedc99e46de4ac44a2cfa6ac15fe39e0ce27adcad (diff)
make icons dir configurable #69
Signed-off-by: weru <fromweru@gmail.com>
-rw-r--r--assets/js/functions.js2
-rw-r--r--assets/js/variables.js1
-rw-r--r--exampleSite/config/_default/params.toml3
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 parseBoolean(string) {
}
}
-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 @@ const searchClass = '.search';
// 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 @@ codeMaxLines = 7
# 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"