Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ For example, with static/css/custom.css and static/js/custom.js, add to `config.
[params]
custom_css = ["css/custom.css"]
custom_js = ["js/custom.js"]
# custom script with defer attribute
defer_custom_js = ["js/defer_custom.js"]
```

## config.toml example
Expand Down
3 changes: 3 additions & 0 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
{{ range .Site.Params.custom_js -}}
<script type="text/javascript" src="{{ . | absURL }}"></script>
{{- end }}
{{ range .Site.Params.defer_custom_js -}}
<script defer type="text/javascript" src="{{ . | absURL }}"></script>
{{- end }}

<!-- Extended head section-->
{{ partial "extended_head.html" . }}
Expand Down