private Task OnWritePageContent(StringBuilder html, IMetadata data, string url) { if (html.Length > 0) { try { var writer = new HtmlHeadWriter(html); writer.AddStyleSheets(CSS_FILE_PATH); writer.AddScripts(JS_FILE_PATH); return(Task.CompletedTask); } catch (Exception ex) { throw new HeadAssetLinkFailedException(CSS_FILE_PATH, url, ex); } } else { return(Task.CompletedTask); } }
private Task OnWritePageContent(StringBuilder html, IMetadata data, string url) { if (!m_Settings.EmbedStyle) { if (html.Length > 0) { try { var writer = new HtmlHeadWriter(html); writer.AddStyleSheets(CSS_FILE_PATH); } catch (Exception ex) { throw new HeadAssetLinkFailedException(CSS_FILE_PATH, url, ex); } } else { return(Task.FromResult(html)); } } return(Task.FromResult(html)); }