예제 #1
0
 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);
     }
 }
예제 #2
0
        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));
        }