README.md 3.41 KB
Newer Older
khawkins98's avatar
khawkins98 committed
1 2
[![Build Status](https://travis-ci.org/ebiwd/EBI-Corporatesite.svg?branch=master)](https://travis-ci.org/ebiwd/EBI-Corporatesite)

3
# EBI 'Corporate site' static pages
Ken Hawkins's avatar
Ken Hawkins committed
4

5
Static pages for the main www.ebi.ac.uk 'corporate' site.
khawkins98's avatar
khawkins98 committed
6

7 8 9 10 11 12 13 14 15 16 17
The pages in this repository will be served as static files (they won't be served with Drupal).

## Why?

Some pages are better served as plain .html files and not through Drupal when:

1. They have very unique layouts (like the front page)
2. There is a need for more speed
3. They are unique and don't have much reusable content (travel page)
4. There is a lot "application" functionality (Services page)

Ken Hawkins's avatar
Ken Hawkins committed
18
Content from the Drupal site can still be used on static pages through dynamic JavaScript content (i.e. a news feed).
19 20 21 22 23

## Making changes to pages

You will need access to the Github repo to make edits (ask your friendly web-dev colleague).

khawkins98's avatar
khawkins98 committed
24
1. Making development edits: All commits will be built and deployed to the EBI wwwdev server.
25 26 27 28 29
2. Edits to live site: "tagged" releases will be sent to the production server (this is currently limited to web dev staff).

# Code structure, developing the fonts

## Code structure
Ken Hawkins's avatar
Ken Hawkins committed
30

khawkins98's avatar
khawkins98 committed
31 32 33
Source files are in /src, they map like so:

```
Ken Hawkins's avatar
Ken Hawkins committed
34 35 36 37
          Source                      Optimised                    Deployed
          ------                      ---------                    --------
Front:    src/index.html           >  dist/index.html           >  www.ebi.ac.uk/
Training: src/training/index.html  >  dist/training/index.html  >  www.ebi.ac.uk/training
khawkins98's avatar
khawkins98 committed
38 39
```

40 41 42 43 44
## Use of branches

We use [Gitlab's CI service* to build the assets](https://gitlab.ebi.ac.uk/ebiwd/EBI-Corporatesite/blob/master/.gitlab-ci.yml); here's the branch structure:

- main: Source code that will be pulled into EBI's Gitlab server for gulp compilation and distribution
Ken Hawkins's avatar
Ken Hawkins committed
45

46
* This Gitlab instance is only accessible from the EBI network.
Ken Hawkins's avatar
Ken Hawkins committed
47

48
### Versioning
Ken Hawkins's avatar
Ken Hawkins committed
49 50

We use semantic versioning style of releases.
Ken Hawkins's avatar
Ken Hawkins committed
51

52 53 54
| Major release | Minor release | Note |
| ------------- | ------------- | ---- |
| (Branch)      | (Tag)         | |
Ken Hawkins's avatar
Ken Hawkins committed
55
| master        | .0            | Initial release  |
56
| master        | .1            | Tagged minor release |
Ken Hawkins's avatar
Ken Hawkins committed
57

58
### Test changes
Ken Hawkins's avatar
Ken Hawkins committed
59

60
More radical changes should be done on a feature branch.
Ken Hawkins's avatar
Ken Hawkins committed
61

Ken Hawkins's avatar
Ken Hawkins committed
62 63 64 65
## Developing content

Serve non-optimised `./src/` files from your dev environment:

66
- `yarn dev`
Ken Hawkins's avatar
Ken Hawkins committed
67

68
## Optimising the pages
Ken Hawkins's avatar
Ken Hawkins committed
69

70
If you wish to test the optimisation process on your local machine, here's what you need to do:
Ken Hawkins's avatar
Ken Hawkins committed
71

72 73 74
NOTE: Only developers would have the need do this.

1. Clone the repo
Ken Hawkins's avatar
Ken Hawkins committed
75
2. If you're using npm:
76 77
  - Install the npm instance: `yarn install`
  - Run the default gulp script: `yarn build`
Ken Hawkins's avatar
Ken Hawkins committed
78
3. If you're using Docker:
79
  - `docker run -it --rm -v $PWD:/workspace -w /workspace simonvanderveldt/node-bower-gulp:6 bash -c 'npm install --quiet && gulp'`
Ken Hawkins's avatar
Ken Hawkins committed
80

81
### What the optimisations get you
82

Ken Hawkins's avatar
Ken Hawkins committed
83 84
As measured with [WebPagetest](https://www.webpagetest.org):

85
[![alt text](assets/readme/performance-timings.png "Performance timings")](https://www.webpagetest.org/video/compare.php?tests=170508_5G_bbac80592e8a6982bb442dfce733f626,170508_66_5c3bd9d66aeb872d713be241f738dba4,170508_4X_18331d7513ef3beae9ddbfec1c8eaf0a)
Ken Hawkins's avatar
Ken Hawkins committed
86

87 88
A comparison of the above two URLs. [View the more detailed report](https://www.webpagetest.org/video/compare.php?tests=170508_5G_bbac80592e8a6982bb442dfce733f626,170508_66_5c3bd9d66aeb872d713be241f738dba4,170508_4X_18331d7513ef3beae9ddbfec1c8eaf0a)

Ken Hawkins's avatar
Ken Hawkins committed
89
### To do?
90

Ken Hawkins's avatar
Ken Hawkins committed
91 92
- Handlebars optimisations?
- Concat all external css/js?