Template repositories#
A template repository is a git repository (or local directory) that contains one or more Cookieplone templates. Cookieplone clones or copies the repository, reads its manifest, and presents the available templates to you.
Repository manifest#
Every template repository must contain a cookiecutter.json file at its root.
This root manifest is different from the per-template schema files—it describes the repository, not a single template.
{
"templates": {
"project": {
"path": "./templates/project",
"title": "A Plone project",
"description": "Full Plone project with backend and frontend."
},
"addon": {
"path": "./templates/addon",
"title": "A Plone add-on",
"description": "Minimal installable Plone add-on."
}
}
}
Each entry under templates has:
Key |
Required |
Description |
|---|---|---|
|
yes |
Relative path from the repository root to the template directory. |
|
yes |
Short name shown in the selection menu. |
|
yes |
One-sentence description shown under the title. |
|
no |
When |
Directory layout#
my-templates/
├── cookiecutter.json # repository manifest
└── templates/
├── project/ # a full template
│ ├── cookieplone.json # template schema (v2)
│ ├── hooks/
│ │ └── pre_prompt.py
│ └── {{cookiecutter.project_slug}}/
│ └── ...
└── addon/
├── cookieplone.json
└── {{cookiecutter.python_package_name}}/
└── ...
Each sub-directory listed in the manifest is an independent Cookiecutter template with its own schema file and optional hooks/ directory.
Supported source types#
Cookieplone accepts any of these repository sources:
Source |
Example |
|---|---|
Git URL (HTTPS) |
|
Git URL (SSH) |
|
GitHub abbreviation |
|
GitLab abbreviation |
|
Bitbucket abbreviation |
|
Local directory |
|
Zip archive (URL or path) |
|
Set the source via COOKIEPLONE_REPOSITORY or the positional template argument combined with a repository override.
Template discovery#
When Cookieplone starts, it:
Resolves and clones the repository.
Reads the root
cookiecutter.json.Builds the list of templates from the
templateskey.Filters out hidden templates unless
--allis passed.Presents the remaining templates in the order they appear in the manifest.