create AppendHeadContent method to consolidate logic

This commit is contained in:
sbwalker
2023-06-14 09:37:34 -04:00
parent b21d202c7f
commit bda0943d58
4 changed files with 16 additions and 25 deletions

View File

@ -281,14 +281,7 @@ namespace Oqtane.Modules
// note - only supports links and meta tags - not scripts
public void AddHeadContent(string content)
{
if (string.IsNullOrEmpty(SiteState.Properties.HeadContent))
{
SiteState.Properties.HeadContent = content;
}
else if (!SiteState.Properties.HeadContent.Contains(content))
{
SiteState.Properties.HeadContent += content;
}
SiteState.AppendHeadContent(content);
}
public void AddScript(Resource resource)