blob: e8fbf9e86f39ad38b5743c00c461e56b3111b631 (
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
112
113
114
115
116
117
118
|
<!-- Sidebar -->
<section id="sidebar">
<!-- Intro -->
<section id="intro">
{{ $pic := .Site.Params.intro.pic }}
{{ with $pic.src }}
{{ if $pic.circle }}
<img src="{{ . }}" class="intro-circle" width="{{ $pic.width }}" alt="{{ $pic.alt }}" />
{{ else if $pic.imperfect }}
<a href="/" class="logo"><img src="{{ . }}" alt="{{ $pic.alt }}" /></a>
{{ else }}
<img src="{{ . }}" width="{{ $pic.width }}" alt="{{ $pic.alt }}" />
{{ end }}
{{ end }}
<header>
<h2>{{ .Site.Params.intro.header }}</h2>
<p>{{ .Site.Params.intro.paragraph | safeHTML }}</p>
</header>
{{ if .Site.Params.socialAppearAtTop }}
<ul class="icons">
{{ partial "social" . }}
</ul>
{{ end }}
</section>
<!-- Posts List -->
<section id="recent-posts">
<ul class="posts">
<header>
<h3>Recent Posts</h3>
</header>
{{ with .Site.Params.postAmount.sidebar }}
{{ $.Scratch.Set "postLimit" . }}
{{ else }}
{{ $.Scratch.Set "postLimit" 5 }}
{{ end }}
{{ range first ($.Scratch.Get "postLimit") (where .Site.Pages "Type" "post") }}
<li>
<article>
<header>
<h3><a href="{{ .Permalink }}">{{ .Title }}</a></h3>
<time class="published" datetime='{{ .Date.Format "2006-01-02" }}'>
{{ .Date.Format "January 2, 2006" }}</time>
</header>
</article>
</li>
{{ end }}
{{ if ge (len (where .Site.Pages "Type" "post")) ($.Scratch.Get "postLimit") }}
<li>
<ul class="actions">
<li><a href=
{{ with .Site.Params.viewMorePostLink }}
{{ . }}
{{ else }}
"/post"
{{ end }}
class="button">View more posts</a></li>
</ul>
</li>
{{ end }}
</ul>
</section>
<!-- This if statement only applies if someone goes to the /categories url -->
<!-- Otherwise this section is shown for all other links -->
{{ if ne ($.Scratch.Get "showCategories") false }}
<!-- Categories List -->
<section id="categories">
<ul class="posts">
<header>
<h3><a href="/categories">Categories</a></h3>
</header>
{{ if .Site.Params.categoriesByCount }}
{{ $.Scratch.Set "categories" .Site.Taxonomies.categories.ByCount }}
{{ else }}
{{ $.Scratch.Set "categories" .Site.Taxonomies.categories.Alphabetical }}
{{ end }}
{{ range $key, $value := $.Scratch.Get "categories" }}
<li>
<article>
<header>
<a href="/categories/{{ $value.Name | urlize }}">{{ $value.Name }}</a>
<span style="float:right;">{{ $value.Count }}</span>
</header>
</article>
</li>
{{ end }}
</ul>
</section>
{{ end }}
<!-- About -->
<section class="blurb">
<h2>About</h2>
<p>Mauris neque quam, fermentum ut nisl vitae, convallis maximus nisl. Sed mattis nunc id lorem euismod amet placerat. Vivamus porttitor magna enim, ac accumsan tortor cursus at phasellus sed ultricies.</p>
<ul class="actions">
<li><a href="/about" class="button">Learn More</a></li>
</ul>
</section>
<!-- Footer -->
<section id="footer">
{{ if .Site.Params.socialAppearAtBottom }}
<ul class="icons">
{{ partial "social" . }}
</ul>
{{ end }}
<p class="copyright">© Untitled. Design: <a href="http://html5up.net">HTML5 UP</a>. Images: <a href="http://unsplash.com">Unsplash</a>.</p>
</section>
</section>
|