Skip to content

Move templates to a /templates folder #186

@ericof

Description

@ericof

Requires Cookieplone #88 to be merged and released.

Current situation

  • Every template is at the root of the cookieplone-templates repository
  • Soon we will start having issues when new templates are added to the repository
    • A docs folder at the root of the repository is a template or the real documentation?
    • A news folder at the root of the repository is a template or something else?
  • Organization in folders and sub folders will help us maintain the templates in the long run

Proposed organization

Have a /templates/ top level folder with a sub folder structure similar to:

  • projects
    • monorepo
    • classic
  • sub
    • cache
    • settings
  • add-ons
    • monorepo
    • backend
    • frontend
  • distributions
    • monorepo
  • devops
  • ...

Move all tests to the /tests top-level folder:

  • Organize tests in sub-folders similar to the code structure
  • Allow reuse of fixtures
    • cutter-result would be defined once for all templates

Impacts

  • For the end user:
    • Nothing changes
  • For template developers:
    • Move tests from the template folder to the top-level /tests folder
    • Usage of sub-templates should always mention the full path to the template
   TEMPLATES_FOLDER = "templates"
    generator.generate_subtemplate(
        f"{TEMPLATES_FOLDER}/add-ons/frontend",
        output_dir,
        "frontend",
        context,
        FRONTEND_ADDON_REMOVE,
    )

Metadata

Metadata

Assignees

Labels

Projects

  • Status

    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions