Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor and expand Nunjucks templates #106

Open
wants to merge 1 commit into
base: feature/scope-repositories-by-org
Choose a base branch
from

Conversation

danlivings-dxw
Copy link
Contributor

Express introduces the concept of views and rendering, which simplifies the process of producing an HTML response. It's straightforward to use Nunjucks as the rendering engine as the nunjucks.render method has the same signature as the callback passed to Express.engine.

The views/ folder is now the location in which Nunjucks templates should be stored, and it currently contains:

  • _base.njk: the base template that all others should inherit from. It sets up the basic structure and styling.
  • _macros.njk: basic repeatable utilities.
  • index.njk: Originally the dashboard, this has now been repurposed to display a list of organisations that the logged in user has access to in preparation for authentication being implemented.
  • login.njk: The login page. This will be displayed to the user by default if they are not logged in. It can be configured to offer either GitHub logins or username/password logins (or both).
  • org-dashboard.njk: The original dashboard template, repurposed to allow scoping by individual organisation.
  • 404.njk: The page displayed when the server has no route defined for the requested URL.

Express introduces the concept of views and rendering, which simplifies
the process of producing an HTML response. It's straightforward to use
Nunjucks as the rendering engine as the `nunjucks.render` method has the
same signature as the `callback` passed to `Express.engine`.

The `views/` folder is now the location in which Nunjucks templates
should be stored, and it currently contains:
- `_base.njk`: the base template that all others should inherit from. It
  sets up the basic structure and styling.
- `_macros.njk`: basic repeatable utilities.
- `index.njk`: Originally the dashboard, this has now been repurposed to
  display a list of organisations that the logged in user has access to
  in preparation for authentication being implemented.
- `login.njk`: The login page. This will be displayed to the user by
  default if they are not logged in. It can be configured to offer
  either GitHub logins or username/password logins (or both).
- `org-dashboard.njk`: The original dashboard template, repurposed to
  allow scoping by individual organisation.
- `404.njk`: The page displayed when the server has no route defined for
  the requested URL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant