Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Simplify code.
  • Loading branch information
XhmikosR committed Jul 19, 2019
1 parent e94460f commit 3eb6371
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions site/layouts/_default/examples.html
Expand Up @@ -42,18 +42,16 @@
<body{{ with .Page.Params.body_class }} class="{{ . }}"{{ end }}>
{{ .Content }}

{{ if ne .Page.Params.include_js false }}
{{ if eq (getenv "HUGO_ENV") "production" }}
{{ if ne .Page.Params.include_js false -}}
{{- if eq (getenv "HUGO_ENV") "production" -}}
<script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.min.js" integrity="{{ .Site.Params.cdn.js_bundle_hash }}" crossorigin="anonymous"></script>
{{ else }}
{{- else -}}
<script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.js"></script>
{{ end }}

{{ range .Page.Params.extra_js }}
{{ $integrity := .integrity }}
{{ $async := .async }}
<script src="{{ .src }}"{{ with $integrity }} integrity="{{ $integrity }}"{{ end }}{{ with $async }} async{{ end }} crossorigin="anonymous"></script>
{{- end }}
{{ end }}

{{ range .Page.Params.extra_js -}}
<script{{ with .async }} async{{ end }} src="{{ .src }}"{{ with .integrity }} integrity="{{ . }}"{{ end }} crossorigin="anonymous"></script>
{{- end -}}
{{- end }}
</body>
</html>

0 comments on commit 3eb6371

Please sign in to comment.