diff options
author | Bjørn Erik Pedersen <[email protected]> | 2020-06-12 11:29:04 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2020-06-12 11:29:04 +0200 |
commit | 01e249e97ce9a3bc145f4372a032b9da3e123a62 (patch) | |
tree | b0afe4db42f18b5dbf52f6dc5f345add93badc53 | |
parent | 4b560cc1197ad07252fbb9a080c06f2f361c2b0e (diff) | |
download | hugo-01e249e97ce9a3bc145f4372a032b9da3e123a62.tar.gz hugo-01e249e97ce9a3bc145f4372a032b9da3e123a62.zip |
Regenerate templates
-rw-r--r-- | resources/page/page_marshaljson.autogen.go | 6 | ||||
-rw-r--r-- | tpl/tplimpl/embedded/templates.autogen.go | 72 |
2 files changed, 41 insertions, 37 deletions
diff --git a/resources/page/page_marshaljson.autogen.go b/resources/page/page_marshaljson.autogen.go index 47f385e8a..c01dceeaf 100644 --- a/resources/page/page_marshaljson.autogen.go +++ b/resources/page/page_marshaljson.autogen.go @@ -44,8 +44,8 @@ func MarshalPageToJSON(p Page) ([]byte, error) { length := p.Len() tableOfContents := p.TableOfContents() rawContent := p.RawContent() - mediaType := p.MediaType() resourceType := p.ResourceType() + mediaType := p.MediaType() permalink := p.Permalink() relPermalink := p.RelPermalink() name := p.Name() @@ -100,8 +100,8 @@ func MarshalPageToJSON(p Page) ([]byte, error) { Len int TableOfContents template.HTML RawContent string - MediaType media.Type ResourceType string + MediaType media.Type Permalink string RelPermalink string Name string @@ -155,8 +155,8 @@ func MarshalPageToJSON(p Page) ([]byte, error) { Len: length, TableOfContents: tableOfContents, RawContent: rawContent, - MediaType: mediaType, ResourceType: resourceType, + MediaType: mediaType, Permalink: permalink, RelPermalink: relPermalink, Name: name, diff --git a/tpl/tplimpl/embedded/templates.autogen.go b/tpl/tplimpl/embedded/templates.autogen.go index 70586ed33..cceb0667e 100644 --- a/tpl/tplimpl/embedded/templates.autogen.go +++ b/tpl/tplimpl/embedded/templates.autogen.go @@ -246,43 +246,47 @@ if (!doNotTrack) { {{- with .Site.Social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }} `}, {`pagination.html`, `{{ $pag := $.Paginator }} -{{ if gt $pag.TotalPages 1 }} +{{ if gt $pag.TotalPages 1 -}} <ul class="pagination"> - {{ with $pag.First }} - <li class="page-item"> - <a href="{{ .URL }}" class="page-link" aria-label="First"><span aria-hidden="true">««</span></a> - </li> - {{ end }} - <li class="page-item{{ if not $pag.HasPrev }} disabled{{ end }}"> + {{ with $pag.First -}} + <li class="page-item"> + <a href="{{ .URL }}" class="page-link" aria-label="First"><span aria-hidden="true">««</span></a> + </li> + {{ end -}} + <li class="page-item{{ if not $pag.HasPrev }} disabled{{ end }}"> <a {{ if $pag.HasPrev }}href="{{ $pag.Prev.URL }}"{{ end }} class="page-link" aria-label="Previous"><span aria-hidden="true">«</span></a> - </li> - {{ $ellipsed := false }} - {{ $shouldEllipse := false }} - {{ range $pag.Pagers }} - {{ $right := sub .TotalPages .PageNumber }} - {{ $showNumber := or (le .PageNumber 3) (eq $right 0) }} - {{ $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber 2)) (lt .PageNumber (add $pag.PageNumber 2))) }} - {{ if $showNumber }} - {{ $ellipsed = false }} - {{ $shouldEllipse = false }} - {{ else }} - {{ $shouldEllipse = not $ellipsed }} - {{ $ellipsed = true }} - {{ end }} - {{ if $showNumber }} - <li class="page-item{{ if eq . $pag }} active{{ end }}"><a class="page-link" href="{{ .URL }}">{{ .PageNumber }}</a></li> - {{ else if $shouldEllipse }} - <li class="page-item disabled"><span aria-hidden="true"> … </span></li> - {{ end }} - {{ end }} - <li class="page-item{{ if not $pag.HasNext }} disabled{{ end }}"> + </li> + {{- $ellipsed := false -}} + {{- $shouldEllipse := false -}} + {{- range $pag.Pagers -}} + {{- $right := sub .TotalPages .PageNumber -}} + {{- $showNumber := or (le .PageNumber 3) (eq $right 0) -}} + {{- $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber 2)) (lt .PageNumber (add $pag.PageNumber 2))) -}} + {{- if $showNumber -}} + {{- $ellipsed = false -}} + {{- $shouldEllipse = false -}} + {{- else -}} + {{- $shouldEllipse = not $ellipsed -}} + {{- $ellipsed = true -}} + {{- end -}} + {{- if $showNumber }} + <li class="page-item{{ if eq . $pag }} active{{ end }}"> + <a class="page-link" href="{{ .URL }}">{{ .PageNumber }}</a> + </li> + {{- else if $shouldEllipse }} + <li class="page-item disabled"> + <span aria-hidden="true"> … </span> + </li> + {{- end -}} + {{- end }} + <li class="page-item{{ if not $pag.HasNext }} disabled{{ end }}"> <a {{ if $pag.HasNext }}href="{{ $pag.Next.URL }}"{{ end }} class="page-link" aria-label="Next"><span aria-hidden="true">»</span></a> - </li> - {{ with $pag.Last }} - <li class="page-item"> - <a href="{{ .URL }}" class="page-link" aria-label="Last"><span aria-hidden="true">»»</span></a> - </li> - {{ end }} + </li> + {{- with $pag.Last }} + <li class="page-item"> + <a href="{{ .URL }}" class="page-link" aria-label="Last"><span aria-hidden="true">»»</span></a> + </li> + {{- end }} </ul> {{ end }} `}, |