Update page handling
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
{{ partial "components/image/index.html" (dict "page" .Page "image" (dict
|
{{ partial "components/image/index.html" (dict
|
||||||
"src" .Destination
|
"src" .Destination
|
||||||
"caption" .Text
|
"caption" .Text
|
||||||
"alt" .Title
|
"alt" .Title
|
||||||
))
|
)
|
||||||
}}
|
}}
|
||||||
{{- /* chomp trailing newline */ -}}
|
{{- /* chomp trailing newline */ -}}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<section class="hero">
|
<section class="hero">
|
||||||
<h1 class="title">{{ .Title }}</h1>
|
<h1 class="title">{{ .Title }}</h1>
|
||||||
{{ partial "components/meta/index.html" . }}
|
{{ partial "components/meta/index.html" . }}
|
||||||
{{ partial "components/image/index.html" (dict "page" .Page "image" .Params.hero) }}
|
{{ partial "components/image/index.html" .Params.hero }}
|
||||||
</section>
|
</section>
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
{{- $page := .page -}}
|
{{- $image := . -}}
|
||||||
{{- $image := .image -}}
|
|
||||||
|
|
||||||
{{- $src := $image -}}
|
{{- $src := $image -}}
|
||||||
{{- $caption := "" -}}
|
{{- $caption := "" -}}
|
||||||
@@ -20,7 +19,7 @@
|
|||||||
{{- $remote := resources.GetRemote $src -}}
|
{{- $remote := resources.GetRemote $src -}}
|
||||||
{{- $image = resources.Copy (printf "static/3rd-party/%s" $remote.Name) $remote -}}
|
{{- $image = resources.Copy (printf "static/3rd-party/%s" $remote.Name) $remote -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $image = ($page.Resources.Get $src) | default (resources.Get $src) -}}
|
{{- $image = (.Page.Resources.Get $src) | default (resources.Get $src) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
@@ -2,12 +2,11 @@
|
|||||||
<div class="grid-sizer"></div>
|
<div class="grid-sizer"></div>
|
||||||
{{ range sort .Pages "Date" "desc" }}
|
{{ range sort .Pages "Date" "desc" }}
|
||||||
{{ if not .Params.private }}
|
{{ if not .Params.private }}
|
||||||
{{ $page := . }}
|
|
||||||
{{ $imageData := partial "components/image/reflect.html" .Params.hero }}
|
{{ $imageData := partial "components/image/reflect.html" .Params.hero }}
|
||||||
{{ with $imageData.image }}
|
{{ with $imageData.image }}
|
||||||
<div class="image grid-item">
|
<div class="image grid-item">
|
||||||
<a
|
<a
|
||||||
href="{{- $page.RelPermalink -}}"
|
href="{{- .Page.RelPermalink -}}"
|
||||||
data-pswp-src="{{- .RelPermalink -}}"
|
data-pswp-src="{{- .RelPermalink -}}"
|
||||||
data-pswp-width="{{- .Width -}}"
|
data-pswp-width="{{- .Width -}}"
|
||||||
data-pswp-height="{{- .Height -}}"
|
data-pswp-height="{{- .Height -}}"
|
||||||
@@ -24,11 +23,11 @@
|
|||||||
</a>
|
</a>
|
||||||
<div class="pswp-caption-content">
|
<div class="pswp-caption-content">
|
||||||
<div>
|
<div>
|
||||||
{{ upper $page.Title }}
|
{{ upper .Page.Title }}
|
||||||
<div class="meta">
|
<div class="meta">
|
||||||
{{ $page.Date | time.Format ":date_medium" }}
|
{{ .Page.Date | time.Format ":date_medium" }}
|
||||||
·
|
·
|
||||||
<a href="{{- $page.RelPermalink -}}">View Post</a>
|
<a href="{{- .Page.RelPermalink -}}">View Post</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user