Regenerate templates

This commit is contained in:
Bjørn Erik Pedersen 2020-06-12 11:29:04 +02:00
parent 4b560cc119
commit 01e249e97c
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
2 changed files with 41 additions and 37 deletions

View file

@ -44,8 +44,8 @@ func MarshalPageToJSON(p Page) ([]byte, error) {
length := p.Len() length := p.Len()
tableOfContents := p.TableOfContents() tableOfContents := p.TableOfContents()
rawContent := p.RawContent() rawContent := p.RawContent()
mediaType := p.MediaType()
resourceType := p.ResourceType() resourceType := p.ResourceType()
mediaType := p.MediaType()
permalink := p.Permalink() permalink := p.Permalink()
relPermalink := p.RelPermalink() relPermalink := p.RelPermalink()
name := p.Name() name := p.Name()
@ -100,8 +100,8 @@ func MarshalPageToJSON(p Page) ([]byte, error) {
Len int Len int
TableOfContents template.HTML TableOfContents template.HTML
RawContent string RawContent string
MediaType media.Type
ResourceType string ResourceType string
MediaType media.Type
Permalink string Permalink string
RelPermalink string RelPermalink string
Name string Name string
@ -155,8 +155,8 @@ func MarshalPageToJSON(p Page) ([]byte, error) {
Len: length, Len: length,
TableOfContents: tableOfContents, TableOfContents: tableOfContents,
RawContent: rawContent, RawContent: rawContent,
MediaType: mediaType,
ResourceType: resourceType, ResourceType: resourceType,
MediaType: mediaType,
Permalink: permalink, Permalink: permalink,
RelPermalink: relPermalink, RelPermalink: relPermalink,
Name: name, Name: name,

View file

@ -246,43 +246,47 @@ if (!doNotTrack) {
{{- with .Site.Social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }} {{- with .Site.Social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }}
`}, `},
{`pagination.html`, `{{ $pag := $.Paginator }} {`pagination.html`, `{{ $pag := $.Paginator }}
{{ if gt $pag.TotalPages 1 }} {{ if gt $pag.TotalPages 1 -}}
<ul class="pagination"> <ul class="pagination">
{{ with $pag.First }} {{ with $pag.First -}}
<li class="page-item"> <li class="page-item">
<a href="{{ .URL }}" class="page-link" aria-label="First"><span aria-hidden="true">&laquo;&laquo;</span></a> <a href="{{ .URL }}" class="page-link" aria-label="First"><span aria-hidden="true">&laquo;&laquo;</span></a>
</li> </li>
{{ end }} {{ end -}}
<li class="page-item{{ if not $pag.HasPrev }} disabled{{ 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">&laquo;</span></a> <a {{ if $pag.HasPrev }}href="{{ $pag.Prev.URL }}"{{ end }} class="page-link" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a>
</li> </li>
{{ $ellipsed := false }} {{- $ellipsed := false -}}
{{ $shouldEllipse := false }} {{- $shouldEllipse := false -}}
{{ range $pag.Pagers }} {{- range $pag.Pagers -}}
{{ $right := sub .TotalPages .PageNumber }} {{- $right := sub .TotalPages .PageNumber -}}
{{ $showNumber := or (le .PageNumber 3) (eq $right 0) }} {{- $showNumber := or (le .PageNumber 3) (eq $right 0) -}}
{{ $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber 2)) (lt .PageNumber (add $pag.PageNumber 2))) }} {{- $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber 2)) (lt .PageNumber (add $pag.PageNumber 2))) -}}
{{ if $showNumber }} {{- if $showNumber -}}
{{ $ellipsed = false }} {{- $ellipsed = false -}}
{{ $shouldEllipse = false }} {{- $shouldEllipse = false -}}
{{ else }} {{- else -}}
{{ $shouldEllipse = not $ellipsed }} {{- $shouldEllipse = not $ellipsed -}}
{{ $ellipsed = true }} {{- $ellipsed = true -}}
{{ end }} {{- end -}}
{{ if $showNumber }} {{- if $showNumber }}
<li class="page-item{{ if eq . $pag }} active{{ end }}"><a class="page-link" href="{{ .URL }}">{{ .PageNumber }}</a></li> <li class="page-item{{ if eq . $pag }} active{{ end }}">
{{ else if $shouldEllipse }} <a class="page-link" href="{{ .URL }}">{{ .PageNumber }}</a>
<li class="page-item disabled"><span aria-hidden="true">&nbsp;&hellip;&nbsp;</span></li> </li>
{{ end }} {{- else if $shouldEllipse }}
{{ end }} <li class="page-item disabled">
<li class="page-item{{ if not $pag.HasNext }} disabled{{ end }}"> <span aria-hidden="true">&nbsp;&hellip;&nbsp;</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">&raquo;</span></a> <a {{ if $pag.HasNext }}href="{{ $pag.Next.URL }}"{{ end }} class="page-link" aria-label="Next"><span aria-hidden="true">&raquo;</span></a>
</li> </li>
{{ with $pag.Last }} {{- with $pag.Last }}
<li class="page-item"> <li class="page-item">
<a href="{{ .URL }}" class="page-link" aria-label="Last"><span aria-hidden="true">&raquo;&raquo;</span></a> <a href="{{ .URL }}" class="page-link" aria-label="Last"><span aria-hidden="true">&raquo;&raquo;</span></a>
</li> </li>
{{ end }} {{- end }}
</ul> </ul>
{{ end }} {{ end }}
`}, `},