Esempio n. 1
0
        public override async Task <string> GeneratePage(int id, int staticSiteId, IFileNameGenerator fileNamer, IEnumerable <ITransformer> transformers = null)
        {
            SslTruster.TrustSslIfAppSettingConfigured();

            var node = GetNode(id);

            if (node == null)
            {
                return(null);
            }

            var    url         = node.Url(mode: UrlMode.Relative);
            string absoluteUrl = node.Url(mode: UrlMode.Absolute);

            var fileData = await GetFileDataFromWebClient(absoluteUrl);

            if (fileData == null)
            {
                return(null);
            }

            var transformedData = RunTransformers(fileData, transformers);

            var filePath = fileNamer.GetFilePartialPath(url);

            var generatedFileLocation = await Store(staticSiteId, filePath, transformedData);

            return(generatedFileLocation);
        }
        public override async Task <string> GeneratePage(int id, int staticSiteId, IFileNameGenerator fileNamer, IEnumerable <ITransformer> transformers = null)
        {
            var node = GetNode(id);

            if (node == null)
            {
                return(null);
            }

            var url      = node.Url(mode: UrlMode.Relative);
            var fileData = GetJsonData(node);

            var transformedData = RunTransformers(fileData, transformers);

            var filePath = fileNamer.GetFilePartialPath(url);

            var generatedFileLocation = await Store(staticSiteId, filePath, transformedData);

            return(generatedFileLocation);
        }