Created
May 14, 2014 16:11
-
-
Save Dianoga/2f88b3ea8ff15a8d4319 to your computer and use it in GitHub Desktop.
Codekit hook to concatenate templates into html file
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
php -r ' | |
$filename = "index2.html"; | |
$file = file_get_contents($filename); | |
$views = str_replace("</script>", "</script>\n", `cat views/*`); | |
$find = "/(<!--StartTemplates-->)(.*)(<!--EndTemplates)/s"; | |
$replace = "$1\n{{templates}}\n$3"; | |
$file = preg_replace($find, $replace, $file); | |
$file = str_replace("{{templates}}", $views, $file); | |
file_put_contents($filename, $file); | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment