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

amp-components.html « head « partials « layouts - github.com/asurbernardo/amperage.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a103c11cc9a7babc637a8ed5fdbdd2078d9f94ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{{- $ampCorePath := index (index $.Site.Data "amp-modules") "amp-core" -}}
<script async src="{{ $ampCorePath }}"></script>

{{- range $.Site.Params.ampElements -}}
    {{- if (index (index $.Site.Data "amp-modules") .) -}}
        <script async custom-element="{{ . }}" src="{{ (index (index $.Site.Data "amp-modules") .) }}"></script>
    {{- end }}
{{- end }}

{{ with .Params.amp.elements }}
    {{ range . }}
        {{ if in $.Site.Params.ampElements . }}
        {{ else }}
            {{- if (index (index $.Site.Data "amp-modules") .) -}}
                <script async custom-element="{{ . }}" src="{{ (index (index $.Site.Data "amp-modules") .) }}"></script>
            {{- end }}
        {{ end }}
    {{ end }}
{{ end }}
<script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.2.js"></script>

{{ with .Site.Params.AdsensePublisher }}
    {{ if eq $.Site.Params.AutoAdsEnabled true }}
        <script async custom-element="amp-auto-ads" src="https://cdn.ampproject.org/v0/amp-auto-ads-0.1.js"></script>
    {{ end }}
{{ end }}
{{ if .IsPage }}
    <script async custom-element="amp-next-page" src="https://cdn.ampproject.org/v0/amp-next-page-1.0.js"></script>
{{ end }}