diff --git a/handlers.go b/handlers.go index 3cdbfad..969fa97 100644 --- a/handlers.go +++ b/handlers.go @@ -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, "/"), "/") diff --git a/settings.go b/settings.go index fd19ac5..264e682 100644 --- a/settings.go +++ b/settings.go @@ -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 element AdminPassword string RegenAdminPass bool // regenerate admin password on start? StreamKey string diff --git a/settings_example.json b/settings_example.json index 1352b6f..891e226 100644 --- a/settings_example.json +++ b/settings_example.json @@ -1,5 +1,6 @@ { "MaxMessageCount": 300, + "PageTitle": "Movie Night", "TitleLength": 50, "AdminPassword": "", "RegenAdminPass": true, diff --git a/static/js/chat.js b/static/js/chat.js index 8093cea..3a16a50 100644 --- a/static/js/chat.js +++ b/static/js/chat.js @@ -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'); diff --git a/static/main.html b/static/main.html index 4a49acc..b2cd83f 100644 --- a/static/main.html +++ b/static/main.html @@ -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}} \ No newline at end of file +{{end}}