mirror of
https://github.com/loikein/hugo-tufte.git
synced 2024-12-23 13:59:44 +01:00
add paginator for home page; update social footers; change meta check logic
This commit is contained in:
parent
2423e3fc37
commit
2ce906cb31
3 changed files with 63 additions and 39 deletions
|
@ -7,7 +7,7 @@
|
|||
</section>
|
||||
{{ end }}
|
||||
<section class="page-list">
|
||||
{{ range .Site.RegularPages }}
|
||||
{{ range (.Paginate .Site.RegularPages).Pages }}
|
||||
{{/* range where .Site.RegularPages "Type" "posts" */}}
|
||||
{{ if ne .Draft true}}
|
||||
<h2 class="content-title">
|
||||
|
@ -16,11 +16,39 @@
|
|||
{{ else }}
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}{{ if .Draft }} :: Draft {{end}}</a>
|
||||
{{ end }}
|
||||
</h1>
|
||||
</h2>
|
||||
|
||||
{{ if .Description }}
|
||||
<p>{{ .Description }}</p>
|
||||
{{ else }}
|
||||
<p>{{ truncate 140 .Summary }}</p>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</section>
|
||||
|
||||
{{ if and (.Paginator) (gt .Paginator.TotalPages 1) }}
|
||||
<hr />
|
||||
|
||||
<span class="previous-page">
|
||||
{{ if .Paginator.HasPrev }}
|
||||
<a class="link-reverse" href="{{.Paginator.Prev.URL}}">«</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
|
||||
<span class="pagination-indicator">
|
||||
{{.Paginator.PageNumber}} / {{.Paginator.TotalPages}}
|
||||
</span>
|
||||
|
||||
<span class="next-page">
|
||||
{{ if .Paginator.HasNext }}
|
||||
<a class="link-reverse" href="{{.Paginator.Next.URL}}">»</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{ partial "footer.html" . }}
|
||||
</article>
|
||||
{{ end }}
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
<section>
|
||||
<h1 class="content-title">
|
||||
{{- if .IsNode -}}
|
||||
{{- .Title -}}
|
||||
{{- else -}}
|
||||
{{- .Title -}}{{- if .Draft -}} :: Draft {{- end -}}
|
||||
{{- end -}}
|
||||
</h1>
|
||||
|
||||
{{- if .IsPage -}}
|
||||
|
@ -12,7 +8,7 @@
|
|||
<p class=subtitle>{{ .Params.subtitle }}</p>
|
||||
{{- end -}}
|
||||
|
||||
{{- if or (eq .Type "post") (.Params.meta) -}}
|
||||
{{- if .Params.meta -}}
|
||||
<span class="content-meta">
|
||||
{{- if .Params.author -}}
|
||||
<p class="author">{{ .Params.author }}</p>
|
||||
|
|
|
@ -16,51 +16,51 @@
|
|||
<ul class="page-footer-menu">
|
||||
{{/* SOCIALS */}}
|
||||
{{ if isset .Site.Params "twitter" }}
|
||||
<li><a href="https://twitter.com/{{.Site.Params.twitter}}"><i class='fab fa-twitter fa-lg'></i></a></li>
|
||||
<li><a href="https://twitter.com/{{.Site.Params.twitter}}">Twitter</a></li>
|
||||
{{ end }}
|
||||
|
||||
{{ if isset .Site.Params "github" }}
|
||||
<li><a href="https://github.com/{{.Site.Params.github}}"><i class='fab fa-github fa-lg'></i></a></li>
|
||||
<li><a href="https://github.com/{{.Site.Params.github}}">GitHub</a></li>
|
||||
{{ end }}
|
||||
|
||||
{{ if isset .Site.Params "gitlab" }}
|
||||
<li><a href="https://gitlab.com/{{.Site.Params.gitlab}}"><i class='fab fa-gitlab fa-lg'></i></a></li>
|
||||
<li><a href="https://gitlab.com/{{.Site.Params.gitlab}}">GitLab</a></li>
|
||||
{{ end }}
|
||||
|
||||
{{ if isset .Site.Params "patreon" }}
|
||||
<li><a href="https://www.patreon.com/{{.Site.Params.patreon}}"><i class='fab fa-patreon la-lg'></i></a></li>
|
||||
<li><a href="https://www.patreon.com/{{.Site.Params.patreon}}">Patreon</i></a></li>
|
||||
{{ end }}
|
||||
|
||||
{{ if isset .Site.Params "youtube" }}
|
||||
<li><a href="https://www.youtube.com/{{.Site.Params.youtube}}"><i class='fab fa-youtube la-lg'></i></a></li>
|
||||
<li><a href="https://www.youtube.com/{{.Site.Params.youtube}}">YouTube</a></li>
|
||||
{{ end }}
|
||||
|
||||
{{ if isset .Site.Params "medium" }}
|
||||
<li><a href="https://medium.com/{{.Site.Params.medium}}"><i class='fab fa-medium la-lg'></i></a></li>
|
||||
<li><a href="https://medium.com/{{.Site.Params.medium}}">Medium</a></li>
|
||||
{{ end }}
|
||||
|
||||
{{ if isset .Site.Params "reddit" }}
|
||||
<li><a href="https://www.reddit.com/user/{{.Site.Params.reddit}}"><i class='fab fa-reddit la-lg'></i></a></li>
|
||||
<li><a href="https://www.reddit.com/user/{{.Site.Params.reddit}}">Reddit</a></li>
|
||||
{{ end }}
|
||||
|
||||
{{ if isset .Site.Params "stackoverflow" }}
|
||||
<li><a href="https://stackoverflow.com/users/{{.Site.Params.stackoverflow}}?tab=profile"><i class='fab fa-stack-overflow la-lg'></i></a></li>
|
||||
<li><a href="https://stackoverflow.com/users/{{.Site.Params.stackoverflow}}?tab=profile">StackOverflow</a></li>
|
||||
{{ end }}
|
||||
|
||||
{{ if isset .Site.Params "instagram" }}
|
||||
<li><a href="https://www.instagram.com/{{.Site.Params.instagram}}"><i class='fab fa-instagram la-lg'></i></a></li>
|
||||
<li><a href="https://www.instagram.com/{{.Site.Params.instagram}}">Instagram</a></li>
|
||||
{{ end }}
|
||||
|
||||
{{ if isset .Site.Params "mastodon" }}
|
||||
<li><a href="https://{{.Site.Params.mastodon}}"><i class='fab fa-mastodon la-lg'></i></a></li>
|
||||
<li><a href="https://{{.Site.Params.mastodon}}">Mastodon</a></li>
|
||||
{{ end }}
|
||||
|
||||
{{ if isset .Site.Params "orcid" }}
|
||||
<li><a href="https://orcid.org/{{.Site.Params.orcid}}"><i class='fab fa-orcid la-lg'></i></a></li>
|
||||
<li><a href="https://orcid.org/{{.Site.Params.orcid}}">ORCID</a></li>
|
||||
{{ end }}
|
||||
|
||||
{{ if isset .Site.Params "google_scholar" }}
|
||||
<li><a href="https://scholar.google.com/citations?user={{.Site.Params.google_scholar}}"><i class='fas fa-graduation-cap la-lg'></i></a></li>
|
||||
<li><a href="https://scholar.google.com/citations?user={{.Site.Params.google_scholar}}">Google Scholar</a></li>
|
||||
{{ end }}
|
||||
{{/* END SOCIALS */}}
|
||||
{{ range .Site.Menus.footer }}
|
||||
|
|
Loading…
Reference in a new issue