Google, Microsoft and Yahoo just released the first result from the joint venture sitemap protocol. For a while now, you have been able to log in to Google’s webmaster tools and from there specify your sitemap XML file. By doing so, you tell Google the location of all the pages on your site so that you make sure that everything gets crawled and indexed.
Yahoo and Microsoft wanted the same functionality but instead of creating their own format, the joined forces with Google to create a standardized format. Now Ask.com announces they also will support the format.
The result is a set of extensions but most importantly the ability of autodiscovery, so you no longer have to manually log in and update the sitemap. Because all search engines support the robots.txt document, they decided to let you specify the path to the sitemap there.
Basically, you just add a single line to the robots.txt that specifies the absolute path to the sitemap. Here is an example from my robots.txt:
sitemap: http://blog.madskristensen.dk/sitemap.axd
If you use BlogEngine.NET, the sitemap is called /sitemap.axd.
BlogEngine.NET runs entirely on XML files located in the App_Data folder. That makes it truly plug ‘n play, but not everybody likes XML files. We’ve had a lot of requests for SQL Server and MySql providers, so now we finally released an open provider model.
Now it’s possible to write your own providers in an extremely easy and intuitive way. There are two steps involved. First of all you need to write the provider and secondly you have to add it to the web.config.
Writing providers
A provider is 1 single class that inherits from BlogProvider and implements 10 methods. These methods inserts, updates, deletes and retrieves posts, pages and categories. Here are the abstract methods that must be implemented on the custom provider:
// Post
public abstract Post SelectPost(Guid id);
public abstract void InsertPost(Post post);
public abstract void UpdatePost(Post post);
public abstract void DeletePost(Post post);
// Page
public abstract Page SelectPage(Guid id);
public abstract void InsertPage(Page page);
public abstract void UpdatePage(Page page);
public abstract void DeletePage(Page page);
// Category
public abstract CategoryDictionary LoadCategories();
public abstract void SaveCategories(CategoryDictionary categories);
When they are implemented you can fill them with SQL statements, stored procedures or whatever data store mechanisms you like. You can look at the default XmlBlogProvider for inspiration.
Changing web.config
The BlogEngine configuration section in web.config needs to be updated to make the custom provider work. This is the section with the default XML provider set up. Just add your provider and set it as default in the defaultProvider attribute.
< BlogEngine >
< blogProvider defaultProvider ="XmlBlogProvider" >
< providers >
< add name ="XmlBlogProvider" type ="DotNetSlave.BlogEngine.BusinessLogic.XmlBlogProvider" />
</ providers >
</ blogProvider >
</ BlogEngine >
When both the provider is written and web.config changed, it will work just like that. If you write a provider and wish to share it, please let me know and I will send a link your way.
Get the latest bits with the new provider model at CodePlex.