mirror of
				https://github.com/Wonderfall/hugo-WonderMod.git
				synced 2025-10-30 19:35:26 +01:00 
			
		
		
		
	handle case where home-info was hidden
when num of posts = 0
- fix: #227
- refactor conditions for nested if
- also fix for 082d960
			
			
This commit is contained in:
		| @@ -16,6 +16,10 @@ | |||||||
| </header> | </header> | ||||||
| {{- end }} | {{- end }} | ||||||
|  |  | ||||||
|  | {{- if and .IsHome .Site.Params.homeInfoParams (eq .Paginator.PageNumber 1) }} | ||||||
|  | {{- partial "home_info.html" . }} | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
| {{- $pages := union .RegularPages .Sections }} | {{- $pages := union .RegularPages .Sections }} | ||||||
|  |  | ||||||
| {{- if .IsHome }} | {{- if .IsHome }} | ||||||
| @@ -27,15 +31,14 @@ | |||||||
| {{- range $index, $page := $paginator.Pages }} | {{- range $index, $page := $paginator.Pages }} | ||||||
|  |  | ||||||
| {{- $class := "post-entry" }} | {{- $class := "post-entry" }} | ||||||
| {{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0)) }} |  | ||||||
| {{- if .Site.Params.homeInfoParams | or .Site.Params.disableSpecial1stPost}} | {{- $user_preferred := or .Site.Params.disableSpecial1stPost .Site.Params.homeInfoParams }} | ||||||
| {{- partial "home_info.html" . }} | {{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) (not $user_preferred)) }} | ||||||
| {{- else}} |  | ||||||
| {{- $class = "first-entry" }} | {{- $class = "first-entry" }} | ||||||
| {{- end }} |  | ||||||
| {{- else if $term }} | {{- else if $term }} | ||||||
| {{- $class = "post-entry tag-entry" }} | {{- $class = "post-entry tag-entry" }} | ||||||
| {{- end }} | {{- end }} | ||||||
|  |  | ||||||
| <article class="{{ $class }}"> | <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) }} |   {{- partial "cover.html" (dict "cxt" . "IsHome" true "isHidden" $isHidden) }} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Aditya Telange
					Aditya Telange