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