Skip to content

Instantly share code, notes, and snippets.

@seancoyne
Created February 12, 2012 18:47
Show Gist options
  • Select an option

  • Save seancoyne/1810183 to your computer and use it in GitHub Desktop.

Select an option

Save seancoyne/1810183 to your computer and use it in GitHub Desktop.
Gist renderer for BlogCFC
<!---
Save this file as /org/camden/blog/render/gist.cfc
In your entries you can then include a Github gist using the following syntax:
<gist id="[gist id]">
Example: <gist id="1810183"> would embed this gist into a blog entry.
If you want to limit the height of large Gists you can use the following CSS to set a max height:
.gist .gist-file .gist-data {
max-height: 250px;
}
--->
<cfcomponent extends="render" output="false">
<cffunction name="display" output="false" returntype="string" access="public">
<cfargument name="id" required="true" type="string" />
<cfset var html = "" />
<cfsavecontent variable="html">
<cfoutput>
<script src="https://gist.github.com/#arguments.id#.js"></script>
</cfoutput>
</cfsavecontent>
<cfreturn trim(html) />
</cffunction>
</cfcomponent>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment