This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Modified code from http://dotnetthoughts.net/generate-dynamic-xml-sitemaps-in-aspnet5/ | |
public static class SitemapGenerator | |
{ | |
private static string _sitemapContent = null; | |
public static string Generate(string rootUrl, IUrlHelper urlHelper) | |
{ | |
if (_sitemapContent == null) // I only wanted to generate this once and then stash the result. Caching the action that calls this would probably be better | |
{ | |
string sitemapContent = "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">"; |