mirror of
https://github.com/idanoo/m2.nz
synced 2025-07-03 13:52:13 +00:00
Update Theme
This commit is contained in:
parent
a212477863
commit
d47be661bd
212 changed files with 13069 additions and 8406 deletions
|
@ -1,9 +1,9 @@
|
|||
{{- $rel := "" -}}
|
||||
<a href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if (urls.Parse .Destination).Host | or .Newtab }}{{ $rel = "noopener noreffer" }} target="_blank"{{ end }} rel="{{ $rel }}{{ with .Rel }} {{ . }}{{ end }}"{{ with .Class }} class="{{ . }}"{{ end }}>
|
||||
<a href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if (urls.Parse .Destination).Host | or .Newtab }}{{ $rel = "noopener noreffer " }} target="_blank"{{ end }} rel="{{ $rel }}{{ with .Rel }}{{ . }}{{ end }}"{{ with .Class }} class="{{ . }}"{{ end }}>
|
||||
{{- with .Icon -}}
|
||||
{{- partial "plugin/icon.html" . -}}
|
||||
{{- end -}}
|
||||
{{- with .Content -}}
|
||||
{{- . | safeHTML -}}
|
||||
{{- end -}}
|
||||
</a>
|
||||
</a>
|
|
@ -19,4 +19,25 @@
|
|||
</script>
|
||||
{{- dict "Source" ($analytics.fathom.server | default "cdn.usefathom.com" | printf "https://%v/tracker.js") "Async" true "Attr" "id=fathom-script" | partial "plugin/script.html" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Plausible Analytics */ -}}
|
||||
{{- with $analytics.plausible.dataDomain -}}
|
||||
{{- dict "Source" "https://plausible.io/js/plausible.js" "Async" true "Defer" true "Attr" ($analytics.plausible.dataDomain | printf `data-domain="%v"`) | partial "plugin/script.html" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Yandex Metrica */ -}}
|
||||
{{- with $analytics.yandexMetrica.id -}}
|
||||
<script type="text/javascript" >
|
||||
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
||||
m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
|
||||
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
|
||||
|
||||
ym({{ . }}, "init", {
|
||||
clickmap:true,
|
||||
trackLinks:true,
|
||||
accurateTrackBounce:true
|
||||
});
|
||||
</script>
|
||||
<noscript><div><img src="https://mc.yandex.ru/watch/{{ . }}" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
15
themes/LoveIt/layouts/partials/plugin/h-card.html
Normal file
15
themes/LoveIt/layouts/partials/plugin/h-card.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
{{- $rel := .Rel -}}
|
||||
{{- $nick := .Nickname -}}
|
||||
{{- $text := .Text -}}
|
||||
{{- $n := .Nickname | default .Name | default .Email | default .URL | default "👀" -}}
|
||||
<span class="h-card{{ with .Class }} {{ . }}{{- end -}}">
|
||||
{{- with .URL -}}<a href="{{ . }}" class="u-url url"{{ with $rel }} rel="{{ . }}"{{- end -}}{{ with $text }} title="{{ . }}"{{ end }}>{{- else -}}{{- with .Email -}}<a href="mailto:{{ . }}" class="email"{{ with $text }} title="{{ . }}"{{ end }}>{{- end -}}{{- end -}}
|
||||
{{- with .Image -}}<img class="u-photo photo" src="{{ . }}" alt="{{ $n }}">{{- else -}}<i class="far fa-user-circle" aria-hidden="true"></i>{{ end -}} 
|
||||
{{- with .Name -}}<span class="p-name fn">{{ . }}</span>{{ with $nick }} ({{- end -}}{{- end -}}
|
||||
{{- with .Nickname -}}<span class="p-nickname nickname">{{ . }}</span>{{- end -}}
|
||||
{{- with .Name -}}{{ with $nick }}){{- end -}}{{- end -}}
|
||||
{{- with .URL -}}</a>{{- else -}}{{- with .Email -}}</a>{{- end -}}{{- end -}}
|
||||
{{- with .Email }}
|
||||
<a href="mailto:{{ . }}" class="email"><span class="u-email">{{ . }}</span></a>
|
||||
{{- end -}}
|
||||
</span>
|
|
@ -1,7 +1,11 @@
|
|||
{{- /* lazysizes and lightgallery.js */ -}}
|
||||
{{- /* lazysizes and lightgallery */ -}}
|
||||
{{- $src := .Src -}}
|
||||
{{- with dict "Path" .Src "Resources" .Resources | partial "function/resource.html" -}}
|
||||
{{- $width := .Width -}}
|
||||
{{- $height := .Height -}}
|
||||
{{- with dict "Path" $src "Resources" .Resources | partial "function/resource.html" -}}
|
||||
{{- $src = .RelPermalink -}}
|
||||
{{- $width = $width | default .Width -}}
|
||||
{{- $height = $height | default .Height -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $small := .SrcSmall | default $src -}}
|
||||
|
@ -21,18 +25,22 @@
|
|||
<img
|
||||
class="lazyload{{ with .Class }} {{ . }}{{ end }}"
|
||||
src="{{ $loading.RelPermalink }}"
|
||||
data-src="{{ .Src | safeURL }}"
|
||||
data-srcset="{{ $small | safeURL }}, {{ .Src | safeURL }} 1.5x, {{ $large | safeURL }} 2x"
|
||||
data-src="{{ $src | safeURL }}"
|
||||
data-srcset="{{ $small | safeURL }}, {{ $src | safeURL }} 1.5x, {{ $large | safeURL }} 2x"
|
||||
data-sizes="auto"
|
||||
alt="{{ $alt }}"{{ with .Height }} height="{{ . }}"{{ end }}{{ with .Width }} width="{{ . }}"{{ end }} />
|
||||
alt="{{ $alt }}"
|
||||
{{- with $width }} width="{{ . }}"{{ end }}
|
||||
{{- with $height }} height="{{ . }}"{{ end }} />
|
||||
</a>
|
||||
{{- else -}}
|
||||
<img
|
||||
class="lazyload{{ with .Class }} {{ . }}{{ end }}"
|
||||
src="{{ $loading.RelPermalink }}"
|
||||
data-src="{{ .Src | safeURL }}"
|
||||
data-srcset="{{ $small | safeURL }}, {{ .Src | safeURL }} 1.5x, {{ $large | safeURL }} 2x"
|
||||
data-src="{{ $src | safeURL }}"
|
||||
data-srcset="{{ $small | safeURL }}, {{ $src | safeURL }} 1.5x, {{ $large | safeURL }} 2x"
|
||||
data-sizes="auto"
|
||||
alt="{{ $alt }}"
|
||||
title="{{ .Title | default $alt }}"{{ with .Height }} height="{{ . }}"{{ end }}{{ with .Width }} width="{{ . }}"{{ end }} />
|
||||
title="{{ .Title | default $alt }}"
|
||||
{{- with $width }} width="{{ . }}"{{ end }}
|
||||
{{- with $height }} height="{{ . }}"{{ end }} />
|
||||
{{- end -}}
|
|
@ -1,25 +1,41 @@
|
|||
{{- if .Content -}}
|
||||
<script type="text/javascript">
|
||||
{{- .Content | safeJS -}}
|
||||
</script>
|
||||
{{- else if strings.HasPrefix .Source "<script" -}}
|
||||
{{- safeHTML .Source -}}
|
||||
{{- with .Content -}}
|
||||
<script type="text/javascript">{{ . | safeJS }}</script>
|
||||
{{- else -}}
|
||||
{{- $src := .Source -}}
|
||||
{{- $integrity := .Integrity -}}
|
||||
{{- if (urls.Parse $src).Host | not -}}
|
||||
{{- $resource := resources.Get $src -}}
|
||||
{{- with .Template -}}
|
||||
{{- $resource = $resource | resources.ExecuteAsTemplate . $.Context -}}
|
||||
{{- if strings.HasPrefix .Source "<script" -}}
|
||||
{{- safeHTML .Source -}}
|
||||
{{- else -}}
|
||||
{{- $src := .Source -}}
|
||||
{{- $integrity := .Integrity -}}
|
||||
{{- if (urls.Parse $src).Host | not -}}
|
||||
{{- $resource := resources.Get $src -}}
|
||||
{{- with .Template -}}
|
||||
{{- $resource = $resource | resources.ExecuteAsTemplate . $.Context -}}
|
||||
{{- end -}}
|
||||
{{- if .Minify -}}
|
||||
{{- $resource = $resource | minify -}}
|
||||
{{- end -}}
|
||||
{{- with .Fingerprint -}}
|
||||
{{- $resource = $resource | fingerprint . -}}
|
||||
{{- $integrity = $resource.Data.Integrity -}}
|
||||
{{- end -}}
|
||||
{{- $src = $resource.RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- if .Minify -}}
|
||||
{{- $resource = $resource | minify -}}
|
||||
{{- $attrs := printf `src="%v"` $src -}}
|
||||
{{- if .Crossorigin -}}
|
||||
{{- $attrs = ` crossorigin="anonymous"` | add $attrs -}}
|
||||
{{- end -}}
|
||||
{{- with .Fingerprint -}}
|
||||
{{- $resource = $resource | fingerprint . -}}
|
||||
{{- $integrity = $resource.Data.Integrity -}}
|
||||
{{- with $integrity -}}
|
||||
{{- $attrs = printf ` integrity="%v"` . | add $attrs -}}
|
||||
{{- end -}}
|
||||
{{- $src = $resource.RelPermalink -}}
|
||||
{{- if .Async -}}
|
||||
{{- $attrs = " async" | add $attrs -}}
|
||||
{{- end -}}
|
||||
{{- if .Defer -}}
|
||||
{{- $attrs = " defer" | add $attrs -}}
|
||||
{{- end -}}
|
||||
{{- with .Attr -}}
|
||||
{{- $attrs = add " " . | add $attrs -}}
|
||||
{{- end -}}
|
||||
<script type="text/javascript" {{ $attrs | safeHTMLAttr }}></script>
|
||||
{{- end -}}
|
||||
<script type="text/javascript" src="{{ $src }}"{{ if .Crossorigin }} crossorigin="anonymous"{{ end }}{{ with $integrity }} integrity="{{ . }}"{{ end }}{{ if .Async }} async{{ end }}{{ if .Defer }} defer{{ end }}{{ with .Attr }} {{ . | safeHTMLAttr }}{{ end }}></script>
|
||||
{{- end -}}
|
||||
|
|
|
@ -8,4 +8,8 @@
|
|||
{{- end -}}
|
||||
{{- $destination = printf (string $template) .Id -}}
|
||||
{{- end -}}
|
||||
{{- dict "Destination" $destination "Rel" "me" | merge . | partial "plugin/link.html" -}}
|
||||
{{- $rel := "me" -}}
|
||||
{{- with .Rel -}}
|
||||
{{- $rel = printf "%v %v" $rel . -}}
|
||||
{{- end -}}
|
||||
{{- dict "Destination" $destination "Rel" $rel | merge . | partial "plugin/a.html" -}}
|
||||
|
|
|
@ -27,5 +27,20 @@
|
|||
{{- end -}}
|
||||
{{- $href = $resource.RelPermalink -}}
|
||||
{{- end -}}
|
||||
<link rel="stylesheet" href="{{ $href }}"{{ if .Crossorigin }} crossorigin="anonymous"{{ end }}{{ with $integrity }} integrity="{{ . }}"{{ end }}{{ with .Attr }} {{ . | safeHTMLAttr }}{{ end }}>
|
||||
{{- $attrs := printf `href="%v"` $href -}}
|
||||
{{- if .Crossorigin -}}
|
||||
{{- $attrs = ` crossorigin="anonymous"` | add $attrs -}}
|
||||
{{- end -}}
|
||||
{{- with $integrity -}}
|
||||
{{- $attrs = printf ` integrity="%v"` . | add $attrs -}}
|
||||
{{- end -}}
|
||||
{{- with .Attr -}}
|
||||
{{- $attrs = add " " . | add $attrs -}}
|
||||
{{- end -}}
|
||||
{{- if .Preload -}}
|
||||
<link rel="preload" {{ $attrs | safeHTMLAttr }} as="style" onload="this.onload=null;this.rel='stylesheet'">
|
||||
<noscript><link rel="stylesheet" {{ $attrs | safeHTMLAttr }}></noscript>
|
||||
{{- else -}}
|
||||
<link rel="stylesheet" {{ $attrs | safeHTMLAttr }}>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue