public ActionResult Sitemap()
        {
            GoogleSiteMap sitemap = new GoogleSiteMap
            {
                Urls = _postRepository.PublishedPosts(CurrentBlog.Id).Select(p => new SiteUrl { Location = string.Format("{0}/{1}", CurrentBlog.AuthoritiveUrl, p.Path.TrimStart('/')) }).ToList()
            };

            sitemap.Urls.Insert(0, new SiteUrl
            {
                Location = String.Format("{0}/Index/Posts", CurrentBlog.AuthoritiveUrl),
                ChangeFrequency = "Daily"
            });

            return Content(sitemap.Serialise(), "text/xml");
        }
示例#2
0
        public ActionResult Sitemap()
        {
            GoogleSiteMap sitemap = new GoogleSiteMap
            {
                Urls = _postRepository.PublishedPosts(CurrentBlog.Id).Select(p => new SiteUrl {
                    Location = string.Format("{0}/{1}", CurrentBlog.AuthoritiveUrl, p.Path.TrimStart('/'))
                }).ToList()
            };

            sitemap.Urls.Insert(0, new SiteUrl
            {
                Location        = String.Format("{0}/Index/Posts", CurrentBlog.AuthoritiveUrl),
                ChangeFrequency = "Daily"
            });

            return(Content(sitemap.Serialise(), "text/xml"));
        }