mirror of https://github.com/luizdepra/hugo-coder.git

Łukasz Mróz
23.59.2019 b54ec3d45b077919ec00d61b8ee922d20d0b6e3c
Add custom_js site param for enabling custom js (#182)

* Add custom_js site param for enabling custom js

I've hit that when adding Cookie Consent on my web page. https://github.com/insites/cookieconsent

* PR Remarks - added Custom JS into exampleSite

* Update layouts/_default/baseof.html

Co-Authored-By: Luiz F. A. de Prá <luizdepra@users.noreply.github.com>

* Update CONTRIBUTORS.md
3 files modified
10 ■■■■■ changed files
CONTRIBUTORS.md 1 ●●●● patch | view | raw | blame | history
exampleSite/config.toml 3 ●●●●● patch | view | raw | blame | history
layouts/_default/baseof.html 6 ●●●● patch | view | raw | blame | history
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)
exampleSite/config.toml
@@ -41,6 +41,9 @@
    # Custom CSS
    custom_css = []
    # Custom JS
    custom_js = []
[taxonomies]
  category = "categories"
layouts/_default/baseof.html
@@ -60,7 +60,11 @@
    {{ 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">