3.6 KiB
3.6 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.subdirectories(object, optional) Explicit list of subdirectories to traverse.files(object, optional) Mapping of Markdown file names to file-level configuration.
categories, tags, 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.inherit(boolean, optional, defaulttrue) Iftrue, append to the parent effective list. Iffalse, replace the parent list entirely.
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.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.
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.