Exemple #1
0
        public void Process(SitemapGetSitemapPathArgs args)
        {
            Assert.ArgumentNotNull(args, nameof(args));

            var globalDirectory = ResolveGlobalDirectory.GlobalDirectory();

            var sitemapDirectory = ResolveRelativeSitemapDirectory.SiteRelativeDirectory(globalDirectory, ItemUtil.ProposeValidItemName(args.SiteContext.Name));

            args.AbsolutePath = sitemapDirectory + "\\sitemap.xml";
        }
Exemple #2
0
        private static string GetSitemapFilePath(SiteContext siteContext, string sitemapFile)
        {
            var group = siteContext.Properties["sitemapGroup"];

            var globalDirectory = ResolveGlobalDirectory.GlobalDirectory();

            var siteDirectory = ResolveRelativeSitemapDirectory.SiteRelativeDirectory(globalDirectory, group);

            return($"{siteDirectory}\\{sitemapFile}");
        }
        private static string GetSitemapFilePath(SiteContext siteContext)
        {
            var group = siteContext.Properties["sitemapGroup"];

            var globalDirectory = ResolveGlobalDirectory.GlobalDirectory();

            var siteName = !string.IsNullOrWhiteSpace(group) ? group : ItemUtil.ProposeValidItemName(siteContext.Name);

            var siteDirectory = ResolveRelativeSitemapDirectory.SiteRelativeDirectory(globalDirectory, siteName);

            if (!string.IsNullOrWhiteSpace(group))
            {
                return($"{siteDirectory}\\index.xml");
            }

            return($"{siteDirectory}\\{ItemUtil.ProposeValidItemName(siteContext.Name)}.xml");
        }