Skip to content

Instantly share code, notes, and snippets.

View JustAGuyTryingToCodeSomething's full-sized avatar

JustAGuyTryingToCodeSomething

View GitHub Profile
@JustAGuyTryingToCodeSomething
JustAGuyTryingToCodeSomething / gist:0b7dd2fc4c12ea35886943b5dbf0cc50
Created June 27, 2017 18:41
Umbraco dynamic sitemap .cshtml template view. Based on article and gist by Alex Lindgren: https://gist.github.com/alindgren/1439022194a472d83ddf with a few tweaks for Articulate Blog Posts, https and extra Sitemap protocol entries.
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using System.Linq;
@{
Layout = null;
Response.ContentType = "text/xml";
}<?xml version='1.0' encoding='UTF-8' ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
@ListChildNodes(Umbraco.TypedContent(UmbracoContext.Current.PageId).AncestorOrSelf(1))