From abcf07c673afaa665807372cd05ca81bb1b7e8c6 Mon Sep 17 00:00:00 2001
From: jolheiser
Date: Fri, 3 Sep 2021 19:55:29 -0500
Subject: [PATCH] Add another example and UAT
Signed-off-by: jolheiser
---
_example/test.md | 43 ++++++++++++++++++++++++++++++++--
_example/test2.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++
post/post.go | 2 +-
static/index.tmpl | 25 +++++++++++++++-----
static/post.tmpl | 32 ++++++++++++++++++++++++-
static/sakura.css | 2 +-
6 files changed, 152 insertions(+), 11 deletions(-)
create mode 100644 _example/test2.md
diff --git a/_example/test.md b/_example/test.md
index a377fcf..d4197e0 100644
--- a/_example/test.md
+++ b/_example/test.md
@@ -5,9 +5,21 @@ date = 2021-10-01
tags = ["test", "example"]
---
-# Testing
+# H1
+## H2
+### H3
+#### H4
+##### H5
+###### H6
-This is a test
+This is a test, and all the ways I learned to test.
+
+* Foo
+* Bar
+ * Baz
+* Banana
+
+[Link Home](/)
```go
package main
@@ -17,4 +29,31 @@ import "fmt"
func main() {
fmt.Println("Hello, blog!")
}
+```
+
+Some **more** text!
+
+```go
+package main
+
+import "fmt"
+
+func main() {
+ fmt.Println("Hello,", "blog!")
+}
+```
+
+## Okay, moving on
+
+_This_ time ~~we~~ I am going to **test** some emphasis.
+
+```sql
+SELECT
+ username,
+ age,
+ email
+FROM
+ users
+WHERE
+ email = 'john.olheiser@gmail.com';
```
\ No newline at end of file
diff --git a/_example/test2.md b/_example/test2.md
new file mode 100644
index 0000000..a459b2b
--- /dev/null
+++ b/_example/test2.md
@@ -0,0 +1,59 @@
+---
+title = "Testing"
+author = "jolheiser"
+date = 2021-08-19
+tags = ["foo", "bar"]
+---
+
+# H1
+## H2
+### H3
+#### H4
+##### H5
+###### H6
+
+This is a test, and all the ways I learned to test.
+
+* Foo
+* Bar
+ * Baz
+* Banana
+
+[Link Home](/)
+
+```go
+package main
+
+import "fmt"
+
+func main() {
+ fmt.Println("Hello, blog!")
+}
+```
+
+Some **more** text!
+
+```go
+package main
+
+import "fmt"
+
+func main() {
+ fmt.Println("Hello,", "blog!")
+}
+```
+
+## Okay, moving on
+
+_This_ time ~~we~~ I am going to **test** some emphasis.
+
+```sql
+SELECT
+ username,
+ age,
+ email
+FROM
+ users
+WHERE
+ email = 'john.olheiser@gmail.com';
+```
\ No newline at end of file
diff --git a/post/post.go b/post/post.go
index ca2c16a..797fca6 100644
--- a/post/post.go
+++ b/post/post.go
@@ -64,7 +64,7 @@ func (b *Blog) SortedPosts() []*Post {
posts = append(posts, post)
}
sort.Slice(posts, func(i, j int) bool {
- return posts[i].Date.Before(posts[j].Date)
+ return posts[i].Date.After(posts[j].Date)
})
return posts
}
diff --git a/static/index.tmpl b/static/index.tmpl
index b3593ef..ed4e484 100644
--- a/static/index.tmpl
+++ b/static/index.tmpl
@@ -3,17 +3,30 @@
Blog
+
+
- Blog Posts
- {{range .Blog.Posts}}
-
+
Blog Posts
+ {{range .Blog.SortedPosts}}
+
{{.Title}}
- @{{.Author}} - {{.Date.Format "01/02/2006"}}
-
+ @{{.Author}}{{.Date.Format "Jan 2, 2006"}}
+ {{range .Tags}}{{.}}
{{end}}
+
-
{{end}}