working on the blog listing page. Almost finished. Needs a few tweaks.
[theme-danix.xyz.git] / layouts / articles / list.html
1 {{ define "blog-list" }}
2 <section id="one">
3 <article>
4 <div class="inner">
5 {{ .Content }}
6 </div>
7 </article>
8 </section>
9 <section id="two" class="spotlights">
10 <!-- Ranges through content/posts/*.md -->
11 {{ range .Pages }}
12 <section>
13 <a class="image" href="{{.Permalink}}">
14 <img src="{{ "bg/bg2.jpg" | absURL}}" alt="suca">
15 </a>
16 <div class="content">
17 <div class="inner">
18 <header class="major">
19 <h3>
20 {{ if gt (len .Title) 40 }}
21 {{ $first50 := ( substr .Title 0 40 ) }}
22 {{ $lastChars := ( substr .Title 40 ) }}
23 {{ $newLine := "<br>" }}
24 {{ $newTitle := ( printf "%s" $lastChars | printf "%s%s" $newLine | printf "%s%s" $first50 ) }}
25 {{ $newTitle | safeHTML }}
26 {{ else }}
27 {{ .Title }}
28 {{ end }}
29 </h3>
30 </header>
31 <p>here goes an abstract</p>
32 <ul class="actions">
33 <li><a href="{{.Permalink}}" class="button">Read More</a></li>
34 </ul>
35 </div>
36 </div>
37 </section>
38 {{ end }}
39 </section>
40 {{ end }}