4.7 KiB
Configuration Reference
This document defines every JSON field for both the global config and per-directory manifests.
Global Config (~/.config/wp-materialize/config.json)
Top-level fields:
wordpress_root(string, required) Path to the WordPress root directory where thewpCLI is executed.repo_storage_dir(string, required) Directory where git repositories are cloned or updated.git_repositories(array, optional) List of git repositories to manage. Default is an empty list.directories(array, optional) List of non-git directories to manage. Default is an empty list.
git_repositories entries:
name(string, required) Stable identifier for the repository. Used to build post identity.url(string, required) Git clone URL.branch(string, optional, defaultmain) Branch to checkout and pull.root_subdir(string, optional) Subdirectory within the repo that contains.wp-materialize.jsonand content. If omitted ornull, the repo root is used.
directories entries:
name(string, required) Stable identifier for the directory. Used to build post identity.path(string, required) Filesystem path to the directory.root_subdir(string, optional) Subdirectory within the directory that contains.wp-materialize.jsonand content. If omitted ornull, the directory root is used.
Per-Directory Manifest (.wp-materialize.json)
Each managed directory must contain a manifest. Manifests define a scope boundary. No implicit traversal is allowed; subdirectories must be listed explicitly.
Top-level fields:
categories(object, optional) Inherited category paths for this directory and its children.tags(object, optional) Inherited tags for this directory and its children.author(object, optional) Inherited author for this directory and its children. Must resolve to a single author.subdirectories(object, optional) Explicit list of subdirectories to traverse.files(object, optional) Mapping of Markdown file names to file-level configuration.
categories, tags, author, and subdirectories objects:
content(array of strings, optional) List of values for the given field. Forcategories, each string is a hierarchical path such asSystems/Infrastructure. Forsubdirectories, each string is a directory name under the current directory. Forauthor, exactly one string must remain after inheritance is applied.inherit(boolean, optional, defaulttrue) Iftrue, append to the parent effective list. Iffalse, replace the parent list entirely.
Note: Root directory manifests do not need to specify inherit for these top-level
fields (the default is true). File-level overrides inside files still support
inheritance via their own inherit fields.
files entries:
Each key is a Markdown file name (relative to the manifest directory). Each value is an object with the following fields:
title(string, required ifuse_heading_as_titleis not set) Explicit WordPress post title.use_heading_as_title(object, optional) Extracts a heading from the Markdown as the title and removes that heading from the body while promoting remaining headings by one level.created_on(string, optional) Manual override for the post creation time inYYYY-MM-DD hh:mmformat.last_modified(string, optional) Manual override for the post modified time inYYYY-MM-DD hh:mmformat.categories(object, optional) Overrides categories for this file. Uses the samecontentandinheritfields as the top-levelcategoriesobject.tags(object, optional) Overrides tags for this file. Uses the samecontentandinheritfields as the top-leveltagsobject.
use_heading_as_title object:
level(integer, required) Heading level to extract, from1to6.strict(boolean, optional, defaulttrue) Iftrue, exactly one matching heading must exist.
If created_on or last_modified is not provided, the system infers the value.
For git_repositories sources it uses git commit timestamps; for directories
sources it uses filesystem timestamps. The system does not auto-detect git for
entries declared under directories, even if the path is inside a git repo.
Post Identity
Each post is identified with:
_wp_materialize_source = <source_name>:<relative_path>
source_name is the name from the global config entry, and relative_path is
relative to the repo or directory root used for identity resolution.
Tag and Category Creation
Missing categories and tags are created automatically during apply, after a successful dry-run evaluation and before any post updates.