Browse Source

Add option for custom assets

master
digitalcraftsman 9 years ago
parent
commit
6f75916cf8
  1. 4
      exampleSite/config.toml
  2. 4
      layouts/partials/head.html
  3. 5
      layouts/partials/js.html

4
exampleSite/config.toml

@ -16,6 +16,10 @@ disqusShortname = "spf13"
twitter = "Your Twitter account"
enableRSS = true
# Add custom assets with their paths relative to the static folder
customCSS = []
customJS = []
# The variables below are optionally too and can be used to
# translate or customize each string of the theme.

4
layouts/partials/head.html

@ -11,6 +11,10 @@
<link rel="shortcut icon" href="{{ .Site.BaseURL }}images/favicon.ico">
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/style.css">
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/highlight.css">
{{ range .Site.Params.customCSS }}
<link rel="stylesheet" href="{{ $.Site.BaseURL }}{{ . }}">
{{ end }}
{{ if eq .Site.Params.iconFont "font-awesome" }}
<link rel="stylesheet" href="{{ .Site.BaseURL }}fontawesome/css/font-awesome.min.css">
{{ else }}

5
layouts/partials/js.html

@ -2,4 +2,9 @@
<script src="{{ .Site.BaseURL }}js/main.js"></script>
<script src="{{ .Site.BaseURL }}js/highlight.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
{{ range .Site.Params.customJS }}
<script src="{{ $.Site.BaseURL }}{{ . }}"></script>
{{ end }}
{{ template "_internal/google_analytics.html" . }}
Loading…
Cancel
Save