This repository was archived by the owner on Jul 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 168
/
Copy pathApplicationPage.kt
51 lines (46 loc) · 1.59 KB
/
ApplicationPage.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package org.jetbrains.demo.thinkter
import kotlinx.html.*
import io.ktor.html.*
class ApplicationPage : Template<HTML> {
val caption = Placeholder<TITLE>()
val head = Placeholder<HEAD>()
override fun HTML.apply() {
classes += "mdc-typography"
head {
meta { charset = "utf-8" }
meta {
name = "viewport"
content = "width=device-width, initial-scale=1.0"
}
title {
insert(caption)
}
insert(head)
link("https://fonts.googleapis.com/icon?family=Material+Icons", rel = "stylesheet")
link(rel = LinkRel.stylesheet, type=LinkType.textCss, href = "http://yui.yahooapis.com/pure/0.6.0/pure-min.css")
link(rel = LinkRel.stylesheet, type=LinkType.textCss, href = "http://yui.yahooapis.com/pure/0.6.0/grids-responsive-min.css")
}
body {
script {
unsafe {
+"""
var WebFontConfig = {
google: { families: [ 'Roboto:400,300,500:latin' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
"""
}
}
div { id = "content" }
script(src = "frontend/frontend.bundle.js", block = {})
}
}
}