Skip to content

Commit aa5fdea

Browse files
ericofstevepiercy
andauthored
Ensure references to the repository url are consistent across all templates (#223)
* Ensure references to the repository url are consistent across all templates (Fixes #221) * Apply suggestions from code review Co-authored-by: Steve Piercy <[email protected]> * Apply suggestions from code review Co-authored-by: Steve Piercy <[email protected]> * Apply suggestions from code review Co-authored-by: Steve Piercy <[email protected]> * Reorder instructions for Volto installation * Properly indent code blocks to belong to their list items * GitHub UI wouldn't allow the suggestion to be committed, so manual it is * Fix tests * Apply suggestions from code review Co-authored-by: Steve Piercy <[email protected]> * Update templates/sub/project_settings/{{ cookiecutter.__folder_name }}/backend/README.md Co-authored-by: Steve Piercy <[email protected]> * Update templates/sub/project_settings/cookiecutter.json Co-authored-by: Steve Piercy <[email protected]> --------- Co-authored-by: Steve Piercy <[email protected]>
1 parent b3ec87f commit aa5fdea

File tree

65 files changed

+679
-141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+679
-141
lines changed

news/221.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Standardize usage of the repository URLs in templates. @ericof

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "Collection of templates for Plone integrators to use through Cook
55
readme = "README.md"
66
requires-python = ">=3.10"
77
dependencies = [
8-
"cookieplone>=0.9.6",
8+
"cookieplone>=0.9.7",
99
"gitpython>=3.1.43",
1010
"pytest>=8.3.5",
1111
"pytest-cookies>=0.7.0",

templates/add-ons/backend/cookiecutter.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"initialize_documentation": ["1", "0"],
1313
"__project_slug": "{{ cookiecutter.python_package_name }}",
1414
"__repository_url": "https://github.com/{{ cookiecutter.github_organization }}/{{ cookiecutter.__project_slug }}",
15+
"__repository_git": "[email protected]:{{ cookiecutter.github_organization }}/{{ cookiecutter.__project_slug }}",
1516
"__feature_headless": "{{ cookiecutter.feature_headless }}",
1617
"__feature_distribution": "0",
1718
"__package_path": "{{ cookiecutter.python_package_name | package_path }}",
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""Pre generation hook."""
2+
3+
from collections import OrderedDict
4+
from pathlib import Path
5+
6+
output_path = Path().resolve()
7+
8+
context: OrderedDict = {{cookiecutter}}
9+
10+
11+
def main():
12+
"""Validate context."""
13+
pass
14+
15+
16+
if __name__ == "__main__":
17+
main()

templates/add-ons/backend/{{ cookiecutter.__folder_name }}/README.md

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,36 @@ And to create the Plone site:
2020
make create-site
2121
```
2222

23-
## Add features using `plonecli` or `bobtemplates.plone`
23+
## Contribute
24+
25+
- [Issue tracker]({{ cookiecutter.__repository_url }}/issues)
26+
- [Source code]({{ cookiecutter.__repository_url }}/)
27+
28+
### Prerequisites ✅
29+
30+
- An [operating system](https://6.docs.plone.org/install/create-project-cookieplone.html#prerequisites-for-installation) that runs all the requirements mentioned.
31+
- [uv](https://6.docs.plone.org/install/create-project-cookieplone.html#uv)
32+
- [Make](https://6.docs.plone.org/install/create-project-cookieplone.html#make)
33+
- [Git](https://6.docs.plone.org/install/create-project-cookieplone.html#git)
34+
- [Docker](https://docs.docker.com/get-started/get-docker/) (optional)
35+
36+
### Installation 🔧
37+
38+
1. Clone this repository, then change your working directory.
39+
40+
```shell
41+
git clone {{ cookiecutter.__repository_git }}.git
42+
cd {{ cookiecutter.__project_slug }}
43+
```
44+
45+
2. Install this code base.
46+
47+
```shell
48+
make install
49+
```
50+
51+
52+
### Add features using `plonecli` or `bobtemplates.plone`
2453

2554
This package provides markers as strings (`<!-- extra stuff goes here -->`) that are compatible with [`plonecli`](https://github.com/plone/plonecli) and [`bobtemplates.plone`](https://github.com/plone/bobtemplates.plone).
2655
These markers act as hooks to add all kinds of subtemplates, including behaviors, control panels, upgrade steps, or other subtemplates from `plonecli`.
@@ -48,11 +77,6 @@ You can check the list of available subtemplates in the [`bobtemplates.plone` `R
4877
See also the documentation of [Mockup and Patternslib](https://6.docs.plone.org/classic-ui/mockup.html) for how to build the UI toolkit for Classic UI.
4978
```
5079

51-
## Contribute
52-
53-
- [Issue Tracker]({{ cookiecutter.__repository_url }}/issues)
54-
- [Source Code]({{ cookiecutter.__repository_url }}/)
55-
5680
## License
5781

5882
The project is licensed under GPLv2.

templates/add-ons/backend/{{ cookiecutter.__folder_name }}/src/packagename/locales/__main__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
"""Update locales."""
22

3-
from pathlib import Path
4-
53
import logging
64
import re
75
import subprocess
8-
6+
from pathlib import Path
97

108
logger = logging.getLogger("i18n")
119
logger.setLevel(logging.DEBUG)
@@ -17,7 +15,7 @@
1715
target_path = locale_path.parent.resolve()
1816
domains = [path.name[:-4] for path in locale_path.glob("*.pot")]
1917

20-
i18ndude = "uv run i18ndude"
18+
i18ndude = "uvx i18ndude"
2119

2220
# ignore node_modules files resulting in errors
2321
excludes = '"*.html *json-schema*.xml"'

templates/add-ons/documentation_starter/cookiecutter.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
"email": "[email protected]",
66
"github_organization": "collective",
77
"initialize_git": ["1", "0"],
8-
"plone_version": "6.0",
98
"__folder_name": "{{ cookiecutter.github_organization|lower }}.{{ cookiecutter.title|replace(' ', '')|replace('-', '_')|replace('.', '')|lower }}",
109
"__normalized_package_name": "{{ cookiecutter.title|replace(' ', '')|replace('-', '_')|replace('.', '')|lower }}",
10+
"__project_slug": "{{ cookiecutter.__normalized_package_name }}",
11+
"__repository_url": "https://github.com/{{ cookiecutter.github_organization }}/{{ cookiecutter.__project_slug }}",
12+
"__repository_git": "[email protected]:{{ cookiecutter.github_organization }}/{{ cookiecutter.__project_slug }}",
1113
"__year": "{% now 'local', '%Y' %}",
12-
"__profile_language": "en",
13-
"__version_package": "1.0.0a0",
1414
"__generator_date_long": "{% now 'utc', '%Y-%m-%d %H:%M:%S' %}",
1515
"__generator_signature": "This was generated by the [cookieplone-templates documentation_starter template](https://github.com/plone/cookieplone-templates/tree/main/documentation_starter) on {{ cookiecutter.__generator_date_long }}",
1616
"__documentation_starter_format": "1",
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""Pre generation hook."""
2+
3+
from collections import OrderedDict
4+
from pathlib import Path
5+
6+
output_path = Path().resolve()
7+
8+
context: OrderedDict = {{cookiecutter}}
9+
10+
11+
def main():
12+
"""Validate context."""
13+
pass
14+
15+
16+
if __name__ == "__main__":
17+
main()

templates/add-ons/documentation_starter/{{cookiecutter.__folder_name}}/.gitignore renamed to templates/add-ons/documentation_starter/{{ cookiecutter.__folder_name }}/.gitignore

File renamed without changes.

templates/add-ons/documentation_starter/{{cookiecutter.__folder_name}}/.readthedocs.yaml renamed to templates/add-ons/documentation_starter/{{ cookiecutter.__folder_name }}/.readthedocs.yaml

File renamed without changes.

0 commit comments

Comments
 (0)