Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/calintat/minimal.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Bechstein <f@ub0r.de>2018-02-24 17:18:42 +0300
committerCalin Tataru <calintat@gmail.com>2018-02-24 17:18:42 +0300
commit8c38052502970a4b901e26d6f7714ef968a75e73 (patch)
treed830075de27b296dc70e1c1cf85cff7c54e8a858
parent335e9aa141b99efe328c3ddd5d175f53c4ed574c (diff)
Allow adding additional css/js files (#52)
This allows adding css/js files in .Site.Params.css/js both relative or aboslute to the site. The resulting html inserts absolute paths only.
-rw-r--r--layouts/partials/css.html4
-rw-r--r--layouts/partials/js.html2
2 files changed, 3 insertions, 3 deletions
diff --git a/layouts/partials/css.html b/layouts/partials/css.html
index bf82e6f..9dbf93a 100644
--- a/layouts/partials/css.html
+++ b/layouts/partials/css.html
@@ -13,10 +13,10 @@
</style>
<!-- main -->
-<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/main.css">
+<link rel="stylesheet" href="{{ "css/main.css" | absURL }}">
<!-- custom -->
-{{ range .Site.Params.css }} <link rel="stylesheet" href="{{ . }}"> {{ end }}
+{{ range .Site.Params.css }} <link rel="stylesheet" href="{{ . | absURL }}"> {{ end }}
<!-- google fonts -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family={{ .Site.Params.font }}">
diff --git a/layouts/partials/js.html b/layouts/partials/js.html
index 4b37707..bde40f8 100644
--- a/layouts/partials/js.html
+++ b/layouts/partials/js.html
@@ -10,7 +10,7 @@
{{ end }}
<!-- custom -->
-{{ range .Site.Params.js }} <script src="{{ . }}"></script> {{ end }}
+{{ range .Site.Params.js }} <script src="{{ . | absURL }}"></script> {{ end }}
<!-- jquery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>