Last active
August 5, 2021 21:42
-
-
Save pagelab/b75c488cd0e873e8ba092342cb15d729 to your computer and use it in GitHub Desktop.
Codekit custom hook to process TXT files in a folder to form the theme.json for the WordPress site editor.
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
#!/bin/bash | |
rm -f -- "$CK_PROJECT_ROOT/theme.json" && cat "$CK_PROJECT_ROOT/src/json/"*.txt >> "$CK_PROJECT_ROOT/theme.json" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Codekit docs for reference.
theme.json
in several TXT files as you wish and put them in thesrc/json
folder. The TXT files should be built in a way to result in a valid JSON structure for the resultingtheme.json
file. They will be concatenated only, so no validation will occur.Now, when you edit any of the TXT files, a new
theme.json
will be created at the project root.