From b54ec3d45b077919ec00d61b8ee922d20d0b6e3c Mon Sep 17 00:00:00 2001
From: Łukasz Mróz <mrozlukasz@users.noreply.github.com>
Date: Thu, 23 May 2019 16:59:30 +0000
Subject: [PATCH] Add custom_js site param for enabling custom js (#182)
---
exampleSite/config.toml | 3 +++
layouts/_default/baseof.html | 6 +++++-
CONTRIBUTORS.md | 1 +
3 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index a6f2591..8c4041f 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -37,3 +37,4 @@
- [D_DAndrew](https://d-dandrew.github.io)
- [Wataru Mizukami](https://github.com/tarumzu)
- [Yudi Widiyanto](https://github.com/yudiwdynto)
+- [Łukasz Mróz](https://github.com/mrozlukasz)
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 2a3a1bf..d4e086b 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -41,6 +41,9 @@
# Custom CSS
custom_css = []
+
+ # Custom JS
+ custom_js = []
[taxonomies]
category = "categories"
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index a5f8b12..416d077 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -60,9 +60,13 @@
{{ end }}
{{ range .Site.Params.custom_css }}
- <link rel="stylesheet" href="{{ . | relURL }}">
+ <link rel="stylesheet" href="{{ . | relURL }}" />
{{ end }}
+ {{ range .Site.Params.custom_js }}
+ <script src="{{ . | relURL }}"></script>
+ {{ end }}
+
<link rel="icon" type="image/png" href="{{ .Site.Params.favicon_32 | default "/images/favicon-32x32.png" | absURL }}" sizes="32x32">
<link rel="icon" type="image/png" href="{{ .Site.Params.favicon_16 | default "/images/favicon-16x16.png" | absURL }}" sizes="16x16">
--
Gitblit v1.10.0