Example #1
0
        /// <summary>
        /// Creates the Disqus comments rendering model based on context and configuration.
        /// </summary>
        /// <param name="configuration">The Disqus configuration.</param>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        private RenderingModel CreateRenderingModel(IConfiguration configuration, IContext context)
        {
            var isDisqusEnabled = IsDisqusEnabled(configuration);
            var renderingModel  = new RenderingModel {
                IsEnabled = isDisqusEnabled
            };

            if (isDisqusEnabled)
            {
                renderingModel.LoaderScript = _codeBuilder.CreateLoaderScript(configuration, context);
                renderingModel.ThreadCode   = _codeBuilder.CreateThreadCode(configuration, context);
            }
            return(renderingModel);
        }