1
0

Don't store generated index.pug.go.

This commit is contained in:
Alexander Andreev 2023-02-07 02:35:10 +04:00
parent c18c52e839
commit 9e72a59fba
Signed by: Arav
GPG Key ID: 0388CC8FAA51063F
2 changed files with 2 additions and 83 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
bin/* bin/*
!bin/.keep !bin/.keep
.vscode .vscode
*.pug.go

View File

@ -1,82 +0,0 @@
// Code generated by "jade.go"; DO NOT EDIT.
package web
import (
"dwelling-radio/internal/radio"
"io"
)
const (
index__0 = `<!DOCTYPE html><html lang="en"><head><title>Arav's dwelling / Radio</title><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta name="theme-color" content="#cd2682"/><meta name="description" content="Internet-radio broadcasting from under my desk."/><link rel="icon" href="/assets/img/favicon.svg" sizes="any" type="image/svg+xml"/><link href="/assets/css/main.css" rel="stylesheet"/><script src="/assets/js/main.js" defer=""></script></head><body><header><svg id="logo" viewBox="0 -25 216 40"><text class="logo">Arav's dwelling</text><text class="under" y="11">Welcome to my sacred place, wanderer</text></svg><nav><a href="`
index__1 = `">Back to main website</a><h1>Radio</h1></nav></header><section><small class="player-links"><a href="/filelist">filelist</a><a href="/playlist">playlist (.m3u)</a><a href="/live/stream.ogg">direct link</a><a href="http://radio.arav.top:8000/stream.ogg">direct link (http)</a><a href="http://wsmkgnmhmzqm7kyzv7jnzzafvgm7xlmlfvzhgorpapd5or2arnhuktqd.onion/live/stream.ogg">direct link (Tor)</a><a href="http://radio.arav.i2p/live/stream.ogg">direct link (I2P)</a><a href="https://dir.xiph.org/search?q=arav&#39;s+dwelling">Xiph</a>OGG 128 Kb/s</small><audio preload="none" controls=""><source src="/live/stream.ogg" type="audio/ogg"/>Your browser doesn't support an audio element, it's sad... But you always can take the <a href="/playlist">playlist</a>!</audio>`
index__2 = `<p>Now playing: <span id="radio-song">`
index__3 = `</span></p><p>Current/peak listeners: <span id="radio-listeners">`
index__4 = `</span> / <span id="radio-listener-peak">`
index__5 = `</span></p><p><small>Notice: information updates every 45 seconds. But you can <button id="btn-update">update</button> it forcibly.</small></p></section>`
index__6 = `<section><p>The largest number of simultaneous listeners was <b>7</b> at <time datetime="2022-02-19">19 February 2022</time>, and the song was &quot;Röyksopp - 49 Percent&quot;.</p></section><section><h2>Privacy statements</h2><p>Logs are collected and include access date and time, IP-address, User-Agent, referer URL, request. This website makes use of JavaScript to update a radio status and last 10 songs list.</p></section><footer>2017&mdash;2022 Arav &lt;<a href="mailto:me@arav.top">me@arav.top</a>&gt;</footer></body></html>`
index__7 = `<p id="radio-status">On-air since <time datetime="`
index__8 = `">`
index__9 = `</time></p>`
index__10 = `<p id="radio-status">Radio is offline.</p>`
index__11 = `<section><h2>Last 10 songs</h2><table id="last-played">`
index__12 = `</table></section>`
index__13 = `<tr><td>`
index__14 = `</td>`
index__15 = `<td>`
index__16 = `</td></tr>`
index__19 = `<td></td>`
)
func Index(mainSite string, status *radio.IcecastStatus, songs *[]radio.Song, wr io.Writer) {
buffer := &WriterAsBuffer{wr}
buffer.WriteString(index__0)
WriteEscString(mainSite, buffer)
buffer.WriteString(index__1)
if status.ServerStartDate != "" {
buffer.WriteString(index__7)
WriteEscString(status.ServerStartISO8601, buffer)
buffer.WriteString(index__8)
WriteEscString(status.ServerStartDate, buffer)
buffer.WriteString(index__9)
} else {
buffer.WriteString(index__10)
}
buffer.WriteString(index__2)
WriteEscString(status.SongName, buffer)
buffer.WriteString(index__3)
WriteInt(int64(status.Listeners), buffer)
buffer.WriteString(index__4)
WriteInt(int64(status.ListenerPeak), buffer)
buffer.WriteString(index__5)
if len(*songs) > 0 {
buffer.WriteString(index__11)
for _, song := range *songs {
buffer.WriteString(index__13)
WriteEscString(song.Time, buffer)
buffer.WriteString(index__14)
if song.Listeners != "0" {
buffer.WriteString(index__15)
WriteEscString(song.Listeners, buffer)
buffer.WriteString(index__14)
} else {
buffer.WriteString(index__19)
}
buffer.WriteString(index__15)
WriteEscString(song.Song, buffer)
buffer.WriteString(index__16)
}
buffer.WriteString(index__12)
}
buffer.WriteString(index__6)
}