From 30c0722d092e5fada5b82b64ae593dd1bc54dcd9 Mon Sep 17 00:00:00 2001 From: Phil Oyston Date: Mon, 15 Aug 2016 15:39:35 +0100 Subject: [PATCH] Updates readme with documentation --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/README.md b/README.md index d2ab7d1..fd77a6a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,53 @@ # Sitemapify Provides a ASP.NET HttpHandler to assist with generating a dynamic sitemap.xml file + +## Installation +The installation process should have updated your web.config file to include a httphandler to process requests to `sitemap.xml`, it should look similar to: + +```xml + + + + + + + +``` + +## Customisation +The sitemap handler can be customised by altering the base configuration via the ```Sitemapify.Configure``` static configuration class. Sitemapify is split into providers that are responsible for elements of the sitemap generation. + +### Content Provider (`ISitemapifyContentProvider`) +An implementation of a content provider supplies Sitemapify with a collection of `SitemapUrl` objects representing the nodes to output within the sitemap. + +```c# +public interface ISitemapContentProvider +{ + IEnumerable GetSitemapUrls(); + bool Cacheable { get; } + DateTime CacheUntil { get; } +} +``` + +### Cache Provider (`ISitemapifyCacheProvider`) +An implementation of a cache provider allows customisation of the caching mechanism used to optimise delivery of the sitemap to the browser. Once the sitemap document is generated it will be cached via the configured implementation of this interface. + +```c# +public interface ISitemapCacheProvider +{ + void Add(XDocument sitemapContent, DateTimeOffset? expires); + bool IsCached { get; } + XDocument Get(); + void Remove(); +} +``` + +### Document Builder (`ISitemapDocumentBuilder`) +An implementation of the `ISitemapDocumentBuilder` provides allows full customisation of the sitemap document itself. The default implementation generates a fully compliant sitemap document based on the official [sitemap.xsd](http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd). + +```c# +public interface ISitemapDocumentBuilder +{ + XDocument BuildSitemapXmlDocument(IEnumerable sitemapUrls); +} +```