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