Last active
October 6, 2018 17:07
-
-
Save iknowkungfoo/38c7dbd6fcf7bc651ec05ea9bd0b33ff 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
This file contains 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
<cfquery name="blog" datasource="iknowkungfoo"> | |
SELECT | |
cte.post_id | |
, cte.post_title | |
, cte.post_body | |
, cte.post_more | |
, cte.post_date | |
, cte.post_time | |
, cte.post_alias | |
, group_concat(LCASE(cte.post_category) order by cte.post_category separator ' ') as post_categories | |
FROM ( | |
SELECT | |
e.id AS post_id, | |
e.title AS post_title, | |
e.body AS post_body, | |
e.morebody AS post_more, | |
date(e.posted) AS post_date, | |
time(e.posted) AS post_time, | |
e.alias AS post_alias, | |
lcase(e.alias) AS post_alias_lower, | |
CASE c.categoryname | |
WHEN 'Twitter Bootstrap' | |
THEN 'Bootstrap' | |
ELSE c.categoryname | |
END AS post_category | |
FROM | |
tblblogentries e | |
INNER JOIN | |
tblblogentriescategories ec ON ec.entryidfk = e.id | |
INNER JOIN | |
tblblogcategories c ON c.categoryid = ec.categoryidfk | |
) cte | |
group BY | |
cte.post_id | |
order by | |
cte.post_date DESC | |
</cfquery> | |
<cfinclude template="blogcfc_to_markdown_02.cfm"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment