mirror of
				https://github.com/Wonderfall/hugo-WonderMod.git
				synced 2025-10-31 03:45:24 +01:00 
			
		
		
		
	simplify code
This commit is contained in:
		| @@ -1,25 +1,21 @@ | ||||
| {{- partial "header.html" . }} | ||||
|  | ||||
| {{- $scope := . }} | ||||
| {{- if .IsHome }} | ||||
| {{- $scope = .Site }} | ||||
| {{- else }} | ||||
| <header class="page-header"> | ||||
|   <h1>{{ if .Data.Term }}{{ .Data.Term }}{{ else }}Tags{{ end }}</h1> | ||||
| </header> | ||||
| {{- end }} | ||||
| {{- $scope := .Site }} | ||||
| {{- if .Title }} | ||||
| <header class="page-header"><h1>{{ .Title }}</h1></header>{{ $scope = . }} | ||||
| {{ end }} | ||||
|  | ||||
| {{- $paginator := .Paginate (where $scope.RegularPages ".Params.type" "!=" "page") }} | ||||
|  | ||||
| {{- range $index, $page := $paginator.Pages }} | ||||
|  | ||||
| {{- $entryClass := "post-entry" }} | ||||
| {{- $class := "post-entry" }} | ||||
| {{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0)) }} | ||||
| {{- $entryClass = "first-entry" }} | ||||
| {{- $class = "first-entry" }} | ||||
| {{- else if .Data.Term }} | ||||
| {{- $entryClass = "post-entry tag-entry" }} | ||||
| {{- $class = "post-entry tag-entry" }} | ||||
| {{- end }} | ||||
| <article class="{{ $entryClass }}"> | ||||
| <article class="{{ $class }}"> | ||||
|   <header class="entry-header"> | ||||
|     <h2>{{ .Title }}</h2> | ||||
|   </header> | ||||
|   | ||||
| @@ -5,14 +5,7 @@ | ||||
|     <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||||
|     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||||
|     <!-- Title --> | ||||
|     <title> | ||||
|       {{- if not .IsHome }} | ||||
|       {{- if eq .Kind "page" }}{{ .Title }}{{ else if .Data.Term }}{{ .Data.Term }}{{ else }}Tags{{ end }} | ||||
|       {{- print " - " }} | ||||
|       {{- end }} | ||||
|  | ||||
|       {{- .Site.Title -}} | ||||
|     </title> | ||||
|     <title>{{ if .Title }}{{ .Title }} - {{ end }}{{ .Site.Title }}</title> | ||||
|     <!-- Meta --> | ||||
|     {{- if eq .Kind "page" }} | ||||
|     <meta name="description" content="{{ .Summary }}"> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 nanxiaobei
					nanxiaobei