handle type for favicon and improve helptext

This commit is contained in:
sbwalker 2023-06-12 12:30:56 -04:00
parent a10db462eb
commit 726f9375e1
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))
{