summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go10
-rw-r--r--template.html37
2 files changed, 29 insertions, 18 deletions
diff --git a/main.go b/main.go
index 7f31327..3ed3e9c 100644
--- a/main.go
+++ b/main.go
@@ -135,19 +135,11 @@ type TplData struct {
Porn *EarthPorn
Weather *Weather
Links []Link
- LCols int
}
func startpage(rw http.ResponseWriter, req *http.Request) {
- links := GetLinks()
- lcols := len(links) / 3
- if lcols < 1 {
- lcols = 1
- } else if lcols > 4 {
- lcols = 4
- }
- if err := tpl.Execute(rw, &TplData{&porn, &weather, links, lcols}); err != nil {
+ if err := tpl.Execute(rw, &TplData{&porn, &weather, links}); err != nil {
log.Printf("Failed executing template: %s\n", err)
}
}
diff --git a/template.html b/template.html
index 288c933..212979f 100644
--- a/template.html
+++ b/template.html
@@ -17,17 +17,36 @@
color: white;
text-decoration: underline;
}
- * { font-family: "DejaVu Sans Light", sans-serif; }
- #earthporninfo { position: fixed; bottom: 2mm; right: 10mm; font-size: 8pt; }
- #earthporninfo a { background: black; }
- #weather { position: fixed; top: 10mm; left: 10mm; }
- #temp { position: absolute; top: 30px; left: 60px; font-size:70px; text-shadow: black 2px 2px; color: white;}
+ * {
+ font-family: "DejaVu Sans Light", sans-serif;
+ color: white;
+ }
+ #earthporninfo {
+ position: fixed;
+ bottom: 2mm;
+ right: 10mm;
+ font-size: 8pt;
+ background: black;
+ }
+ #weather {
+ position: fixed;
+ top: 10mm;
+ left: 10mm;
+ }
+ #temp {
+ position: absolute;
+ top: 30px;
+ left: 60px;
+ font-size:70px;
+ text-shadow: black 2px 2px;
+ color: white;
+ }
#links {
position: absolute;
top: 40%;
left: 20%;
- columns: {{ .LCols }};
- -moz-columns: {{ .LCols }};
+ columns: 2;
+ -moz-columns: 2;
padding: 5mm;
background: rgba(0,0,0,0.6);
}
@@ -55,8 +74,8 @@
{{ end }}
</ul>
</div>
- <div id="earthporninfo">
+ <span id="earthporninfo">
<a href="http://reddit.com{{ .Porn.Permalink }}">{{ .Porn.Title }}</a>
- </div>
+ </span>
</body>
</html> \ No newline at end of file