Skip to content
This repository has been archived by the owner on Aug 8, 2019. It is now read-only.

Commit

Permalink
Add option for custom assets
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalcraftsman committed May 4, 2016
1 parent bea47bd commit 178dc61
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
6 changes: 5 additions & 1 deletion exampleSite/config.toml
Original file line number Diff line number Diff line change
@@ -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 = ""
Expand Down Expand Up @@ -33,6 +33,10 @@ googleAnalytics = ""
# - you're done. Happy mailing!
email = "[email protected]"

# Link custom assets relative to /statuc
custom_css = []
custom_js = []


# Navigation
[params.navigation]
Expand Down
7 changes: 5 additions & 2 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
<meta name="author" content="{{ with .Site.Params.name }}{{ . }}{{ end }}">
{{ .Hugo.Generator }}
<title>{{ .Site.Title }}</title>
{{ "<!-- Bootstrap Core CSS -->" | safeHTML }}
{{ "<!-- Stylesheets -->" | safeHTML }}
<link href="{{ .Site.BaseURL }}css/bootstrap.min.css" rel="stylesheet">
{{ "<!-- Custom CSS -->" | safeHTML }}
<link href="{{ .Site.BaseURL }}css/agency.css" rel="stylesheet">
{{ range .Site.Params.custom_css }}
<link rel="stylesheet" href="{{ $.Site.BaseURL }}{{ . }}">
{{ end }}

{{ "<!-- Custom Fonts -->" | safeHTML }}
<link href="{{ .Site.BaseURL }}font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
Expand Down
4 changes: 4 additions & 0 deletions layouts/partials/js.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@
{{ "<!-- Custom Theme JavaScript -->" | safeHTML }}
<script src="{{ .Site.BaseURL }}js/agency.js"></script>
{{ template "_internal/google_analytics.html" . }}

{{ range .Site.Params.custom_js }}
<script src="{{ . | absURL }}"></script>
{{ end }}

0 comments on commit 178dc61

Please sign in to comment.