GOV.UK static files and resources
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app Merge pull request #1509 from alphagov/linting-improvements Sep 13, 2018
bin Update boilerplate to Rails 5.1 Aug 8, 2017
config Add a warning about dynamic template path Aug 3, 2018
db convert static to a rails app in order to use asset pipeline and helpers Dec 4, 2011
doc Add support for surveys having multiple URLs Sep 6, 2018
lib Move the routes out of the rake task blocks Aug 31, 2018
log added asset helper to all the css files Dec 4, 2011
public Add Bing site verification page Jul 21, 2017
script Remove document footer component May 22, 2018
spec/javascripts Add support for surveys having multiple URLs Sep 6, 2018
test Fix linting errors Sep 17, 2018
tmp Add tmp/.gitkeep. Jan 4, 2012
vendor/assets/stylesheets Remove unused vendor/plugins folder Sep 11, 2015
.dockerignore Add Dockerfile and .dockerignore Nov 22, 2016
.gitignore Cookie based tokens for entry/success + test protection Oct 9, 2012
.ruby-version Bump to ruby-2.5.1 May 29, 2018
CONTRIBUTING.md Updates README and CONTRIBUTING ref image optimisation Oct 30, 2014
Dockerfile Bump to ruby-2.5.1 May 29, 2018
Gemfile Bump govuk_publishing_components from 9.22.0 to 9.23.0 Sep 19, 2018
Gemfile.lock Bump govuk_publishing_components from 9.22.0 to 9.23.0 Sep 19, 2018
Jenkinsfile Set rubyLintDiff to false in the Jenkinsfile Aug 31, 2018
LICENCE Update LICENCE Mar 6, 2015
Procfile Use foreman to run application in docker environment Feb 16, 2018
README.md Remove components Jun 20, 2018
Rakefile convert static to a rails app in order to use asset pipeline and helpers Dec 4, 2011
app.json Set heroku env vars in config rather than Procfile Feb 16, 2018
config.ru Fix the linting problems May 8, 2017
startup.sh Startup script for static app Jan 31, 2012

README.md

Static

This application defines global templates for GOV.UK pages.

Screenshots

screenshot

Nomenclature

  • slimmer - Rack middleware for wrapping Rack applications in shared templated layouts

Technical documentation

Running the application

./startup.sh

This will start the server running on http://0.0.0.0:3013

Running Locally

If you'd like to run static locally, and keep all its asset links pointing to the same local instance, you'll need to set PLEK_SERVICE_STATIC_URI, which is the host used for static assets (even on static).

Otherwise it defaults to static.dev.gov.uk, which won't exist if you're just running this repo locally, without the rest of the GOV.UK stack.

To run this app locally, and have it point at its own assets, run it like this:

PLEK_SERVICE_STATIC_URI=0.0.0.0:3013 ./startup.sh

If you're making front end changes to static and testing them out on your development VM, you may find that it takes several minutes for changes to appear due to caching in Slimmer. One approach to speed this up is to run all of the relevant app's dependencies (including static), then start that app separately. Restarting the app should pick up the changes.

For example, to see changes made to static templates which are wrapped around feedback pages, run bowl feedback --without=feedback in one terminal and the .startup.sh script for feedback in a separate terminal. Following local edits to static, restarting just feedback should be sufficient.

Running the test suite

bundle exec rake runs the test suite.

Javascript unit tests

Tests can run in browser at /specs

Or in terminal to run only the jasmine tests you can use RAILS_ENV=test bundle exec rake spec:javascript