package Webserver
							 | 
						|
								
							 | 
						|
								import (
							 | 
						|
									"net/http"
							 | 
						|
								
							 | 
						|
									"PersonalWebsite/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 {
							 | 
						|
										// TODO: Handle this
							 | 
						|
										http.Error(w, "Error", http.StatusInternalServerError)
							 | 
						|
									}
							 | 
						|
								
							 | 
						|
									ServeTemplate(w, r, "html/index.gohtml", v)
							 | 
						|
								}
							 |