vanity import

This commit is contained in:
Cadey Ratio 2018-12-14 04:52:16 +00:00
parent 58b2870883
commit 225759ddb3
4 changed files with 14 additions and 3 deletions

View File

@ -161,7 +161,15 @@ func Build() (*Site, error) {
}
// Add HTTP routes here
s.mux.Handle("/", s.renderTemplatePage("index.html", nil))
s.mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "/" {
w.WriteHeader(http.StatusNotFound)
s.renderTemplatePage("error.html", "can't find " + r.URL.Path).ServeHTTP(w,r)
return
}
s.renderTemplatePage("index.html", nil).ServeHTTP(w, r)
})
s.mux.Handle("/resume", s.renderTemplatePage("resume.html", s.Resume))
s.mux.Handle("/blog", s.renderTemplatePage("blogindex.html", s.Posts))
s.mux.Handle("/contact", s.renderTemplatePage("contact.html", nil))

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/Xe/site
module christine.website
require (
github.com/Xe/gopreload v0.0.0-20170326043426-a00a8beb369c

View File

@ -3,6 +3,7 @@
<head>
{{ template "title" . }}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="go-import" content="christine.website git https://github.com/Xe/site">
<link rel="stylesheet" href="/css/hack.css" />
<link rel="stylesheet" href="/css/gruvbox-dark.css" />
<link rel="manifest" href="/static/manifest.json" />

View File

@ -1,4 +1,6 @@
{{ define "title" }}<title>Christine Dodrill</title>{{ end }}
{{ define "title" }}
<title>Christine Dodrill</title>
{{ end }}
{{ define "content" }}
<div class="grid">