templ generate, add markdown syntax highlighting, fix stuff
This commit is contained in:
19
main.go
19
main.go
@@ -8,6 +8,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"git.valxntine.dev/valxntine/blog/models"
|
||||
"git.valxntine.dev/valxntine/blog/templates"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -51,7 +52,7 @@ func handleHome(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
d := models.Data{
|
||||
Title: "~/valxntine/blog",
|
||||
Subtitle: "Thought from the Forge",
|
||||
Subtitle: "Thoughts from the Forge",
|
||||
Posts: posts,
|
||||
CurrentPage: page,
|
||||
TotalPages: total,
|
||||
@@ -100,18 +101,10 @@ func handlePost(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "text/html")
|
||||
// err := templates.Layout(post.Title + " - ~/valxntine/blog") {
|
||||
// @templates.Header("~/valxntine/blog", "Thoughts from the Forge")
|
||||
// @templates.Nav()
|
||||
// <main>
|
||||
// @templates.PostDetail(*post)
|
||||
// </main>
|
||||
// @templates.Footer()
|
||||
// }.Render(r.Context(), w)
|
||||
// if err != nil {
|
||||
// http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
// }
|
||||
// }
|
||||
err := templates.PostPageFull(*post).Render(r.Context(), w)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
}
|
||||
|
||||
func handleTag(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user