Created
February 12, 2012 18:47
-
-
Save seancoyne/1810183 to your computer and use it in GitHub Desktop.
Gist renderer for BlogCFC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!--- | |
| 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