blob: 10c5e28fe88791b4114501ae65a520ce093294e1 (
plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
{{ define "main" }}
<section id="about">
{{ if isset .Site.Params "description" }}
{{ .Site.Params.description | $.Page.RenderString }}
{{ end }}
{{ if isset .Site.Params "social" }}
<p>Find me on
{{ $length := (len .Site.Params.social) }}
{{ range $index, $elem := .Site.Params.social}}
{{ if eq $elem.name "email" }}
<a class="icon" target="_blank" rel="noopener" href="mailto:{{ $elem.link }}" aria-label="Email">
<i class="fas fa-envelope" aria-hidden="true"></i>
</a>
{{ else if eq $elem.name "rss" }}
<a class="icon" target="_blank" rel="noopener" href="{{ $elem.link }}" aria-label="RSS">
<i class="fas fa-rss" aria-hidden="true"></i>
</a>
{{ else if eq $elem.name "scholar" }}
<a class="icon" target="_blank" rel="noopener" href="{{ $elem.link }}" aria-label="Google Scholar">
<i class="fas fa-graduation-cap" aria-hidden="true"></i>
</a>
{{ else }}
<a class="icon" target="_blank" rel="noopener" href="{{ $elem.link }}" aria-label="{{ $elem.name }}">
<i class="fab fa-{{ lower $elem.name }}" aria-hidden="true"></i>
</a>
{{ end }}
{{ if (lt (add $index 2) $length) }}
{{- print " , " -}}
{{ else if (lt (add $index 1) $length) }}
{{- print " and " -}}
{{ else }}
{{- print "." -}}
{{ end }}
{{ end }}
</p>
{{ end }}
{{ partial "optional-about.html" . }}
</section>
<section id="writing">
<span class="h1"><a href="{{ .Site.Params.mainSection | absURL }}">{{ .Site.Params.mainSectionTitle | default "Writings" }}</a></span>
{{ if (and (and (isset .Site.Params "tagsoverview") (eq .Site.Params.tagsOverview true)) (gt (len .Site.Taxonomies.tags) 0)) }}
<span class="h2">Topics</span>
<span class="widget tagcloud">
{{ $AllRegularPagesCount := len .Site.RegularPages }}
{{ range $elem := .Site.Taxonomies.tags.Alphabetical }}
<a style="font-size: {{ (add 0.5 (mul 5 (div (float $elem.Count) $AllRegularPagesCount))) }}rem;" href="{{ $elem.Page.Permalink }}">
{{- .Page.Title -}}
</a>
{{ end }}
</span>
<span class="h2">Most recent</span>
{{ end }}
{{ $showAllPostsOnHomePage := false }}
{{ if (isset .Site.Params "showallpostsonhomepage") }}
{{ $showAllPostsOnHomePage = .Site.Params.ShowAllPostsOnHomePage }}
{{ end }}
{{ $dataFormat := .Site.Params.dateFormat | default "2006-01-02" }}
{{ $mainPosts := (sort ( where site.RegularPages "Type" "in" site.Params.mainSections ) "Date" "desc") }}
{{ if $showAllPostsOnHomePage }}
<ul class="post-list">
{{ range (.Paginate $mainPosts).Pages }}
<li class="post-item">
<div class="meta"><time datetime="{{ time .Date }}" itemprop="datePublished">{{ .Date.Format $dataFormat }}</time></div>
<span><a href="{{ .Permalink }}">{{ if .Title }} {{- .Title -}} {{ else }} {{- print "Untitled" -}}{{ end }}</a></span>
</li>
{{ end }}
</ul>
{{ partial "pagination.html" . }}
{{ else }}
<ul class="post-list">
{{ .Scratch.Set "count" 5 }}
{{ if isset .Site.Params "postsonhomepage" }}
{{ .Scratch.Set "count" .Site.Params.postsOnHomePage }}
{{ end }}
{{ range (first (.Scratch.Get "count") $mainPosts) }}
<li class="post-item">
<div class="meta"><time datetime="{{ time .Date }}" itemprop="datePublished">{{ .Date.Format $dataFormat }}</time></div>
<span><a href="{{ .Permalink }}">{{ if .Title }} {{- .Title -}} {{ else }} {{- print "Untitled" -}}{{ end }}</a></span>
</li>
{{ end }}
</ul>
{{ end }}
</section>
{{ $showProjectsList := false }}
{{ if (isset .Site.Params "showprojectslist") }}
{{ $showProjectsList = .Site.Params.showProjectsList }}
{{ else if .Site.Data.projects }}
{{ $showProjectsList = true }}
{{ end }}
{{ if $showProjectsList }}
{{ $projectsUrl := "#" }}
{{ if isset .Site.Params "projectsurl" }}
{{ $projectsUrl = .Site.Params.projectsUrl }}
{{ end }}
<section id="projects">
<span class="h1"><a href="{{ $projectsUrl }}">Projects</a></span>
<ul class="project-list">
{{ range .Site.Data.projects.list }}
<li class="project-item">
<a href="{{ .url }}">{{ .name }}</a>: {{ .desc | markdownify }}
</li>
{{ end }}
</ul>
</section>
{{ end }}
{{ end }}
|