-
-
Notifications
You must be signed in to change notification settings - Fork 164
/
index.html
41 lines (37 loc) · 1.49 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
{{- $defaultColor := .Site.Params.defaultColor | default "auto" -}}
{{/* allow website developer to enforce default dark mode */}}
{{- if eq $defaultColor "dark" -}}
<html lang="{{ .Site.LanguageCode }}" class="dark">
{{- else if eq $defaultColor "light" -}}
<html lang="{{ .Site.LanguageCode }}" class="light">
{{- else -}}
<html lang="{{ .Site.LanguageCode }}">
{{- end -}}
{{- partial "head.html" . -}}
<body data-theme="{{ $defaultColor }}" class="notransition">
{{- partial "scriptsBodyStart.html" . -}}
{{- partial "header.html" . -}}
<div class="wrapper">
{{ partial "bio" . }}
<main aria-label="Content">
<h3 class="posts-item-note" aria-label="Recent Posts">{{ T "home.recent_posts" }}</h3>
{{/* Show last 5 posts in reverse date order */}}
{{ $pagesToShow := where .Site.RegularPages "Type" "in" site.Params.mainSections }}
{{ $posts := $pagesToShow.ByDate.Reverse }}
{{ range first 5 $posts }}
{{ partial "postCard" . }}
{{ end }}
{{ if gt (len $posts) 5 }}
<p>
{{ range $firstSection := (where .Site.Sections "Section" "in" (first 1 (.Site.Params.mainSections))) }}
<a href="{{ $firstSection.Permalink }}">{{ T "home.see_all_posts" }}</a>
{{ end }}
</p>
{{ end }}
</main>
</div>
{{- partial "footer.html" . -}}
{{- partial "scriptsBodyEnd.html" . -}}
</body>
</html>