rough draft of new style
alex wennerberg alex@alexwennerberg.com
Sat, 24 Oct 2020 00:08:13 -0700
3 files changed,
15 insertions(+),
18 deletions(-)
M
http.go
→
http.go
@@ -23,7 +23,7 @@ http.Error(w, errorMsg, statusCode)
} } -func indexHandler(w http.ResponseWriter, r *http.Request) { +func rootHandler(w http.ResponseWriter, r *http.Request) { // serve everything inside static directory if r.URL.Path != "/" { fileName := path.Join(c.TemplatesDirectory, "static", r.URL.Path)@@ -185,7 +185,7 @@ t, err = template.ParseGlob("./templates/*.html") // TODO make template dir configruable
if err != nil { log.Fatal(err) } - http.HandleFunc(c.RootDomain+"/", indexHandler) + http.HandleFunc(c.RootDomain+"/", rootHandler) http.HandleFunc(c.RootDomain+"/my_site", mySiteHandler) http.HandleFunc(c.RootDomain+"/edit/", editFileHandler) http.HandleFunc(c.RootDomain+"/login", loginHandler)
M
templates/index.html
→
templates/index.html
@@ -1,6 +1,6 @@
{{$domain := .Domain}} {{template "header" .}} -<h1>{{.PageTitle}}</h1> +<h1>{{.PageTitle}}!</h1> {{template "nav.html" .}} <h2>All users:</h2> {{ range .Users}}
M
templates/static/style.css
→
templates/static/style.css
@@ -2,8 +2,14 @@ main {
max-width: 70ch; padding: 2ch; margin: auto; - font-family: Helvetica, Arial, monospace; + font-family: monospace; word-wrap: break-word; + border: 1px solid black; + background-color: white; +} + +body { + background-color: lightgray; } .inline {@@ -23,18 +29,6 @@ padding: 3px;
resize: none; } -.status { - border: 1px solid black; - margin-top: 3px; - margin-bottom: 3px; - padding-left: 0.5ch; -} - -.status-text { - font-family: monospace; - padding: 0.5ch; -} - .button { background-color: white; /* Green */ border: 1px solid black;@@ -54,13 +48,16 @@ .error {
color: red; } +a:visited { + color: blue; +} + a { - color: black; transition-duration: 0.2s; font-weight: bold; } a:hover { - background-color: black; + background-color: blue; color: white; }