@**
* Copyright (c) 2013-2019 Kaj Magnus Lindberg
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*@
@(tpi: debiki.SiteTpi, pageTitleUnsafe: Option[String], description: Option[String], faviconUrl: String)
@import com.debiki.core.Prelude._
@import org.owasp.encoder.Encode
@if(pageTitleUnsafe.nonEmpty) {
@Html(Encode.forHtmlContent(pageTitleUnsafe.get))
}
@if(description.nonEmpty) {
}
@faviconType = @{
val suffix = faviconUrl.takeRightWhile(_ != '.')
// If too long, probably there is no real suffix. Then assume it's an icon? 'jpeg' = 4 chars.
if (suffix == "ico" || suffix.length > 4 || suffix.isEmpty) "image/x-icon"
else "image/" + suffix
}
@if(faviconUrl.nonEmpty) {
}
@* Else, use Talkyard's own favicon. Sync with Nginx location directive [NGXMEDIA] *@
@if(faviconUrl.isEmpty) {
}
@* Some other viewport values, and the absence of a value,
trigger Android bugs that report the wrong screen.width,
window.innerWidth, document.documentElement.clientWidth and heights,
breaking dwScrollIntoView (and other stuff?) in debiki.js.
See: https://code.google.com/p/android/issues/detail?id=10775#c20
*@
@*
[sw] *@