Skip to content

Instantly share code, notes, and snippets.

@mpicker0
Created April 4, 2013 16:02
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 mpicker0/5311693 to your computer and use it in GitHub Desktop.
Save mpicker0/5311693 to your computer and use it in GitHub Desktop.
I'm converting my site from GetSimple CMS to Jekyll. This converts a GetSimple CMS XML data file to an .html file for Jekyll, containing the proper YAML front matter.
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<xsl:text>---</xsl:text>
<xsl:text>&#10;</xsl:text>
<xsl:text>title: </xsl:text>
<xsl:value-of select="/item/title" />
<xsl:text>&#10;</xsl:text>
<xsl:text>parent: </xsl:text>
<xsl:value-of select="/item/parent" />
<xsl:text>&#10;</xsl:text>
<xsl:text>slug: </xsl:text>
<xsl:value-of select="/item/url" />
<xsl:text>&#10;</xsl:text>
<xsl:text>layout: default</xsl:text>
<xsl:text>&#10;</xsl:text>
<xsl:text>---</xsl:text>
<xsl:text>&#10;</xsl:text>
<xsl:value-of select="/item/content" />
</xsl:template>
</xsl:stylesheet>
@mpicker0
Copy link
Author

mpicker0 commented Apr 5, 2013

Convert all files in a directory using this script.

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