mirror of
https://git.adityakumar.xyz/hugo-theme-introduction.git
synced 2024-12-22 14:42:54 +00:00
Allow for Custom JavaScript files (#233)
This commit is contained in:
parent
ecb89b781b
commit
b7ecf0c08c
3 changed files with 12 additions and 1 deletions
|
@ -184,7 +184,11 @@ Set `disqusshortname` in `config.toml` to activate Hugo's [internal Disqus templ
|
|||
|
||||
## Custom CSS
|
||||
|
||||
You can add custom CSS files by placing them under `assets/` and adding the path to the file to `customCSS` in `config.toml`.
|
||||
You can add custom CSS files by placing them under `assets/` and adding the paths to the files to the `customCSS` list in `config.toml`.
|
||||
|
||||
## Custom JavaScript
|
||||
|
||||
You can add custom JavaScript files by placing them under `assets/` and adding the paths to the files to the `customJS` list in `config.toml`.
|
||||
|
||||
## Issues
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ DefaultContentLanguage = "en" # Default language fo
|
|||
dateFormat = "Jan 2, 2006"
|
||||
email = "youremail@email.com" # E-mail address for contact section
|
||||
# customCSS = ["foo.css"] # Include custom css files placed under assets/
|
||||
# customJS = ["foo.js"] # Include custom JavaScript files placed under assets/
|
||||
|
||||
# Configure the home page
|
||||
[params.home]
|
||||
|
|
|
@ -4,3 +4,9 @@
|
|||
<script src="{{ $scripts.Permalink }}" integrity="{{ $scripts.Data.Integrity }}"></script>
|
||||
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
|
||||
<!-- Custom JavaScript -->
|
||||
{{ range .Site.Params.customJS -}}
|
||||
{{ $script := resources.Get . | minify }}
|
||||
<script src="{{ $script.Permalink }}" integrity="{{ $script.Data.Integrity }}"></script>
|
||||
{{- end }}
|
||||
|
|
Loading…
Reference in a new issue