add social media section to home page
This commit is contained in:
parent
d24754dd2d
commit
917f1e1d6b
42 changed files with 272 additions and 76 deletions
35
gnimmelf.html
Normal file
35
gnimmelf.html
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<script src="mithril.js"></script>
|
||||
<script type="text/javascript">
|
||||
//model
|
||||
var identity = function(value) {return value}
|
||||
var page = function(url) {
|
||||
return m.request({method: "GET", url: url, deserialize: identity})
|
||||
.then(marked)
|
||||
.then(m.trust)
|
||||
}
|
||||
|
||||
//controllers
|
||||
var home = function(ctrl) {
|
||||
this.title = "Home"
|
||||
this.body = m.trust("hello home")//page("home.html")
|
||||
}
|
||||
var about = function(ctrl) {
|
||||
this.title = "Home"
|
||||
this.body = m.trust("hello about")//page("about.html")
|
||||
}
|
||||
|
||||
//view
|
||||
var layout = function(ctrl) {
|
||||
return m("html", [
|
||||
m("body", [
|
||||
m("h1", ctrl.title),
|
||||
m("#app", ctrl.body)
|
||||
])
|
||||
])
|
||||
}
|
||||
|
||||
m.route(document, "/", {
|
||||
"/": {controller: home, view: layout},
|
||||
"/about": {controller: about, view: layout}
|
||||
})
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue