diff options
| author | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2022-03-27 18:44:06 +0530 |
|---|---|---|
| committer | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2022-03-27 18:44:06 +0530 |
| commit | 575cc0ca8c4e5904c7ae77e76db812c52e5f8ed1 (patch) | |
| tree | 29b83f765f6ccae88651886167681b4afdb71069 /layouts/_default/list.html | |
| parent | 975972e04181007c61302054d18735dc440a0586 (diff) | |
Use `site` function instead of `.Site` or `$.Site`
- The site function provides global access to the same data as the .Site page method.
- Current context (`.`) is never considered.
Diffstat (limited to 'layouts/_default/list.html')
| -rw-r--r-- | layouts/_default/list.html | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 0cc1ad9..f4ff6ec 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,6 +1,6 @@ {{- define "main" }} -{{- if (and .Site.Params.profileMode.enabled .IsHome) }} +{{- if (and site.Params.profileMode.enabled .IsHome) }} {{- partial "index_profile.html" . }} {{- else }} {{/* if not profileMode */}} @@ -32,7 +32,7 @@ {{- $paginator := .Paginate $pages }} -{{- if and .IsHome .Site.Params.homeInfoParams (eq $paginator.PageNumber 1) }} +{{- if and .IsHome site.Params.homeInfoParams (eq $paginator.PageNumber 1) }} {{- partial "home_info.html" . }} {{- end }} @@ -41,7 +41,7 @@ {{- $class := "post-entry" }} -{{- $user_preferred := or .Site.Params.disableSpecial1stPost .Site.Params.homeInfoParams }} +{{- $user_preferred := or site.Params.disableSpecial1stPost site.Params.homeInfoParams }} {{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) (not $user_preferred)) }} {{- $class = "first-entry" }} {{- else if $term }} @@ -49,7 +49,7 @@ {{- end }} <article class="{{ $class }}"> - {{- $isHidden := (.Site.Params.cover.hidden | default .Site.Params.cover.hiddenInList) }} + {{- $isHidden := (site.Params.cover.hidden | default site.Params.cover.hiddenInList) }} {{- partial "cover.html" (dict "cxt" . "IsHome" true "isHidden" $isHidden) }} <header class="entry-header"> <h2> |
