Пример #1
0
        public ActionResult GetThemeAssets(string path)
        {
            var stream = _themeEngine.GetAssetStream(path);

            return(stream != null
                ? File(stream, MimeMapping.GetMimeMapping(path))
                : HandleStaticFiles(path));
        }
Пример #2
0
        public ActionResult GetThemeAssets(string path)
        {
            var stream = _themeEngine.GetAssetStream(path);

            if (stream != null)
            {
                return(File(stream, MimeMapping.GetMimeMapping(path)));
            }
            throw new HttpException(404, path);
        }
Пример #3
0
        public ActionResult GetAssets(string asset)
        {
            var stream = _themeEngine.GetAssetStream(asset);

            if (stream != null)
            {
                return(base.File(stream, MimeMapping.GetMimeMapping(asset)));
            }
            throw new HttpException(404, asset);
        }
        private async Task <Stream> TryGetSitemapStream(string filePath)
        {
            //If sitemap files have big size for generation on the fly you might place already generated xml files in the theme/assets folder or schedule
            // execution of GenerateSitemapJob.GenerateStoreSitemap method for pre-generation sitemaps
            var stream = _liquidThemeEngine.GetAssetStream(filePath);

            if (stream == null)
            {
                var absUrl   = UrlBuilder.ToAppAbsolute("~/", WorkContext.CurrentStore, WorkContext.CurrentLanguage);
                var storeUrl = new Uri(WorkContext.RequestUrl, absUrl).ToString();
                //remove language from base url SitemapAPI will add it automatically
                storeUrl = storeUrl.Replace("/" + WorkContext.CurrentLanguage.CultureName + "/", "/");
                stream   = await _siteMapApiClient.SitemapsModuleApiOperations.GenerateSitemapAsync(WorkContext.CurrentStore.Id, storeUrl, filePath);
            }
            return(stream);
        }