Skip to content

Commit

Permalink
Document what I've done so far
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldfallen committed Aug 7, 2017
1 parent 5901cc4 commit 6d75bfb
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Look and Feel

GOV.UK look and feel as a single easy import (at least that's the goal).

## Usage

To use look-and-feel first add it to your `package.json`:

> yarn add @hmcts/look-and-feel

Then configure it in your `app.js`:

const express = require('express');
const app = express();
...
const lookAndFeel = require('@hmcts/look-and-feel');
lookAndFeel.configure(app);
...

## Documentation

All documentation is stored in the [docs] folder.

## Development

We use the [Dockerfile] and [docker-compose.yml] to create a development
container used for running tests, etc.

To start the container run:

```
make
```

Once complete you will be dropped in to a shell where you can run `yarn`.

[Dockerfile]:https://github.com/hmcts/nodejs-one-per-page/blob/master/Dockerfile
[docker-compose.yml]:https://github.com/hmcts/nodejs-one-per-page/blob/master/docker-compose.yml
7 changes: 7 additions & 0 deletions docs/README.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Documentation

## Configuration

- [Configuring views][views]

[views]:https://github.com/hmcts/look-and-feel/blob/master/docs/configuration/configuring-views

This comment has been minimized.

Copy link
@iguannago

iguannago Nov 14, 2017

Contributor

Hi @michaeldfallen, looks like this link is broken...nice work!

38 changes: 38 additions & 0 deletions docs/configuration/configuring-views.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Configuring Views

Look-and-feel will by default configure express so that it can load the GOV.UK
templates and partials.

In order to configure express so it has access to your apps views you have two
options: [Standard express views setting] or [Explicitly set views settings].

## Standard express views setting

Configure your views folders in the standard express way:

```
const app = express();
app.set('views', [path.resolve(__dirname, 'views')]);
lookAndFeel.configure(app);
```

Be sure to set the views before you configure look-and-feel. If you set the
views after configuring look-and-feel you'll only overwrite the settings that
look-and-feel has set.

## Explicitly set views settings

When configuring look-and-feel you can pass in the views folders you want
express to look for your templates in:

```
const app = express();
lookAndFeel.configure(app, {
express: {
views: [path.resolve(__dirname, 'views')]
}
});
```

[Standard express views setting]: #standard-express-views-setting
[Explicitly set views settings]: #explicitly-set-views-settings

0 comments on commit 6d75bfb

Please sign in to comment.