160 lines
3.6 KiB
Markdown
160 lines
3.6 KiB
Markdown
# Configuration Examples
|
|
|
|
Reference: [configurations.md](configurations.md)
|
|
|
|
## Per-Directory Manifests
|
|
|
|
Root directory manifest (`.wp-materialize.json`):
|
|
|
|
```json
|
|
{
|
|
"categories": { "content": ["Systems", "Infrastructure"], "inherit": true },
|
|
"tags": { "content": ["automation", "wordpress"], "inherit": true },
|
|
"author": { "content": ["editorial"], "inherit": true },
|
|
"renderer": "pandoc",
|
|
"hard_line_breaks": true,
|
|
"block_html": true,
|
|
"subdirectories": { "content": ["design", "notes"], "inherit": true },
|
|
"files": {
|
|
"post.md": {
|
|
"title": "Explicit Title",
|
|
"categories": { "content": ["Overrides"], "inherit": false },
|
|
"tags": { "content": ["extra"], "inherit": true }
|
|
},
|
|
"essay.md": {
|
|
"use_heading_as_title": { "level": 1, "strict": true },
|
|
"renderer": "py-gfm",
|
|
"hard_line_breaks": false,
|
|
"block_html": false,
|
|
"created_on": "2025-01-10 09:30",
|
|
"last_modified": "2025-02-14 16:45"
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
Subdirectory manifest (`design/.wp-materialize.json`):
|
|
|
|
```json
|
|
{
|
|
"categories": { "content": ["Design"], "inherit": true },
|
|
"tags": { "content": ["ui"], "inherit": true },
|
|
"subdirectories": { "content": [], "inherit": false },
|
|
"files": {
|
|
"system.md": {
|
|
"use_heading_as_title": { "level": 1, "strict": true }
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
## Minimal (Directories Only)
|
|
|
|
```json
|
|
{
|
|
"wordpress_root": "/var/www/wordpress",
|
|
"repo_storage_dir": "/home/user/wp-materialize-repos",
|
|
"renderer": "default",
|
|
"hard_line_breaks": false,
|
|
"block_html": false,
|
|
"git_repositories": [],
|
|
"directories": [
|
|
{
|
|
"name": "local-notes",
|
|
"path": "/home/user/notes",
|
|
"root_subdir": "wordpress"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
## Git Repositories + Directories
|
|
|
|
```json
|
|
{
|
|
"wordpress_root": "/var/www/wordpress",
|
|
"repo_storage_dir": "/home/user/wp-materialize-repos",
|
|
"renderer": "default",
|
|
"hard_line_breaks": false,
|
|
"block_html": false,
|
|
"git_repositories": [
|
|
{
|
|
"name": "content-repo",
|
|
"url": "https://github.com/example/content-repo.git",
|
|
"branch": "main",
|
|
"root_subdir": "posts"
|
|
},
|
|
{
|
|
"name": "docs-repo",
|
|
"url": "git@github.com:example/docs-repo.git",
|
|
"branch": "main",
|
|
"root_subdir": null
|
|
}
|
|
],
|
|
"directories": [
|
|
{
|
|
"name": "local-notes",
|
|
"path": "/home/user/notes",
|
|
"root_subdir": "wordpress"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
## Single Git Repository
|
|
|
|
```json
|
|
{
|
|
"wordpress_root": "/var/www/wordpress",
|
|
"repo_storage_dir": "/home/user/wp-materialize-repos",
|
|
"renderer": "default",
|
|
"hard_line_breaks": false,
|
|
"block_html": false,
|
|
"git_repositories": [
|
|
{
|
|
"name": "content-repo",
|
|
"url": "https://github.com/example/content-repo.git",
|
|
"branch": "main",
|
|
"root_subdir": "posts"
|
|
}
|
|
],
|
|
"directories": []
|
|
}
|
|
```
|
|
|
|
## Timestamp Behavior Example
|
|
|
|
- `git_repositories` entries use git commit timestamps for `created_on`/`last_modified` inference.
|
|
- `directories` entries use filesystem timestamps even if the path is inside a git repo.
|
|
|
|
## Scaffold Command Examples
|
|
|
|
Create a placeholder config:
|
|
|
|
```bash
|
|
wp-materialize new --config
|
|
wp-materialize new --config /path/to/config.json
|
|
```
|
|
|
|
Create a dummy manifest:
|
|
|
|
```bash
|
|
wp-materialize new --manifest /path/to/content
|
|
```
|
|
|
|
Add a file to a manifest:
|
|
|
|
```bash
|
|
wp-materialize add-file /path/to/content/post.md
|
|
wp-materialize add-file /path/to/content/post.md /path/to/content
|
|
wp-materialize add-file /path/to/content/post.md --current
|
|
```
|
|
|
|
Add a directory to a manifest:
|
|
|
|
```bash
|
|
wp-materialize add-subdir /path/to/content/notes
|
|
wp-materialize add-subdir /path/to/content/notes /path/to/content
|
|
wp-materialize add-subdir /path/to/content/notes --current
|
|
```
|