Skip to content
This repository was archived by the owner on Jul 1, 2020. It is now read-only.

Commit cd1a8c0

Browse files
Add option to link custom assets
1 parent 2ce1052 commit cd1a8c0

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

exampleSite/config.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ theme = "hugo-icarus-theme"
2828
# Format dates with Go's time formatting
2929
date_format = "2006-01-02"
3030

31+
# Add custom assets with their paths relative to the static folder
32+
custom_css = []
33+
custom_js = []
34+
3135
# Create custom menu entries by defining a label and a link for
3236
# them. Since you can also link posts, you've the option the
3337
# place the links before or after them.

layouts/partials/footer_js.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
<script src="{{ .Site.BaseURL }}js/script.js"></script>
44
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.8.0/highlight.min.js"></script>
55
<script>hljs.initHighlightingOnLoad();</script>
6+
{{ range .Site.Params.custom_js }}
7+
<script src="{{ . | absURL }}"></script>
8+
{{ end }}
69

710
{{ "<!-- MathJax -->" | safeHTML }}
811
<script type="text/x-mathjax-config">

layouts/partials/head.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/font-awesome.min.css">
2323
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/monokai.css">
2424
<link rel="stylesheet" href="{{ .Site.BaseURL }}fancybox/jquery.fancybox.css">
25+
{{ range .Site.Params.custom_css }}
26+
<link rel="stylesheet" href="{{ . | absURL }}">
27+
{{ end }}
2528
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400italic,400,600' rel='stylesheet' type='text/css'>
2629
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro' rel='stylesheet' type='text/css'>
2730
{{ template "_internal/opengraph.html" . }}

0 commit comments

Comments
 (0)