68bfab9c1782399cef11c39769b6d9ea4a680cd1
wp-materialize
wp-materialize is an automation compiler that materializes specified Markdown files into WordPress posts.
Git/filesystem state is the single source of truth; WordPress is a derived view.
Install
python -m pip install -e .
Source Layout
The wp_materialize package lives directly under src/ (single-package mapping).
Documentation
Configuration
Global config is required and must be a JSON object with these fields:
wordpress_root(string, required): Path wherewpCLI is executed.repo_storage_dir(string, required): Directory where git repos are cloned.git_repositories(array, optional): Git repos to manage.directories(array, optional): Non-git directories to manage.
git_repositories entries:
name(string, required): Stable identifier for the repo.url(string, required): Git clone URL.branch(string, optional, defaultmain): Branch to checkout.root_subdir(string, optional): Subdirectory that contains manifests/content.
directories entries:
name(string, required): Stable identifier for the directory.path(string, required): Filesystem path.root_subdir(string, optional): Subdirectory that contains manifests/content.
Global config (required):
~/.config/wp-materialize/config.json
Example:
{
"wordpress_root": "/var/www/wordpress",
"repo_storage_dir": "/home/user/wp-materialize-repos",
"git_repositories": [
{
"name": "content-repo",
"url": "https://github.com/example/content-repo.git",
"branch": "main",
"root_subdir": "posts"
}
],
"directories": [
{
"name": "local-notes",
"path": "/home/user/notes",
"root_subdir": "wordpress"
}
]
}
State is stored separately (created on first successful apply):
~/.config/wp-materialize/state.json
Usage
Dry-run evaluation:
wp-materialize evaluate
Apply (evaluate, then materialize):
wp-materialize apply
Skip git sync:
wp-materialize apply --no-sync
Manifests
Each managed directory must contain a .wp-materialize.json manifest. See configurations.md for the manifest guide.
Python Prerequisites
- Python 3.10+
- Packages:
Markdown>=3.6
Install dependencies:
python -m pip install -r requirements.txt
Languages
Python
100%