asset.html 562 Bytes
Newer Older
Kaushal Modi's avatar
Kaushal Modi committed
1
<!-- https://gist.github.com/carlmjohnson/e3716a0a89fab0484d0552a750c8cfb7 -->
2 3 4 5 6
{{- $ast := .asset -}}
{{- with $.Site.Data.assets -}}
    {{- if $.Site.Params.cache_busting -}}
        {{- if in (string $.Site.BaseURL) "localhost" -}}
            {{- $ast | relURL -}}
7
        {{- else -}}
8
            {{- (index . $ast) | relURL -}}
9
        {{- end -}}
10 11
    {{- else if $.Site.Params.cache_busting_debug -}}
        {{- (index . $ast) | relURL -}}
12
    {{- else -}}
13
        {{- $ast | relURL -}}
14
    {{- end -}}
Kaushal Modi's avatar
Kaushal Modi committed
15
{{- else -}}
16
    {{- $ast | relURL -}}
Kaushal Modi's avatar
Kaushal Modi committed
17
{{- end -}}