all repos — website-hugo @ b0f912eadb633b7290b1731d2943cf67224bd967

My personal blog, built with Hugo!

add latest articles to home
Marco Andronaco andronacomarco@gmail.com
Wed, 18 Jan 2023 11:56:12 +0100
commit

b0f912eadb633b7290b1731d2943cf67224bd967

parent

502dadd70e099adbafdb3ecd8e1fde1244c2fab4

2 files changed, 17 insertions(+), 12 deletions(-)

jump to
M content/articles/ggvg01.mdcontent/articles/ggvg01.md

@@ -1,7 +1,7 @@

--- title: "GGVG01 - Fran Bow" date: 2022-02-09T11:29:15Z -tags: [gaming] +tags: [gaming, advice] --- ![Fran bow](/ggvg01/a.png)
M layouts/home/index.htmllayouts/home/index.html

@@ -1,21 +1,26 @@

{{ define "main" }} <main> <article> - <header> + <div class="title"> <h1>{{.Title}}</h1> - </header> - <!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md --> - {{.Content}} + </div> + <section class="body"> + {{ .Content }} + </section> </article> - <!-- + <h2>Latest articles</h2> <ul> - Ranges through content/posts/*.md - {{ range ( where .Site.RegularPages "Type" "posts" ) }} - <li> - <a href="{{.Permalink}}">{{.Date.Format "2006-01-02"}} | {{.Title}}</a> - </li> + {{ range first 3 ( where .Site.RegularPages "Type" "articles" ) }} + <li class="post"> + <span class="meta">{{ dateFormat "2006-01-02" .Date }}</span> + <a href="{{ .RelPermalink }}">{{.Title}}</a> + <span class="meta"> + {{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }} + {{ range (.GetTerms "tags") }}[<a href="{{ .Permalink }}" class="tag">{{ .LinkTitle }}</a>] {{ end }} + </span> + </li> {{ end }} </ul> - --> + </main> {{ end }}