templ generate, add markdown syntax highlighting, fix stuff

This commit is contained in:
2025-08-17 14:15:46 +00:00
parent 59d82ae563
commit 749d68cdeb
23 changed files with 1106 additions and 135 deletions

19
main.go
View File

@@ -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) {