allow customization of <title>
This commit is contained in:
parent
de117eb5a9
commit
677a9fd9cb
@ -328,7 +328,7 @@ func handleIndexTemplate(w http.ResponseWriter, r *http.Request) {
|
||||
Video: true,
|
||||
Chat: true,
|
||||
MessageHistoryCount: settings.MaxMessageCount,
|
||||
Title: "Movie Night!",
|
||||
Title: settings.PageTitle,
|
||||
}
|
||||
|
||||
path := strings.Split(strings.TrimLeft(r.URL.Path, "/"), "/")
|
||||
|
@ -26,6 +26,7 @@ type Settings struct {
|
||||
StreamStats bool
|
||||
MaxMessageCount int
|
||||
TitleLength int // maximum length of the title that can be set with the /playing
|
||||
PageTitle string // primary value for the page <title> element
|
||||
AdminPassword string
|
||||
RegenAdminPass bool // regenerate admin password on start?
|
||||
StreamKey string
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"MaxMessageCount": 300,
|
||||
"PageTitle": "Movie Night",
|
||||
"TitleLength": 50,
|
||||
"AdminPassword": "",
|
||||
"RegenAdminPass": true,
|
||||
|
@ -23,10 +23,10 @@ function deleteCookie(cname) {
|
||||
function setPlaying(title, link) {
|
||||
if (title !== "") {
|
||||
$('#playing').text(title);
|
||||
document.title = "Movie Night | " + title;
|
||||
document.title = pageTitle + " | " + title;
|
||||
} else {
|
||||
$('#playing').text("");
|
||||
document.title = "Movie Night";
|
||||
document.title = pageTitle;
|
||||
}
|
||||
|
||||
$('#playing').removeAttr('href');
|
||||
|
@ -1,4 +1,5 @@
|
||||
{{define "header"}}
|
||||
<script>pageTitle = {{ .Title }}</script>
|
||||
{{if .Chat}}
|
||||
<script type="application/javascript" src="/static/js/wasm_exec.js"></script>
|
||||
<script type="application/javascript" src="/static/js/chat.js"></script>
|
||||
@ -124,4 +125,4 @@
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
Loading…
Reference in New Issue
Block a user