feat: add introduction

This commit is contained in:
2025-10-21 16:36:22 +05:30
parent a462613e43
commit ff8b6587f8
4 changed files with 104 additions and 0 deletions

38
layouts/index.html Normal file
View 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 }}

View 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" . }}