You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

46 lines
798 B

package webserver
import (
"log"
"net/http"
"git.tovijaeschke.xyz/tovi/personal_website/database"
)
func ViewIndex(w http.ResponseWriter, r *http.Request) {
var (
v = make(map[string]interface{})
e error
)
v["PageView"] = "index-intro.gohtml"
v["Posts"], e = database.GetPostsList(5, 0)
if e != nil {
log.Println(e)
http.Redirect(w, r, "/error", 302)
}
ServeTemplate(w, r, "html/index.gohtml", v)
}
func ViewLinks(w http.ResponseWriter, r *http.Request) {
var (
v = make(map[string]interface{})
)
v["PageView"] = "index-links.gohtml"
ServeTemplate(w, r, "html/index.gohtml", v)
}
func ViewError(w http.ResponseWriter, r *http.Request) {
var (
v = make(map[string]interface{})
)
v["PageView"] = "error.gohtml"
ServeTemplate(w, r, "html/index.gohtml", v)
}