Skip to content

Instantly share code, notes, and snippets.

@leekelleher
Forked from greystate/RenderMetaElements.xslt
Created February 28, 2011 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leekelleher/847484 to your computer and use it in GitHub Desktop.
Save leekelleher/847484 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:umbraco.library="urn:umbraco.library"
exclude-result-prefixes="umbraco.library">
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes" />
<xsl:param name="currentPage" />
<xsl:variable name="separator" select="string('|')" />
<xsl:variable name="fixedTitle" select="/macro/fixedTitle" />
<xsl:template match="/">
<xsl:apply-templates select="$currentPage" />
</xsl:template>
<xsl:template match="*[@isDoc]">
<title>
<xsl:value-of select="(pageTitle | @nodeName[not(normalize-space(../pageTitle))])[1]" />
<xsl:if test="normalize-space($fixedTitle)">
<xsl:value-of select="concat(' ', $separator, ' ')" />
<xsl:value-of select="$fixedTitle" />
</xsl:if>
</title>
<meta name="description" content="{metaDescription}" />
<meta name="keywords" content="{metaKeywords}" />
</xsl:template>
</xsl:stylesheet>
@leekelleher
Copy link
Author

Little revisions... just playing with forks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment