Make home page sections dynamic and configurable (#14)
* Make home page sections dynamic and configurable * Fix navbar issue when no section is configured + fix next-prev navigator * Update exampleSite * Fix next-prev navigator * Make navbar brand URL context aware
This commit is contained in:
parent
8f99f05a98
commit
e2d376215a
32 changed files with 455 additions and 363 deletions
35
layouts/partials/next-prev-navigator.html
Normal file
35
layouts/partials/next-prev-navigator.html
Normal file
|
@ -0,0 +1,35 @@
|
|||
<div class="row next-prev-navigator">
|
||||
{{ $currentPage := . }}
|
||||
{{ range (where site.RegularPages.ByDate "Type" "in" site.Params.mainSections )}}
|
||||
{{ if eq .RelPermalink $currentPage.RelPermalink }}
|
||||
{{ if .Next }}
|
||||
{{ if (in site.Params.mainSections .Next.Type) }}
|
||||
<div class="col-md-6 previous-article">
|
||||
<a href="{{.Next.RelPermalink}}" class="btn btn-outline-info">
|
||||
<span><i class="fas fa-chevron-circle-left"></i> Prev</span>
|
||||
<br />
|
||||
<span>{{ .Next.Title }}</span>
|
||||
</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if .Prev }}
|
||||
{{ if (in site.Params.mainSections .Prev.Type) }}
|
||||
{{ $columnWidth:="col-md-12" }}
|
||||
{{ if .Next }}
|
||||
{{ if (in site.Params.mainSections .Next.Type) }}
|
||||
{{ $columnWidth = "col-md-6" }}
|
||||
{{ end }}
|
||||
{{ end}}
|
||||
<div class="{{ $columnWidth }} next-article">
|
||||
<a href="{{ .Prev.RelPermalink }}" class="btn btn-outline-info">
|
||||
<span>Next <i class="fas fa-chevron-circle-right"></i></span>
|
||||
<br />
|
||||
<span>{{ .Prev.Title }}</span>
|
||||
</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue