Skip to content

Instantly share code, notes, and snippets.

@iknowkungfoo
Last active October 6, 2018 17:07
Show Gist options
  • Save iknowkungfoo/ef8459ed376bf115463e341d9c4b95ef to your computer and use it in GitHub Desktop.
Save iknowkungfoo/ef8459ed376bf115463e341d9c4b95ef to your computer and use it in GitHub Desktop.
Convert BlogCFC blog posts to markdown files, which can then be imported into Jekyll static sites like Github Pages and Gitlab Pages. https://adrianmoreno.com/2018/10/06/converting-blogcfc-posts-to-markdown.html
<cfsavecontent variable="post">---
layout: post
title: "#blogTitle#"
date: #blog.post_date# #blog.post_time# -0500
categories: #blog.post_categories#
redirect_from:
- /blog/index.cfm/#year(blog.post_date)#/#month(blog.post_date)#/#day(blog.post_date)#/#blog.post_alias#/
- /blog/index.cfm/#year(blog.post_date)#/#month(blog.post_date)#/#day(blog.post_date)#/#blog.post_alias_lower#/
---
#blog.post_body#<cfif len(blogPost) GT 0><!--more-->
#Chr(13)##Chr(10)#
#blogPost#
</cfif>
</cfsavecontent>
<cffile action="write" file="#expandPath('temp/#blog.post_date#-#blog.post_alias#.md')#" output="#post#">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment