added content to blog posts, forgot about that somehow ...

This commit is contained in:
rawleyIfowler
2022-02-23 17:03:48 -06:00
parent 2ebe41eb86
commit c5ccbec4c7
2 changed files with 4 additions and 1 deletions

View File

@@ -25,5 +25,6 @@ type BlogPost struct {
Url string `json:"url" gorm:"primaryKey"`
Title string `json:"title"`
Date string `json:"date"`
Content string `json:"content"`
Comments []Comment `gorm:"foreignKey:Id"`
}

View File

@@ -1,5 +1,7 @@
{{ template "header.tmpl" . }}
<div>
<h3>{{ .Title }}</h3>
<div>{{ .Content }}</div>
{{ range $comment := .Comments }}
<div class="comment">
<div>
@@ -15,7 +17,7 @@
<form method="POST" action="">
<input type="text" placeholder="Name" name="author"/>
<input type="field" name="content" />
<input type="text" value="{{ .Url }}" readonly />
<input type="text" style="display: none;" value="{{ .Url }}" readonly />
</form>
</div>
{{ template "footer.tmpl" . }}