Skip to content

Commit bf6f245

Browse files
authored
Merge pull request #14 from ArkhamCookie/blog
blog section
2 parents f647e14 + a8a75d0 commit bf6f245

3 files changed

Lines changed: 41 additions & 4 deletions

File tree

content/blog/_index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
+++
2+
title = 'Blog'
3+
date = 2023-01-01T08:00:00-07:00
4+
draft = false
5+
layout = 'blog-home'
6+
+++

layouts/blog-home.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{{ define "main" }}
2+
{{ $p := where site.RegularPages "Type" "posts" }}
3+
4+
<a href="{{ site.BaseURL }}">go back...</a>
5+
6+
<header>
7+
<h1>{{ site.Title }}</h1>
8+
</header>
9+
10+
<ul>
11+
{{ range $p }}
12+
<li>
13+
<span class="home-date">
14+
{{ .Date | time.Format ":date_short" }}»
15+
</span>
16+
<a href="{{ .Permalink }}">
17+
{{ .Title }}
18+
</a>
19+
</li>
20+
{{- end }}
21+
</ul>
22+
{{ end }}

layouts/page.html

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
{{ define "main" }}
2+
{{ $dateHuman := .Date | time.Format ":date_long" }}
3+
4+
<a href="{{ site.BaseURL }}">go back...</a>
5+
26
<h1 class="post-title">{{ .Title }}</h1>
37

4-
{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }}
5-
{{ $dateHuman := .Date | time.Format ":date_long" }}
6-
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
8+
<p class="post-date text-bold">
9+
{{ .Page.Param "author" }}
10+
/
11+
{{ .Date | time.Format ":date_long" }}
12+
</p>
13+
14+
{{ range $i, $e := .Param "tags" }}
15+
<span class="tag">{{ $e }}</span>
16+
{{ end }}
717

818
{{ .Content }}
9-
{{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
1019
{{ end }}

0 commit comments

Comments
 (0)