mirror of
https://gitlab.com/Cian-H/my_blog.git
synced 2025-12-22 22:31:58 +00:00
Updated front page to include recent posts
This commit is contained in:
54
layouts/index.html
Normal file
54
layouts/index.html
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="{{ .Site.LanguageCode }}">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>
|
||||||
|
{{ i18n "home" }} | {{ .Site.Params.author.name }}
|
||||||
|
</title>
|
||||||
|
|
||||||
|
{{ partial "head.html" . }}
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="flexWrapper">
|
||||||
|
{{ partial "header.html" . }}
|
||||||
|
|
||||||
|
<div class="content vertical" style="justify-content: space-evenly">
|
||||||
|
<main class="main">
|
||||||
|
<div class="indexWrapper">
|
||||||
|
{{ if .Site.Params.author.avatarFirst }}
|
||||||
|
{{ partial "avatar.html" . }}
|
||||||
|
{{ end }}
|
||||||
|
<div>
|
||||||
|
<h1 class="indexHeader">{{ .Site.Params.author.name }}</h1>
|
||||||
|
</div>
|
||||||
|
{{ if not .Site.Params.author.avatarFirst }}
|
||||||
|
{{ partial "avatar.html" . }}
|
||||||
|
{{ end }}
|
||||||
|
{{ if isset .Site.Params "social" }}
|
||||||
|
{{ partial "social.html" . }}
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<div class="recent-posts">
|
||||||
|
<h2>Recent Posts</h2>
|
||||||
|
<ul>
|
||||||
|
{{ range first 5 (where .Site.RegularPages "Section" "posts") }}
|
||||||
|
<li>
|
||||||
|
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||||
|
<span class="date">{{ .Date.Format "January 2, 2006" }}</span>
|
||||||
|
</li>
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{{ partial "footer.html" . }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
9
layouts/partials/avatar.html
Normal file
9
layouts/partials/avatar.html
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{{ if .Site.Params.author.avatar }}
|
||||||
|
<div class="authorImageWrapper">
|
||||||
|
<img
|
||||||
|
src="{{ .Site.Params.author.avatar }}"
|
||||||
|
alt="{{ .Site.Params.author.name }}"
|
||||||
|
class="{{ .Site.Params.author.avatarSize | default "size-m" }}"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
Reference in New Issue
Block a user