Move the rest of the _default templates from the theme
This commit is contained in:
parent
512c8ec2da
commit
8c4dd830b9
3 changed files with 123 additions and 0 deletions
40
layouts/_default/index.html
Normal file
40
layouts/_default/index.html
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{{ define "main" }}
|
||||
|
||||
<!-- Main Title -->
|
||||
{{ if .Title }}
|
||||
<h1 class="main-title">{{ .Title }}</h1>
|
||||
{{ end }}
|
||||
|
||||
<section id="homepage-content">
|
||||
{{ .Content }}
|
||||
</section>
|
||||
|
||||
<!-- $pages -->
|
||||
{{ $pages := union .RegularPages .Sections }}
|
||||
<!---->{{ if .IsHome }} {{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Articles -->
|
||||
<section id="homepage-articles">
|
||||
<h2>Recent Posts</h2>
|
||||
<ul>
|
||||
{{ $paginator := .Paginate $pages }}
|
||||
{{ range $index, $page := $paginator.Pages }}
|
||||
<li><a href="{{ .Permalink }}">{{ .Title }}</a> — <time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date | time.Format ":date_medium" }}</time></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<!-- Main Nav -->
|
||||
{{ if gt $paginator.TotalPages 1 }}
|
||||
<nav class="main-nav">
|
||||
{{ if $paginator.HasPrev }}
|
||||
<a class="prev" href="{{ $paginator.Prev.URL }}">← {{ i18n "prev_page" }}</a>
|
||||
{{ end }}<!---->
|
||||
{{ if $paginator.HasNext }}
|
||||
<a class="next" href="{{ $paginator.Next.URL }}">{{ i18n "next_page" }} →</a>
|
||||
{{ end }}
|
||||
</nav>
|
||||
{{ end }}<!---->
|
||||
|
||||
{{ end }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue