Merge pull request #2885 from sbwalker/dev

handle type for favicon and improve helptext
This commit is contained in:
Shaun Walker 2023-06-12 12:31:09 -04:00 committed by GitHub
commit 875bcd8ce2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -175,7 +175,7 @@
<value>Specify a logo for the site</value>
</data>
<data name="FavoriteIcon.HelpText" xml:space="preserve">
<value>Specify a Favicon</value>
<value>Specify a Favicon. The format for the image must be 16×16, 32×32, 48×48, or 64×64 pixels in size, and 8-bit, 24-bit, or 32-bit in color depth. The format of the image must be ICO, PNG, or GIF.</value>
</data>
<data name="DefaultTheme.HelpText" xml:space="preserve">
<value>Select the sites default theme</value>

View File

@ -33,11 +33,13 @@
var headcontent = "";
// favicon
var favicon = "favicon.ico";
var favicontype = "x-icon";
if (PageState.Site.FaviconFileId != null)
{
favicon = Utilities.FileUrl(PageState.Alias, PageState.Site.FaviconFileId.Value);
favicontype = favicon.Substring(favicon.LastIndexOf(".") + 1);
}
headcontent += $"<link id=\"app-favicon\" rel=\"shortcut icon\" type=\"image/x-icon\" href=\"{favicon}\" />\n";
headcontent += $"<link id=\"app-favicon\" rel=\"shortcut icon\" type=\"image/{favicontype}\" href=\"{favicon}\" />\n";
// stylesheets
foreach (Resource resource in PageState.Page.Resources.Where(item => item.ResourceType == ResourceType.Stylesheet))
{