Add another example and UAT

Signed-off-by: jolheiser <john.olheiser@gmail.com>
pull/1/head
jolheiser 2021-09-03 19:55:29 -05:00
parent e118ca3bd9
commit abcf07c673
Signed by: jolheiser
GPG Key ID: B853ADA5DA7BBF7A
6 changed files with 152 additions and 11 deletions

View File

@ -5,9 +5,21 @@ date = 2021-10-01
tags = ["test", "example"] 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 ```go
package main package main
@ -17,4 +29,31 @@ import "fmt"
func main() { func main() {
fmt.Println("Hello, blog!") 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';
``` ```

59
_example/test2.md 100644
View File

@ -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';
```

View File

@ -64,7 +64,7 @@ func (b *Blog) SortedPosts() []*Post {
posts = append(posts, post) posts = append(posts, post)
} }
sort.Slice(posts, func(i, j int) bool { 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 return posts
} }

View File

@ -3,17 +3,30 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Blog</title> <title>Blog</title>
<link rel="icon" href="data:,">
<link rel="stylesheet" href="sakura.css"/> <link rel="stylesheet" href="sakura.css"/>
<style>
.tag {
font-size: .7em;
}
.right {
float: right;
}
.title {
text-align: center;
font-size: 2.5em;
}
</style>
</head> </head>
<body> <body>
<h1>Blog Posts</h1> <h1 class="title">Blog Posts</h1>
{{range .Blog.Posts}} {{range .Blog.SortedPosts}}
<p> <h5>
<a href="{{.Slug}}"><strong>{{.Title}}</strong></a><br/> <a href="{{.Slug}}"><strong>{{.Title}}</strong></a><br/>
<small>@{{.Author}} - <i>{{.Date.Format "01/02/2006"}}</i></small> <small>@{{.Author}}</small><span class="right">{{.Date.Format "Jan 2, 2006"}}</span><br/>
</p> {{range .Tags}}<code class="tag">{{.}}</code> {{end}}
</h5>
<hr/> <hr/>
{{end}} {{end}}
</body> </body>
</html> </html>

View File

@ -2,10 +2,40 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>{{.Title}}</title> <title>{{.Post.Title}}</title>
<link rel="icon" href="data:,">
<link rel="stylesheet" href="sakura.css"/> <link rel="stylesheet" href="sakura.css"/>
</head> </head>
<body> <body>
{{.Content}} {{.Content}}
</body> </body>
<script>
document.addEventListener('DOMContentLoaded', () => {
for (let level = 1; level <= 4; level++) {
let elems = document.getElementsByTagName("h" + level);
for (let i = 0; i < elems.length; i++) {
let elem = elems[i];
if (elem.id !== "undefined" && elem.id !== "") {
let anchorId = elem.id + "-anchor";
elem.addEventListener("mouseover", () => {
document.getElementById(anchorId).style.display = "initial";
});
elem.addEventListener("mouseout", () => {
document.getElementById(anchorId).style.display = "none";
});
let space = document.createElement("span");
space.innerText = " ";
elem.appendChild(space)
let anchor = document.createElement("a");
anchor.id = anchorId;
anchor.href = "#" + elem.id;
anchor.innerHTML = "<small>&para;</small>";
anchor.style.display = "none";
elem.appendChild(anchor);
}
}
}
});
</script>
</html> </html>

View File

@ -31,7 +31,7 @@ html {
body { body {
font-size: 1.8rem; font-size: 1.8rem;
line-height: 1.618; line-height: 1.618;
max-width: 38em; max-width: 50%;
margin: auto; margin: auto;
color: var(--color-text); color: var(--color-text);
background-color: var(--color-bg); background-color: var(--color-bg);