aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristine Dodrill <me@christine.website>2018-12-14 04:52:16 +0000
committerChristine Dodrill <me@christine.website>2018-12-14 04:54:19 +0000
commit225759ddb367a5d15f00d22b0f16ea360c617b53 (patch)
tree172d92a2aeb756a9b2d5d06585298a8deba7ab62
parent58b2870883f45c335e3673cbfe5a9fd96cf50865 (diff)
downloadxesite-225759ddb367a5d15f00d22b0f16ea360c617b53.tar.xz
xesite-225759ddb367a5d15f00d22b0f16ea360c617b53.zip
vanity import
-rw-r--r--cmd/site/main.go10
-rw-r--r--go.mod2
-rw-r--r--templates/base.html1
-rw-r--r--templates/index.html4
4 files changed, 14 insertions, 3 deletions
diff --git a/cmd/site/main.go b/cmd/site/main.go
index fa4b9b8..deb9543 100644
--- a/cmd/site/main.go
+++ b/cmd/site/main.go
@@ -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))
diff --git a/go.mod b/go.mod
index e6cd435..8b3cb7c 100644
--- a/go.mod
+++ b/go.mod
@@ -1,4 +1,4 @@
-module github.com/Xe/site
+module christine.website
require (
github.com/Xe/gopreload v0.0.0-20170326043426-a00a8beb369c
diff --git a/templates/base.html b/templates/base.html
index c00bc1e..c42feed 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -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" />
diff --git a/templates/index.html b/templates/index.html
index 9043e5f..76902be 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -1,4 +1,6 @@
-{{ define "title" }}<title>Christine Dodrill</title>{{ end }}
+{{ define "title" }}
+<title>Christine Dodrill</title>
+{{ end }}
{{ define "content" }}
<div class="grid">