summaryrefslogtreecommitdiff
path: root/template.html
diff options
context:
space:
mode:
authorLaria Carolin Chabowski <laria@laria.me>2020-10-04 22:58:03 +0200
committerLaria Carolin Chabowski <laria@laria.me>2020-10-04 22:58:03 +0200
commit5b456afb49bfa6ff1567510bc1d9362377d32216 (patch)
treee9f13973251405095dd8b0a31930ca10caa57163 /template.html
parent1f700deeb1a26ab289178b76518a33faa3f51545 (diff)
downloadstartpage-5b456afb49bfa6ff1567510bc1d9362377d32216.tar.gz
startpage-5b456afb49bfa6ff1567510bc1d9362377d32216.tar.bz2
startpage-5b456afb49bfa6ff1567510bc1d9362377d32216.zip
New config format and new features
We're now using json as a config format instead of our weird own format. The weather icon is now optional, simply don't define WeatherPlace in your config. You can now specify which subreddit to get background images from. The default is still /r/EarthPorn.
Diffstat (limited to 'template.html')
-rw-r--r--template.html35
1 files changed, 23 insertions, 12 deletions
diff --git a/template.html b/template.html
index e0f3a30..ffb833c 100644
--- a/template.html
+++ b/template.html
@@ -4,11 +4,16 @@
<title>Startpage</title>
<style type="text/css">
body {
- background: black url(/bgimg) no-repeat center center fixed;
+ background: grey;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
+ {{ if .BgImage }}
+ body {
+ background: black url(/bgimg) no-repeat center center fixed;
+ }
+ {{ end }}
a {
color: #eee;
text-decoration: none;
@@ -31,7 +36,7 @@
left: 10mm;
background: black;
}
- #earthporninfo {
+ #imageinfo {
position: fixed;
bottom: 2mm;
right: 10mm;
@@ -72,10 +77,12 @@
</style>
</head>
<body>
- <div id="weather">
- <a href="{{ .Weather.URL }}"><img src="{{ .Weather.Icon }}" alt="" /></a>
- <span id="temp">{{ .Weather.Temp.Value }}°</span>
- </div>
+ {{ if .Weather }}
+ <div id="weather">
+ <a href="{{ .Weather.URL }}"><img src="{{ .Weather.Icon }}" alt="" /></a>
+ <span id="temp">{{ .Weather.Temp.Value }}°</span>
+ </div>
+ {{ end }}
{{ if .Links }}
<div id="links">
<ul>
@@ -88,13 +95,17 @@
<footer>
- <div id="yr_no_credit">Weather forecast from Yr, delivered by the Norwegian Meteorological Institute and NRK</div>
+ {{ if .Weather }}
+ <div id="yr_no_credit">Weather forecast from Yr, delivered by the Norwegian Meteorological Institute and NRK</div>
+ {{ end }}
- <span id="earthporninfo">
- <a href="http://reddit.com{{ .Porn.Permalink }}">{{ .Porn.Title }}</a>
- |
- {{ if .Porn.Saved }}saved{{ else }}<a href="/savebg">save</a>{{ end }}
- </span>
+ {{ if .BgImage }}
+ <span id="imageinfo">
+ <a href="http://reddit.com{{ .BgImage.Permalink }}">{{ .BgImage.Title }}</a>{{ if .CanSaveBg}}
+ | {{ if .BgImage.Saved }}saved{{ else }}<a href="/savebg">save</a>{{ end }}
+ {{ end }}
+ </span>
+ {{ end}}
</footer>
</body>
</html>