demonstrates variable
This commit is contained in:
parent
3c2003767e
commit
e9edaf13ee
@ -50,3 +50,7 @@ a {
|
||||
padding-top: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.tiny {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
@ -10,6 +10,9 @@
|
||||
<p>
|
||||
My name is <a href="http://stephen.mcquay.me">Stephen McQuay</a>.
|
||||
</p>
|
||||
<p class="tiny">
|
||||
Your visit occured {{ .time }}.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
3
web.go
3
web.go
@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
assetfs "github.com/elazarl/go-bindata-assetfs"
|
||||
)
|
||||
@ -49,7 +50,7 @@ func NewSite(sm *http.ServeMux, static, templates string) *Site {
|
||||
|
||||
func (s *Site) Home(w http.ResponseWriter, req *http.Request) {
|
||||
c := map[string]string{
|
||||
"time": "asdf",
|
||||
"time": time.Now().Format(time.Stamp),
|
||||
}
|
||||
tmpl, err := s.tmpl.Get("home")
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user