From 178dc61b1b0ee09e6a00299ee2c2ee70168b0eba Mon Sep 17 00:00:00 2001 From: digitalcraftsman Date: Wed, 4 May 2016 09:40:51 +0200 Subject: [PATCH] Add option for custom assets --- exampleSite/config.toml | 6 +++++- layouts/partials/head.html | 7 +++++-- layouts/partials/js.html | 4 ++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index d67464e..4f04090 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -1,7 +1,7 @@ # Site settings baseurl = "http://replace-this-with-your-hugo-site.com/" languageCode = "en-us" -title = "Hugo Agency Theme" +title = "Agency" theme = "hugo-agency-theme" # Enter your tracking code to enable Google Analytics googleAnalytics = "" @@ -33,6 +33,10 @@ googleAnalytics = "" # - you're done. Happy mailing! email = "your@email.com" + # Link custom assets relative to /statuc + custom_css = [] + custom_js = [] + # Navigation [params.navigation] diff --git a/layouts/partials/head.html b/layouts/partials/head.html index d0d00ca..960d8cf 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -5,10 +5,13 @@ {{ .Hugo.Generator }} {{ .Site.Title }} -{{ "" | safeHTML }} +{{ "" | safeHTML }} -{{ "" | safeHTML }} +{{ range .Site.Params.custom_css }} + +{{ end }} + {{ "" | safeHTML }} diff --git a/layouts/partials/js.html b/layouts/partials/js.html index d0b6f99..d9b0611 100644 --- a/layouts/partials/js.html +++ b/layouts/partials/js.html @@ -12,3 +12,7 @@ {{ "" | safeHTML }} {{ template "_internal/google_analytics.html" . }} + +{{ range .Site.Params.custom_js }} + +{{ end }}