Skip to content

Commit

Permalink
Updates readme with documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Philo authored Aug 15, 2016
1 parent c3f416f commit 30c0722
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
<configuration>
<system.webServer>
<handlers>
<add name="Sitemapify" path="sitemap.xml" verb="GET" type="Sitemapify.SitemapifyHttpHandler, Sitemapify" />
</handlers>
</system.webServer>
</configuration>
```

## 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<SitemapUrl> 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<SitemapUrl> sitemapUrls);
}
```

0 comments on commit 30c0722

Please sign in to comment.