govuk_template 0.18.0 → 0.18.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -147
- data/app/assets/stylesheets/govuk-template-ie6.css.erb +4 -0
- data/app/assets/stylesheets/govuk-template-ie7.css.erb +4 -0
- data/app/assets/stylesheets/govuk-template-ie8.css.erb +4 -0
- data/app/assets/stylesheets/govuk-template-print.css.erb +1 -4
- data/app/assets/stylesheets/govuk-template.css.erb +4 -0
- data/lib/govuk_template/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6e484ae9e00e90fab21d3c7c3c54fa82f636e01
|
4
|
+
data.tar.gz: e059bd4b907013b55e89631fd8111c83a9e6bbc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9dfbb45f3585cfa414d6d5035dc991dec14abb8d84a09823fb0905a9bf8f11ca9a531cbe038ea9483d6c7bbfb0444fda4b8dfe0f7fa4f542bd7d90c4b03cd1d4
|
7
|
+
data.tar.gz: a7126a6afc092ab3d18bf0b77cb5021ffea439ef27c42644f750939fa0929816b5cf07adf98461d04cea98754abe95110a90203beac76e9bf5a95c7345ecf414
|
data/README.md
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
-
#
|
1
|
+
# GOV.UK Template
|
2
2
|
|
3
|
-
This provides a template containing the GOV.UK header and footer, and associated assets.
|
3
|
+
This provides a template containing the GOV.UK header and footer, and associated assets. It provides a consistent GOV.UK brand experience across `www.gov.uk` and all services running under the `service.gov.uk` domain.
|
4
|
+
|
5
|
+
The template is built from [`source`](source/) files, and multiple packages are generated to support different languages and frameworks.
|
6
|
+
|
7
|
+
Packages are available for [RubyGems](https://rubygems.org/gems/govuk_template), NPM ([mustache](https://npmjs.org/package/govuk_template_mustache), [ejs](https://npmjs.org/package/govuk_template_ejs), [jinja](https://npmjs.org/package/govuk_template_jinja)), and other [templating languages](docs/packaging.md).
|
4
8
|
|
5
|
-
This is versioned following [Semantic Versioning](http://semver.org).
|
6
9
|
|
7
10
|
## Previewing the template
|
8
11
|
|
@@ -12,155 +15,19 @@ You can [view a collection of auto-generated examples](http://alphagov.github.io
|
|
12
15
|
|
13
16
|
The Ruby language (1.9.3+), the build tool [Rake](http://rake.rubyforge.org/) & the dependancy management tool [Bundler](http://bundler.io/)
|
14
17
|
|
15
|
-
##
|
16
|
-
|
17
|
-
At present this generates 9 output formats:
|
18
|
-
|
19
|
-
1. a gem containing a Rails engine
|
20
|
-
2. a tarball containing Play Framework templates
|
21
|
-
3. a folder containing Mustache templates
|
22
|
-
4. a tarball containing Liquid templates
|
23
|
-
5. a tarball containing Mustache Inheritance templates
|
24
|
-
6. a tarball containing Jinja templates
|
25
|
-
7. a tarball containing plain HTML and assets
|
26
|
-
8. a tarball containing EJS (Embedded JavaScript) templates
|
27
|
-
9. a JAR file containing assets (but no templates) structured as per [WebJars](http://www.webjars.org/)
|
28
|
-
10. a tarball containing Django templates
|
29
|
-
|
30
|
-
### Gem version
|
31
|
-
|
32
|
-
This is available on rubygems.org. To use it, add this line to your application's Gemfile:
|
33
|
-
|
34
|
-
gem 'govuk_template'
|
35
|
-
|
36
|
-
And then execute:
|
37
|
-
|
38
|
-
$ bundle
|
39
|
-
|
40
|
-
You can then use the `govuk_template` layout in your app. If you need to extend the layout you can use [nested layouts](http://guides.rubyonrails.org/layouts_and_rendering.html#using-nested-layouts).
|
41
|
-
|
42
|
-
### Play version
|
43
|
-
|
44
|
-
To generate the tarball of Play Framework templates run `bundle exec rake build:play`. This will produce a tarball in the `pkg` directory.
|
45
|
-
|
46
|
-
### Mustache version
|
47
|
-
|
48
|
-
To generate the folder of Mustache templates run `bundle exec rake build:mustache`. This will produce a folder in the `pkg` directory.
|
49
|
-
|
50
|
-
### Liquid version
|
51
|
-
|
52
|
-
To generate the folder of Liquid templates run `bundle exec rake build:liquid`. This will produce a tarball in the `pkg` directory.
|
53
|
-
|
54
|
-
### Mustache Inheritance version
|
55
|
-
|
56
|
-
There is a [proposal for Mustache to support template inheritance](https://github.com/mustache/spec/issues/38) this is supported in both the `mustache.java` and the `hogan.js` implementations of Mustache.
|
57
|
-
|
58
|
-
To generate the tarball of the Mustache Inheritance templates run the `build:mustache_inheritance` rake task. This will produce a tarball in the `pkg` directory.
|
59
|
-
|
60
|
-
### Jinja version
|
61
|
-
|
62
|
-
To generate the folder of Jinja templates run `bundle exec rake build:jinja`. This will produce a tarball in the `pkg` directory.
|
63
|
-
|
64
|
-
### Tarball version
|
65
|
-
|
66
|
-
To generate the tarball, run the `bundle exec rake build:tar`. This will produce a tarball in the `pkg` directory.
|
67
|
-
|
68
|
-
### Embedded JavaScript version
|
69
|
-
|
70
|
-
To generate the folder of Embedded JavaScript templates run `bundle exec rake build:ejs`. This will produce a tarball in the `pkg` directory.
|
71
|
-
|
72
|
-
### WebJar version
|
73
|
-
|
74
|
-
To generate a JAR file of assets in WebJar format run `bundle exec rake build:webjar`. This will produce a JAR file in the `pkg` directory.
|
75
|
-
|
76
|
-
### Django version
|
18
|
+
## Detailed Docs
|
77
19
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
Accepted contributions (pull requests merged into master) will run builds for the Gem, Play and Mustache versions. These will then update the following:
|
83
|
-
|
84
|
-
* RubyGems.org
|
85
|
-
* [alphagov/govuk_template_play](https://github.com/alphagov/govuk_template_play)
|
86
|
-
* [alphagov/govuk_template_mustache](https://github.com/alphagov/govuk_template_mustache) which updates the [npm package](https://npmjs.org/package/govuk_template_mustache)
|
87
|
-
* [alphagov/govuk_template_ejs](https://github.com/alphagov/govuk_template_ejs) which updates the [npm package](https://npmjs.org/package/govuk_template_ejs)
|
88
|
-
|
89
|
-
|
90
|
-
## Development
|
91
|
-
|
92
|
-
The source files are in the `/source` directory. The `compile` rake task builds the `/app` contents from these sources. This process involves the following:
|
93
|
-
|
94
|
-
* compiling all stylesheets referenced in `/manifests.yml` to plain CSS (actually css.erb, so the Rails asset pipeline can work in the gem).
|
95
|
-
* combining all JavaScript files referenced in `/manifests.yml` (using Sprockets)
|
96
|
-
* copying the images across (including any needed images from the toolkit)
|
97
|
-
|
98
|
-
This resulting app directory is included in the gem and hooked in as a Rails engine
|
99
|
-
|
100
|
-
### Extra details for the tarball build
|
101
|
-
|
102
|
-
The tarball build process takes the compiled template and assets from the `/app` directory, and performs some extra processing:
|
103
|
-
|
104
|
-
* it compiles the `*.css.erb` files to plain CSS, replacing all calls to `asset_path` with the relative path to the asset.
|
105
|
-
For this reason, all assets referenced in the stylesheets must be stored relative to the stylesheet.
|
106
|
-
* it compiles the erb layout to plain html.
|
107
|
-
* All `asset_path` calls are replaced by the the path to the assets, assuming the assets folder is served from /assets
|
108
|
-
* Any `content_for?` calls are assumed to return false
|
109
|
-
* yields in the template are removed except for the main layout one which is replaced with an HTML comment.
|
110
|
-
|
111
|
-
See the `TemplateProcessor` class for details of this implementation.
|
112
|
-
|
113
|
-
|
114
|
-
### Testing
|
115
|
-
|
116
|
-
Run the tests with:
|
117
|
-
|
118
|
-
bundle exec rake
|
119
|
-
|
120
|
-
The integration tests are run separately with:
|
121
|
-
|
122
|
-
bundle exec rake integration_tests
|
123
|
-
|
124
|
-
For more details, see [integration_tests/README.md](integration_tests/README.md).
|
20
|
+
* [Development](docs/development.md)
|
21
|
+
* [Packaging](docs/packaging.md)
|
22
|
+
* [Publishing](docs/publishing.md)
|
125
23
|
|
126
24
|
## Usage
|
127
25
|
|
128
|
-
|
129
|
-
|
130
|
-
The [govuk_template sets a skip link](https://github.com/alphagov/govuk_template/blob/master/source/views/layouts/govuk_template.html.erb#L64-L68) to `#content`, but doesn't provide an element with `id="content"`. You'll need to add `id="content"` to your main content area, to ensure the skip link will work.
|
131
|
-
|
132
|
-
### Propositional title and navigation
|
133
|
-
|
134
|
-
You can get a propositional title and navigation by setting the content for `header_class` to `with-proposition` and `proposition_header` in the form:
|
135
|
-
|
136
|
-
<div class="header-proposition">
|
137
|
-
<div class="content">
|
138
|
-
<a href="#proposition-links" class="js-header-toggle menu">Menu</a>
|
139
|
-
<nav id="proposition-menu">
|
140
|
-
<a href="/" id="proposition-name">Service Name</a>
|
141
|
-
<ul id="proposition-links">
|
142
|
-
<li><a href="url-to-page-1" class="active">Navigation item #1</a></li>
|
143
|
-
<li><a href="url-to-page-2">Navigation item #2</a></li>
|
144
|
-
</ul>
|
145
|
-
</nav>
|
146
|
-
</div>
|
147
|
-
</div>
|
148
|
-
|
149
|
-
This will then create a navigation block which is shown on desktop sized devices but collapsed down on smaller screens.
|
150
|
-
|
151
|
-
For menus with only one item, the collapsible functionality is not necessary, it is recommended that you use the following markup
|
152
|
-
|
153
|
-
<div class='header-proposition'>
|
154
|
-
<div class='content'>
|
155
|
-
<nav id='proposition-menu'>
|
156
|
-
<a href='/' id='proposition-name'>Service Name</a>
|
157
|
-
<p id='proposition-link'>
|
158
|
-
<a href='url-to-page-1'>Navigation item #1</a>
|
159
|
-
</p>
|
160
|
-
</nav>
|
161
|
-
</div>
|
162
|
-
</div>
|
26
|
+
* [Setting a Skip link](docs/usage.md#skip-link)
|
27
|
+
* [Propositional title and navigation](docs/usage.md#propositional-title-and-navigation)
|
163
28
|
|
164
29
|
## Contributing
|
165
30
|
|
166
31
|
Please follow the [contribution guidelines](https://github.com/alphagov/govuk_template/blob/master/CONTRIBUTING.md).
|
32
|
+
|
33
|
+
This is versioned following [Semantic Versioning](http://semver.org).
|
@@ -258,6 +258,10 @@ input[type="search"]::-webkit-search-decoration {
|
|
258
258
|
.visuallyhidden {
|
259
259
|
position: absolute;
|
260
260
|
left: -9999em;
|
261
|
+
top: auto;
|
262
|
+
width: 1px;
|
263
|
+
height: 1px;
|
264
|
+
overflow: hidden;
|
261
265
|
/*
|
262
266
|
* Extends the .visuallyhidden class to allow the element to be
|
263
267
|
* focusable when navigated to via the keyboard
|
@@ -258,6 +258,10 @@ input[type="search"]::-webkit-search-decoration {
|
|
258
258
|
.visuallyhidden {
|
259
259
|
position: absolute;
|
260
260
|
left: -9999em;
|
261
|
+
top: auto;
|
262
|
+
width: 1px;
|
263
|
+
height: 1px;
|
264
|
+
overflow: hidden;
|
261
265
|
/*
|
262
266
|
* Extends the .visuallyhidden class to allow the element to be
|
263
267
|
* focusable when navigated to via the keyboard
|
@@ -249,6 +249,10 @@ input[type="search"]::-webkit-search-decoration {
|
|
249
249
|
.visuallyhidden {
|
250
250
|
position: absolute;
|
251
251
|
left: -9999em;
|
252
|
+
top: auto;
|
253
|
+
width: 1px;
|
254
|
+
height: 1px;
|
255
|
+
overflow: hidden;
|
252
256
|
/*
|
253
257
|
* Extends the .visuallyhidden class to allow the element to be
|
254
258
|
* focusable when navigated to via the keyboard
|
@@ -37,10 +37,7 @@ body {
|
|
37
37
|
a, a:visited {
|
38
38
|
word-wrap: break-word; }
|
39
39
|
|
40
|
-
a[href^="/"]:after
|
41
|
-
content: " (https://www.gov.uk" attr(href) ")";
|
42
|
-
font-size: 90%; }
|
43
|
-
|
40
|
+
a[href^="/"]:after,
|
44
41
|
a[href^="http://"]:after,
|
45
42
|
a[href^="https://"]:after {
|
46
43
|
content: " (" attr(href) ")";
|
@@ -253,6 +253,10 @@ input[type="search"]::-webkit-search-decoration {
|
|
253
253
|
.visuallyhidden {
|
254
254
|
position: absolute;
|
255
255
|
left: -9999em;
|
256
|
+
top: auto;
|
257
|
+
width: 1px;
|
258
|
+
height: 1px;
|
259
|
+
overflow: hidden;
|
256
260
|
/*
|
257
261
|
* Extends the .visuallyhidden class to allow the element to be
|
258
262
|
* focusable when navigated to via the keyboard
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.18.
|
4
|
+
version: 0.18.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Tomlins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|