aboutsummaryrefslogtreecommitdiff
path: root/cmd/site
diff options
context:
space:
mode:
authorChristine Dodrill <me@christine.website>2020-01-27 19:50:00 -0500
committerChristine Dodrill <me@christine.website>2020-01-27 19:50:00 -0500
commit7f3c903a7650b1951e363d9427685b160f5af68f (patch)
tree2f1d3907bb447b3ab7bd8f6ebf0fd67c362099c5 /cmd/site
parent216e8951a454ce22c950b07b35eaec09517cf0dd (diff)
downloadxesite-api.tar.xz
xesite-api.zip
Diffstat (limited to 'cmd/site')
-rw-r--r--cmd/site/api.go7
-rw-r--r--cmd/site/internal/blog/blog.go14
-rw-r--r--cmd/site/internal/date.go2
-rw-r--r--cmd/site/internal/date_test.go2
4 files changed, 16 insertions, 9 deletions
diff --git a/cmd/site/api.go b/cmd/site/api.go
new file mode 100644
index 0000000..9a5ad5d
--- /dev/null
+++ b/cmd/site/api.go
@@ -0,0 +1,7 @@
+package main
+
+import "net/http"
+
+func (s *Site) GetPost(w http.ResponseWriter, r *http.Request) {
+
+}
diff --git a/cmd/site/internal/blog/blog.go b/cmd/site/internal/blog/blog.go
index 0ea6fb2..2a63ce1 100644
--- a/cmd/site/internal/blog/blog.go
+++ b/cmd/site/internal/blog/blog.go
@@ -18,13 +18,13 @@ type Post struct {
Title string `json:"title"`
Link string `json:"link"`
Summary string `json:"summary,omitifempty"`
- Body string `json:"-"`
- BodyHTML template.HTML `json:"body"`
- Series string `json:"series"`
- Tags []string `json:"tags"`
- SlidesLink string `json:"slides_link"`
- ImageURL string `json:"image_url"`
- ThumbURL string `json:"thumb_url"`
+ Body string `json:"body_markdown"`
+ BodyHTML template.HTML `json:"body,omitempty"`
+ Series string `json:"series,omitempty"`
+ Tags []string `json:"tags,omitempty"`
+ SlidesLink string `json:"slides_link,omitempty"`
+ ImageURL string `json:"image_url,omitempty"`
+ ThumbURL string `json:"thumb_url,omitempty"`
Date time.Time
DateString string `json:"date"`
}
diff --git a/cmd/site/internal/date.go b/cmd/site/internal/date.go
index 960cdc2..cc81a1c 100644
--- a/cmd/site/internal/date.go
+++ b/cmd/site/internal/date.go
@@ -2,7 +2,7 @@ package internal
import "time"
-const iOS13DetriFormat = `2006 M1 2`
+const iOS13DetriFormat = `2006 M01 2`
// IOS13Detri formats a datestamp like iOS 13 does with the Lojban locale.
func IOS13Detri(t time.Time) string {
diff --git a/cmd/site/internal/date_test.go b/cmd/site/internal/date_test.go
index 60254f9..8706548 100644
--- a/cmd/site/internal/date_test.go
+++ b/cmd/site/internal/date_test.go
@@ -13,7 +13,7 @@ func TestIOS13Detri(t *testing.T) {
}{
{
in: time.Date(2019, time.March, 30, 0, 0, 0, 0, time.FixedZone("UTC", 0)),
- out: "2019 M3 30",
+ out: "2019 M03 30",
},
}