feat: add introduction
This commit is contained in:
38
layouts/index.html
Normal file
38
layouts/index.html
Normal file
@@ -0,0 +1,38 @@
|
||||
{{ define "main" }}
|
||||
<section>
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ .Content }}
|
||||
</section>
|
||||
|
||||
{{ $posts := sort (where .Site.RegularPages "Type" "posts") "Date" "desc" }}
|
||||
{{ if gt (len $posts) 0 }}
|
||||
<hr>
|
||||
|
||||
<section>
|
||||
<h2>Latest Posts</h2>
|
||||
|
||||
{{ $paginator := .Paginate $posts 5 }}
|
||||
<ul>
|
||||
{{ range $paginator.Pages }}
|
||||
<li>
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
<small>({{ .Date.Format "Jan 2, 2006" }})</small>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
||||
<!-- Pagination controls -->
|
||||
{{ if or $paginator.HasPrev $paginator.HasNext }}
|
||||
<nav class="pagination">
|
||||
{{ if $paginator.HasPrev }}
|
||||
<a href="{{ $paginator.Prev.URL }}">← Newer</a>
|
||||
{{ end }}
|
||||
{{ if $paginator.HasNext }}
|
||||
<a href="{{ $paginator.Next.URL }}">Older →</a>
|
||||
{{ end }}
|
||||
</nav>
|
||||
{{ end }}
|
||||
</section>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
23
layouts/partials/footer.html
Normal file
23
layouts/partials/footer.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<footer class="footer">
|
||||
<div class="footer__inner">
|
||||
{{ if $.Site.Copyright }}
|
||||
<div class="copyright copyright--user">
|
||||
<span>{{ $.Site.Copyright | safeHTML }}</span>
|
||||
{{ else }}
|
||||
<div class="copyright">
|
||||
<span>© {{ now.Year }} Powered by <a href="https://gohugo.io">Hugo</a></span>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
{{ $menu := resources.Get "js/menu.js" | js.Build }}
|
||||
{{ $cp := resources.Get "js/code.js" | js.Build }}
|
||||
|
||||
{{ $bundle := slice $menu $cp | resources.Concat "bundle.js" | resources.Minify }}
|
||||
|
||||
<script type="text/javascript" src="{{ $bundle.RelPermalink }}"></script>
|
||||
|
||||
<!-- Extended footer section-->
|
||||
{{ partial "extended_footer.html" . }}
|
||||
|
||||
Reference in New Issue
Block a user