mirror of
https://github.com/Vimux/Binario.git
synced 2024-11-21 21:58:28 +00:00
Rename context variable: "dot" -> "page"
Unified a variable name to pass context across layouts partials
This commit is contained in:
parent
5a51cb05c4
commit
77b9fc1ec7
3 changed files with 5 additions and 5 deletions
|
@ -3,7 +3,7 @@
|
||||||
<div class="single block">
|
<div class="single block">
|
||||||
<article class="post">
|
<article class="post">
|
||||||
{{- partial "post_featured.html" (dict "page" . "IsSingle" true) }}
|
{{- partial "post_featured.html" (dict "page" . "IsSingle" true) }}
|
||||||
{{- partial "post_meta.html" (dict "dot" . "class" "mb") }}
|
{{- partial "post_meta.html" (dict "page" . "class" "mb") }}
|
||||||
<h1 class="post__title">{{ .Title }}</h1>
|
<h1 class="post__title">{{ .Title }}</h1>
|
||||||
{{- partial "post_toc.html" . }}
|
{{- partial "post_toc.html" . }}
|
||||||
<div class="post__content">{{ .Content }}</div>
|
<div class="post__content">{{ .Content }}</div>
|
||||||
|
|
|
@ -4,5 +4,5 @@
|
||||||
{{- with .Summary }}
|
{{- with .Summary }}
|
||||||
<div class="post__content">{{ . }}</div>
|
<div class="post__content">{{ . }}</div>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- partial "post_meta.html" (dict "dot" . "class" "mt tar") }}
|
{{- partial "post_meta.html" (dict "page" . "class" "mt tar") }}
|
||||||
</article>
|
</article>
|
|
@ -1,7 +1,7 @@
|
||||||
{{ $currentPage := .dot }}
|
{{ $currentPage := .page }}
|
||||||
{{- if .dot.Param "post_meta" }}
|
{{- if .page.Param "post_meta" }}
|
||||||
<div class="post__meta meta {{ .class }}">
|
<div class="post__meta meta {{ .class }}">
|
||||||
{{- range $metaField := .dot.Param "post_meta" -}}
|
{{- range $metaField := .page.Param "post_meta" -}}
|
||||||
{{- $metaFieldPath := printf "post_meta/%s.html" $metaField -}}
|
{{- $metaFieldPath := printf "post_meta/%s.html" $metaField -}}
|
||||||
{{- partial $metaFieldPath $currentPage -}}
|
{{- partial $metaFieldPath $currentPage -}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Reference in a new issue