Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Latest commit

 

History

History
36 lines (24 loc) · 1.17 KB

2021-06-09-jinja-twolevel.md

File metadata and controls

36 lines (24 loc) · 1.17 KB

Use a two-folder-level split for Jinja templates

  • Status: approved
  • Last Updated: 2021-06-09
  • Objective: Organize jinja templates in website

Context & Problem Statement

Template organization is an important element for contributor discoverability.

Decision

In order to organize our Jinja HTML templates, we decided to use a two-level folder level split. This will be combined with Jinja inheritance (i.e. the extends clause) for common components where possible.

Concretely, our templates file architecture might look like this:

website/
  templates/
    campaigns/
      view_campaign.html
      create_or_edit_campaign.html
    users/
      view_user.html
    ...

Templates often mirror API actions (create, read, update, delete, etc). Since the API itself is organized by data types (e.g. users, donations, causes, etc), we saw it fit to mirror that information hierarchy here.

Expected Consequences

This organization will not scale well to a significant number of templates. In that case, a more complex hierarchy will need to be created.

Links