~taavi/taavi.wtf

62d7c2e891bcbb880c5b9ad1d97d7be93c43d2bb — Taavi Väänänen 4 months ago 9877f68
add latest blog archive to front page
M content/_index.md => content/_index.md +3 -0
@@ 25,6 25,9 @@ some older projects are still on [GitHub].

[GitHub]: https://github.com/supertassu/

## Blog
{{< latest-blog >}}

## Contact me

The best way to talk to me is via IRC, I'm `taavi` on [libera.chat].

M themes/castor/layouts/_default/list.html => themes/castor/layouts/_default/list.html +1 -8
@@ 9,14 9,7 @@
    <div>
        <ul>
            {{ range .Pages }}
            {{ if not .Params.hidden }}
            <li>
                {{ if ne (.PublishDate.Format "2006-01-02") "0001-01-01" }}
                <span class="article-meta">[{{ .PublishDate.Format "2006-01-02" }}]</span>
                {{ end }}
                <a href="{{ .Permalink }}">{{ .Title }}</a>
            </li>
            {{ end }}
            {{ partial "list-entry.html" . }}
            {{ end }}
        </ul>
    </div>

A themes/castor/layouts/partials/list-entry.html => themes/castor/layouts/partials/list-entry.html +8 -0
@@ 0,0 1,8 @@
{{ if not .Params.hidden }}
<li>
	{{ if ne (.PublishDate.Format "2006-01-02") "0001-01-01" }}
	<span class="article-meta">[{{ .PublishDate.Format "2006-01-02" }}]</span>
	{{ end }}
	<a href="{{ .Permalink }}">{{ .Title }}</a>
</li>
{{ end }}

A themes/castor/layouts/shortcodes/latest-blog.html => themes/castor/layouts/shortcodes/latest-blog.html +15 -0
@@ 0,0 1,15 @@
{{ range first 1 (where site.Sections "Title" "Blog") }}
<p>
	My latest blog posts are:
</p>
<div>
	<ul>
		{{ range first 3 .Pages }}
		{{ partial "list-entry.html" . }}
		{{ end }}
	</ul>
</div>
<p>
	See also the <a href="/posts/">full blog archive</a>, including RSS feeds.
</p>
{{ end }}