bas-jekyll-theme-bas-style-kit 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +278 -0
- data/CONTRIBUTING.md +15 -0
- data/LICENSE.md +8 -0
- data/README.md +774 -0
- data/_config.yml +90 -0
- data/_data/bas-style-kit/bsk-css.yml +8 -0
- data/_data/bas-style-kit/bsk-js.yml +9 -0
- data/_data/bas-style-kit/bsk-vars.yml +3 -0
- data/_data/menus.yml +19 -0
- data/_includes/bas-style-kit/body.html +3 -0
- data/_includes/bas-style-kit/bsk--pattern--item-type-header.html +7 -0
- data/_includes/bas-style-kit/bsk--pattern--orcid-id.html +1 -0
- data/_includes/bas-style-kit/bsk-body--analytics-script.html +9 -0
- data/_includes/bas-style-kit/bsk-body--back-to-top.html +2 -0
- data/_includes/bas-style-kit/bsk-body--core-scripts.html +11 -0
- data/_includes/bas-style-kit/bsk-body--page-header.html +7 -0
- data/_includes/bas-style-kit/bsk-body--standard-footer.html +26 -0
- data/_includes/bas-style-kit/bsk-body--standard-header.html +17 -0
- data/_includes/bas-style-kit/bsk-body--standard.html +15 -0
- data/_includes/bas-style-kit/bsk-body--toc.html +1 -0
- data/_includes/bas-style-kit/bsk-body.html +9 -0
- data/_includes/bas-style-kit/bsk-footer--back-to-top.html +3 -0
- data/_includes/bas-style-kit/bsk-footer--contents.html +0 -0
- data/_includes/bas-style-kit/bsk-footer--governance.html +5 -0
- data/_includes/bas-style-kit/bsk-footer--is-something-wrong.html +3 -0
- data/_includes/bas-style-kit/bsk-footer--legal-policies.html +8 -0
- data/_includes/bas-style-kit/bsk-head--core-meta.html +4 -0
- data/_includes/bas-style-kit/bsk-head--core-styles.html +9 -0
- data/_includes/bas-style-kit/bsk-head--favicon.html +12 -0
- data/_includes/bas-style-kit/bsk-head--seo-meta.html +4 -0
- data/_includes/bas-style-kit/bsk-head.html +6 -0
- data/_includes/bas-style-kit/bsk-header--cookie-notice.html +9 -0
- data/_includes/bas-style-kit/bsk-header--development-phase.html +15 -0
- data/_includes/bas-style-kit/bsk-header--site-navigation.html +6 -0
- data/_includes/bas-style-kit/bsk-nav--collapse.html +4 -0
- data/_includes/bas-style-kit/bsk-nav--header.html +4 -0
- data/_includes/bas-style-kit/bsk-nav-collapse--primary-navigation.html +32 -0
- data/_includes/bas-style-kit/bsk-nav-collapse--secondary-navigation.html +20 -0
- data/_includes/bas-style-kit/bsk-nav-header--brand.html +8 -0
- data/_includes/bas-style-kit/bsk-nav-header--collapse-trigger.html +3 -0
- data/_includes/bas-style-kit/head.html +1 -0
- data/_includes/bas-style-kit/toc.html +85 -0
- data/_layouts/bas-style-kit/blank.html +4 -0
- data/_layouts/bas-style-kit/bsk--base.html +8 -0
- data/_layouts/bas-style-kit/bsk--standard-page.html +22 -0
- data/_layouts/bas-style-kit/bsk--standard.html +8 -0
- data/_layouts/bas-style-kit/html.html +8 -0
- data/_layouts/views/bas-style-kit/bsk--page-not-found.html +10 -0
- data/_layouts/views/bas-style-kit/bsk--problem-with-service.html +10 -0
- data/_layouts/views/bas-style-kit/bsk--service-unavailable.html +20 -0
- data/_layouts/views/bas-style-kit/bsk--sign-in-microsoft.html +21 -0
- data/_layouts/views/bas-style-kit/bsk--start.html +9 -0
- data/_sass/main.scss +1 -0
- data/assets/empty +1 -0
- data/screenshot.png +0 -0
- metadata +197 -0
data/README.md
ADDED
@@ -0,0 +1,774 @@
|
|
1
|
+
# BAS Style Kit Jekyll Theme
|
2
|
+
|
3
|
+
Jekyll theme for the [BAS Style Kit](https://style-kit.web.bas.ac.uk).
|
4
|
+
|
5
|
+
![Screenshot of theme](screenshot.png)
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your Jekyll site's `Gemfile`:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem "jekyll-theme-bas-style-kit"
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
```shell
|
18
|
+
$ bundle
|
19
|
+
```
|
20
|
+
|
21
|
+
Or install it yourself as:
|
22
|
+
|
23
|
+
```shell
|
24
|
+
$ gem install jekyll-theme-bas-style-kit
|
25
|
+
```
|
26
|
+
|
27
|
+
Finally, to use the theme, add this line to your `_config.yml` file:
|
28
|
+
|
29
|
+
```yaml
|
30
|
+
theme: jekyll-theme-bas-style-kit
|
31
|
+
```
|
32
|
+
|
33
|
+
## Usage
|
34
|
+
|
35
|
+
Refer to [Jekyll's theme documentation](https://jekyllrb.com/docs/themes/) for general information.
|
36
|
+
|
37
|
+
### Quick start
|
38
|
+
|
39
|
+
Add these lines to your `_config.yml` file:
|
40
|
+
|
41
|
+
```yml
|
42
|
+
bas_style_kit_jekyll_theme:
|
43
|
+
attributes:
|
44
|
+
head_title:
|
45
|
+
default: 'Example service'
|
46
|
+
appended: ' - Example service'
|
47
|
+
head_description: 'Service to act as an example'
|
48
|
+
site_brand:
|
49
|
+
text: 'Example service'
|
50
|
+
href: '/'
|
51
|
+
site_development_phase: 'beta'
|
52
|
+
site_feedback_href: '/feedback'
|
53
|
+
legal_policies:
|
54
|
+
cookies_href: '/legal/cookies'
|
55
|
+
copyright_href: '/legal/copyright'
|
56
|
+
privacy_href: '/legal/privacy'
|
57
|
+
# Optional - add a custom CSS file with a relative URL
|
58
|
+
site_styles:
|
59
|
+
-
|
60
|
+
href: '/css/main.css'
|
61
|
+
type: 'local'
|
62
|
+
# Optional - add a custom JS file with a SRI value
|
63
|
+
site_scripts:
|
64
|
+
-
|
65
|
+
href: 'https://example.com/js/example.js'
|
66
|
+
integrity: 'abc123'
|
67
|
+
type: 'remote'
|
68
|
+
# Optional - enable web analytics
|
69
|
+
site_analytics:
|
70
|
+
id: '1234'
|
71
|
+
# Optional - choose between the `bsk-container` and `bsk-container-fluid` layout container
|
72
|
+
container: 'bsk-container'
|
73
|
+
```
|
74
|
+
|
75
|
+
To optionally add navigation menu items, add these lines to `_data/menus.yml`:
|
76
|
+
|
77
|
+
```
|
78
|
+
site_navigation_primary:
|
79
|
+
- url: '#'
|
80
|
+
title: 'Item'
|
81
|
+
|
82
|
+
site_navigation_launcher:
|
83
|
+
- url: 'https://www.bas.ac.uk'
|
84
|
+
title: BAS Home
|
85
|
+
weight: 1
|
86
|
+
- url: 'https://example.com'
|
87
|
+
title: Related service
|
88
|
+
weight: 3
|
89
|
+
```
|
90
|
+
|
91
|
+
#### Standard page
|
92
|
+
|
93
|
+
To create a page in an application or website based on the standard BAS page structure, create an application layout
|
94
|
+
(e.g. `_layouts/app.html`) with the following:
|
95
|
+
|
96
|
+
```
|
97
|
+
---
|
98
|
+
layout: layouts/bas-style-kit/bsk--standard.html
|
99
|
+
---
|
100
|
+
```
|
101
|
+
|
102
|
+
To base all pages this layout add these lines to your `_config.yml` file:
|
103
|
+
|
104
|
+
```yml
|
105
|
+
defaults:
|
106
|
+
-
|
107
|
+
scope:
|
108
|
+
# An empty string here means all files in the project
|
109
|
+
path: ""
|
110
|
+
values:
|
111
|
+
layout: "app"
|
112
|
+
```
|
113
|
+
|
114
|
+
#### Use a page pattern
|
115
|
+
|
116
|
+
To create a page in an application or website based on a [page pattern](#page-patterns), create a view
|
117
|
+
(e.g. `views/error.pug`) with the following:
|
118
|
+
|
119
|
+
```html
|
120
|
+
---
|
121
|
+
layout: views/bas-style-kit/[page-pattern]
|
122
|
+
---
|
123
|
+
```
|
124
|
+
|
125
|
+
Where `[page-pattern]` in the extends value is the name of a page pattern, for example:
|
126
|
+
|
127
|
+
```html
|
128
|
+
---
|
129
|
+
layout: views/bas-style-kit/bsk--page-not-found
|
130
|
+
---
|
131
|
+
```
|
132
|
+
|
133
|
+
#### Use a component pattern
|
134
|
+
|
135
|
+
To include a [component pattern](#component-pattern), call the relevant include with an required parameters.
|
136
|
+
For example:
|
137
|
+
|
138
|
+
```
|
139
|
+
{% include bas-style-kit/bsk--pattern--item-type-header.html item_type="Item type" item_title="Item title" %}
|
140
|
+
```
|
141
|
+
|
142
|
+
### Patterns
|
143
|
+
|
144
|
+
Patterns are used to define preferred ways to pass information to users, and ask information from users, in a consistent
|
145
|
+
way. See the [Style Kit documentation](https://style-kit.web.bas.ac.uk/patterns) for more information.
|
146
|
+
|
147
|
+
There are two types of pattern used in the Style Kit and these templates:
|
148
|
+
|
149
|
+
* [pages](#page-patterns) - standalone pages designed to be used without customisation using [Views](#views)
|
150
|
+
* [components](#component-patterns) - inline elements designed to be used without customisation using
|
151
|
+
[Includes](#includes)
|
152
|
+
|
153
|
+
#### Page patterns
|
154
|
+
|
155
|
+
These template include [Views](#views) for all page patterns. In most cases all variants of a pattern use the same view,
|
156
|
+
but with different options using variables and/or page content.
|
157
|
+
|
158
|
+
See the [Style Kit documentation](https://style-kit.web.bas.ac.uk) for general information on using these patterns.
|
159
|
+
|
160
|
+
##### 'page not found' pattern
|
161
|
+
|
162
|
+
No configuration options.
|
163
|
+
|
164
|
+
##### 'service unavailable' pattern
|
165
|
+
|
166
|
+
Use page content for:
|
167
|
+
|
168
|
+
* contact information
|
169
|
+
|
170
|
+
Optionally, use page content for:
|
171
|
+
|
172
|
+
* details of alternative services
|
173
|
+
|
174
|
+
Optionally, use a `pattern_availability` page variable for setting the availability line:
|
175
|
+
|
176
|
+
* a value of `closed` will show conventional text
|
177
|
+
* a value of `replaced` will show conventional text
|
178
|
+
* no value will show conventional text
|
179
|
+
|
180
|
+
##### 'problem with this service' pattern
|
181
|
+
|
182
|
+
Use page content for:
|
183
|
+
|
184
|
+
* contact information
|
185
|
+
|
186
|
+
Optionally, use page content for:
|
187
|
+
|
188
|
+
* details of alternative services
|
189
|
+
|
190
|
+
##### 'start' pattern
|
191
|
+
|
192
|
+
Use page content for:
|
193
|
+
|
194
|
+
* a list of needs the service caters for, as a list wrapped in a section with the `bsk-service-uses` class [1]
|
195
|
+
* a call to action, as a link wrapped in a section with the `bsk-call-to-action` class [2]
|
196
|
+
* if the call to action should be a 'Sign in to start' button use [3]
|
197
|
+
* contact information, as text wrapped in a section with the `bsk-more-information` class [4]
|
198
|
+
|
199
|
+
Optionally, use page content for:
|
200
|
+
|
201
|
+
* 'before you start' information, wrapped in a section with the `bsk-before-you-start` class [5]
|
202
|
+
|
203
|
+
**Note:** If not already included via a layout, include
|
204
|
+
[Font Awesome](https://style-kit.web.bas.ac.uk/core/icons/#font-awesome) to show the ORCID symbol.
|
205
|
+
|
206
|
+
[1]
|
207
|
+
|
208
|
+
```html
|
209
|
+
<section class="bsk-service-uses">
|
210
|
+
<h2 class="bsk-h3">Use this service to:</h2>
|
211
|
+
<ul>
|
212
|
+
<li>access some information</li>
|
213
|
+
<li>perform an action</li>
|
214
|
+
<li>etc.</li>
|
215
|
+
</ul>
|
216
|
+
</section>
|
217
|
+
```
|
218
|
+
|
219
|
+
[2]
|
220
|
+
|
221
|
+
```html
|
222
|
+
<section class="bsk-call-to-action">
|
223
|
+
<a class="bsk-btn bsk-btn-primary bsk-btn-lg" href="#">
|
224
|
+
Start Now
|
225
|
+
<i class="fa-fw fas fa-chevron-right"></i>
|
226
|
+
</a>
|
227
|
+
</section>
|
228
|
+
```
|
229
|
+
|
230
|
+
[3]
|
231
|
+
|
232
|
+
```html
|
233
|
+
<section class="bsk-call-to-action">
|
234
|
+
<button class="bsk-btn bsk-btn-ms-account bsk-btn-lg">
|
235
|
+
<object class="bsk-ms-pictogram" type="image/svg+xml" data="https://cdn.web.bas.ac.uk/bas-style-kit/{{ site.data.bas-style-kit.bsk-vars.bsk_version }}/img/logos-symbols/ms-pictogram.svg"></object>
|
236
|
+
Sign in to start
|
237
|
+
<i class="fa-fw fas fa-chevron-right"></i>
|
238
|
+
</button>
|
239
|
+
<p class="bsk-sign-in-hint bsk-text-muted">Use the account you use for your NERC email to sign into this service.</p>
|
240
|
+
</section>
|
241
|
+
```
|
242
|
+
|
243
|
+
[4]
|
244
|
+
|
245
|
+
```html
|
246
|
+
<section class="bsk-more-information">
|
247
|
+
<h2 class="bsk-h3">More information</h2>
|
248
|
+
<p>Contact the <a href="#">Sample Team</a> for information and help on how to use [website or application].</p>
|
249
|
+
</section>
|
250
|
+
```
|
251
|
+
|
252
|
+
[5]
|
253
|
+
|
254
|
+
```html
|
255
|
+
<section class="bsk-before-you-start">
|
256
|
+
<h2 class="bsk-h3">Before you start</h2>
|
257
|
+
<p>You need some information to use this service.</p>
|
258
|
+
</section>
|
259
|
+
```
|
260
|
+
|
261
|
+
##### 'sign in' pattern
|
262
|
+
|
263
|
+
Use page content for:
|
264
|
+
|
265
|
+
* a call to action, as a page variable [1]
|
266
|
+
|
267
|
+
```html
|
268
|
+
---
|
269
|
+
layout: views/bas-style-kit/bsk--sign-in-microsoft
|
270
|
+
|
271
|
+
call_to_action_href: #
|
272
|
+
---
|
273
|
+
```
|
274
|
+
|
275
|
+
#### Component patterns
|
276
|
+
|
277
|
+
These templates use includes for all component patterns. Include parameters are used for customising each instance of
|
278
|
+
the component.
|
279
|
+
|
280
|
+
See the [Style Kit documentation](https://style-kit.web.bas.ac.uk) for general information on using these patterns.
|
281
|
+
|
282
|
+
##### Item type header pattern
|
283
|
+
|
284
|
+
Parameters:
|
285
|
+
|
286
|
+
* `item_type` the type or kind of thing the item is, e.g. if the item is a person, it's type is 'person'
|
287
|
+
* `item_title` a label specific to the item, e.g. if the item is a person their name
|
288
|
+
|
289
|
+
```html
|
290
|
+
{% include bas-style-kit/bsk--pattern--item-type-header.html item_type="Item type" item_title="Item title" %}
|
291
|
+
```
|
292
|
+
|
293
|
+
##### ORCID iD pattern
|
294
|
+
|
295
|
+
Parameters:
|
296
|
+
|
297
|
+
* `orcid_id` the ORCID iD of an individual as a URL
|
298
|
+
|
299
|
+
```
|
300
|
+
{% include bas-style-kit/bsk--pattern--orcid-id.html orcid_id="https://sandbox.orcid.org/0000-0001-8373-6934" %}
|
301
|
+
```
|
302
|
+
|
303
|
+
**Note:** If not already included via a layout, include
|
304
|
+
[Font Awesome](https://style-kit.web.bas.ac.uk/core/icons/#font-awesome) to show the ORCID symbol.
|
305
|
+
|
306
|
+
### Using custom CSS/JS
|
307
|
+
|
308
|
+
Support is provided for loading additional CSS an/or JavaScript resources, such as application or website specific
|
309
|
+
styling or interactivity, either as references to files.
|
310
|
+
|
311
|
+
This support is available in all layouts which inherit from the `bsk--basic.html` layout.
|
312
|
+
|
313
|
+
For file resources, variables are provided for adding URLs and optional SRI values. Files will be included in the
|
314
|
+
relevant block automatically, after the Style Kit's own resources if a Style Kit layout is used.
|
315
|
+
|
316
|
+
* CSS resources are outputted at the end of the `<head>` element
|
317
|
+
* JS resources are outputted at the end of the `<body>` element
|
318
|
+
|
319
|
+
Add these lines to your `_config.yml` file:
|
320
|
+
|
321
|
+
```yml
|
322
|
+
bas_style_kit_jekyll_theme:
|
323
|
+
attributes:
|
324
|
+
site_styles:
|
325
|
+
-
|
326
|
+
href: '/css/main.css'
|
327
|
+
type: 'local'
|
328
|
+
site_scripts:
|
329
|
+
-
|
330
|
+
href: 'https://example.com/js/example.js'
|
331
|
+
integrity: 'abc123'
|
332
|
+
type: 'remote'
|
333
|
+
```
|
334
|
+
|
335
|
+
#### Resource objects
|
336
|
+
|
337
|
+
Resource objects have the following properties:
|
338
|
+
|
339
|
+
| Property | Data Type | Required | Allowed Values | Example Value |
|
340
|
+
| ----------- | --------- | -------- | ------------------- | ------------------------------------------------------ |
|
341
|
+
| `href` | String | Yes | Any URL | `/css/app.css` / `https://example.com/js/app.js` |
|
342
|
+
| `type` | String | Yes | `local` or `remote` | `local` |
|
343
|
+
| `integrity` | String | No | Any SRI value | `sha256-ClILH8AIH4CkAybtlKhzqqQUYR4eSDiNTK5LIWfF4qQ=` |
|
344
|
+
|
345
|
+
The `integrity` property is used to specify a
|
346
|
+
[Subresource Integrity (SRI)](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) value for
|
347
|
+
a resource. If specified an `integrity` attribute and will be added to the generated markup. A `crossorigin`
|
348
|
+
attribute will also be added for
|
349
|
+
[Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) support with a
|
350
|
+
hard-coded, `anonymous`, value.
|
351
|
+
|
352
|
+
### Navigation menu items
|
353
|
+
|
354
|
+
When using the `bsk--standard.html` layout, a [navbar](https://style-kit.web.bas.ac.uk/components/navbar/) is included
|
355
|
+
as part of the 'standard header', which consists of a cookie banner, navbar and site development phase banner.
|
356
|
+
|
357
|
+
This navbar consists of three menus (and other elements, documented elsewhere):
|
358
|
+
|
359
|
+
1. a primary navigation menu - aligned left, after [brand elements](#navigation-branding)
|
360
|
+
2. a secondary navigation menu - aligned right, before the launcher menu
|
361
|
+
3. a navigation launcher menu - aligned right, after the secondary navigation menu
|
362
|
+
|
363
|
+
The navigation launcher is a restricted menu, used to link to other BAS websites and applications. By default it
|
364
|
+
contains links to the [BAS public website](https://www.bas.ac.uk) and the [BAS data catalogue](https://data.bas.ac.uk).
|
365
|
+
Other websites and applications can be added as well where relevant.
|
366
|
+
|
367
|
+
The primary and secondary navigation menu's support:
|
368
|
+
|
369
|
+
* [navbar items](https://style-kit.web.bas.ac.uk/components/navbar/#item)
|
370
|
+
* [navbar drop-down menus](https://style-kit.web.bas.ac.uk/components/navbar/#drop-down-menus)
|
371
|
+
* [navbar drop-down menu items](https://style-kit.web.bas.ac.uk/components/navbar/#drop-down-menus)
|
372
|
+
|
373
|
+
The navigation launcher menu, which is implemented as a drop-down menu, supports:
|
374
|
+
|
375
|
+
* [navbar drop-down menu items](https://style-kit.web.bas.ac.uk/components/navbar/#drop-down-menus)
|
376
|
+
|
377
|
+
All navigation menus are implemented using the [Jekyll menus](https://github.com/forestryio/jekyll-menus) plugin.
|
378
|
+
|
379
|
+
* primary navigation menu items should be added to the `site_navigation_primary` menu
|
380
|
+
* secondary navigation menu items should be added to the `site_navigation_secondary` menu
|
381
|
+
* navigation launcher menu items should be added to the `site_navigation_launcher` menu
|
382
|
+
|
383
|
+
**Note:** Menu items are only recursed once, deeper objects will be ignored.
|
384
|
+
|
385
|
+
### Navigation branding
|
386
|
+
|
387
|
+
[Navbars](https://style-kit.web.bas.ac.uk/components/navbar/) are also used to display the name/identity of a website
|
388
|
+
or application, to remind users where they are. These elements are referred to as 'brand' elements within the Style Kit.
|
389
|
+
|
390
|
+
In the 'standard header', navbar brand elements are shown on the far left.
|
391
|
+
|
392
|
+
Supported brand elements:
|
393
|
+
|
394
|
+
* [brand text](https://style-kit.web.bas.ac.uk/components/navbar/#brand-text) - set using the
|
395
|
+
`bas_style_kit_jekyll_theme.attributes.site_brand.text` config variable
|
396
|
+
* [brand image](https://style-kit.web.bas.ac.uk/components/navbar/#brand-image) - set using the
|
397
|
+
`bas_style_kit_jekyll_theme.attributes.site_brand.img` config variable
|
398
|
+
|
399
|
+
Brand elements can be used together or individually, with fix classes applied automatically as needed.
|
400
|
+
|
401
|
+
Brand elements are linked to a location specified by the `bas_style_kit_jekyll_theme.attributes.site_brand.href` config
|
402
|
+
variable, which should be the index of each website or application (i.e. `/`).
|
403
|
+
|
404
|
+
### Site development phase
|
405
|
+
|
406
|
+
The site development phase reflects the stage of development for a website or application, e.g. alpha or live. They are
|
407
|
+
described in the Style Kit [here](https://style-kit.web.bas.ac.uk/core/colours/#development-phase-colours).
|
408
|
+
|
409
|
+
For websites or applications that are not firmly in the 'live' phase, a banner should be shown to inform users and
|
410
|
+
request feedback. This forms part of the 'standard header' of cookie banner, navbar and site development phase banner.
|
411
|
+
|
412
|
+
In these templates, the `bas_style_kit_jekyll_theme.attributes.site_development_phase` config variable is used to
|
413
|
+
specify the current phase for a website or application. When using the `bsk--standard.html`layout, a banner will be
|
414
|
+
shown automatically based on this variable.
|
415
|
+
|
416
|
+
To disable this banner, set the `bas_style_kit_jekyll_theme.attributes.site_development_phase` config variable to
|
417
|
+
`live-stable`. This isn't a real phase but separates a newly released website or application from something more mature.
|
418
|
+
|
419
|
+
For example:
|
420
|
+
|
421
|
+
```yml
|
422
|
+
bas_style_kit_jekyll_theme:
|
423
|
+
attributes:
|
424
|
+
site_development_phase: 'alpha'
|
425
|
+
```
|
426
|
+
|
427
|
+
#### Experimental development phase
|
428
|
+
|
429
|
+
Alternatively, the `bas_style_kit_jekyll_theme.attributes.site_development_phase` config variable can be set to
|
430
|
+
`experimental` to indicate where an website or application is used for staging or other development/testing activities.
|
431
|
+
|
432
|
+
For example:
|
433
|
+
|
434
|
+
```yml
|
435
|
+
bas_style_kit_jekyll_theme:
|
436
|
+
attributes:
|
437
|
+
site_development_phase: 'experimental'
|
438
|
+
```
|
439
|
+
|
440
|
+
### Website analytics
|
441
|
+
|
442
|
+
To include the Google Analytics universal tracking library (gtag), set the
|
443
|
+
`bas_style_kit_jekyll_theme.attributes.site_analytics.id` property to relevant Google Analytics property ID.
|
444
|
+
|
445
|
+
**Note:** When used, the anonymise IP option in Google Analytics is enabled by default.
|
446
|
+
|
447
|
+
For example:
|
448
|
+
|
449
|
+
```yml
|
450
|
+
bas_style_kit_jekyll_theme:
|
451
|
+
attributes:
|
452
|
+
site_analaytics:
|
453
|
+
id: '123abc'
|
454
|
+
```
|
455
|
+
|
456
|
+
## Components
|
457
|
+
|
458
|
+
Components in these templates are structured according to Jekyll's conventions (e.g. layouts in `_layouts/`). They are
|
459
|
+
also namespaced in a `bas-style-kit` directory (e.g. `_layouts/bas-style-kit/`). Components that are specific to the
|
460
|
+
Style Kit are prefixed with `bsk--`.
|
461
|
+
|
462
|
+
### Views
|
463
|
+
|
464
|
+
Views are used for implementing [page patterns](#page-patterns). They are essentially layouts but with predefined page
|
465
|
+
content relevant to each pattern.
|
466
|
+
|
467
|
+
Within Jekyll, views are implemented as layouts. To use a view, create a page with the relevant 'view' layout.
|
468
|
+
|
469
|
+
```
|
470
|
+
---
|
471
|
+
layout: views/bas-style-kit/page-not-found
|
472
|
+
---
|
473
|
+
```
|
474
|
+
|
475
|
+
Views for some pattern variants can be used as-is, others require variables or page content to be set as well. See the
|
476
|
+
[Page patterns](#page-patterns) section for more information.
|
477
|
+
|
478
|
+
### Layouts
|
479
|
+
|
480
|
+
Refer to [Jekyll's documentation](https://jekyllrb.com/docs/layouts/) for general information.
|
481
|
+
|
482
|
+
Layouts are 'base' templates from which views or other layouts inherit. Layouts in this theme are hierarchical, with
|
483
|
+
each layout extending the last in this order:
|
484
|
+
|
485
|
+
* `blank.html`: lowest level layout, intentionally as minimal as possible and not intended for direct use, unless
|
486
|
+
non-HTML output is needed
|
487
|
+
* `html.html`: defines a minimal, accessible, HTML5 structure with some recommended best practices for cross-platform
|
488
|
+
compatibility
|
489
|
+
* `bsk--base.html`: intentionally implements the BAS Style Kit as minimally as possible and not intended for direct use,
|
490
|
+
unless the bsk_standard.j2 layout is unsuitable
|
491
|
+
* `bsk--standard.html`: defines an opinionated, conventional, page layout with a 'standard' header/footer, recommended
|
492
|
+
as a base for application/website layouts
|
493
|
+
* `bsk--standard-page.html`: defines an opinionated, conventional, content page layout, recommended as a base for
|
494
|
+
content type websites, such as documentation
|
495
|
+
|
496
|
+
For example:
|
497
|
+
|
498
|
+
```markdown
|
499
|
+
---
|
500
|
+
layout: bas-style-kit/html
|
501
|
+
---
|
502
|
+
|
503
|
+
Page content
|
504
|
+
```
|
505
|
+
|
506
|
+
Layouts inheriting from the `bsk--standard` layout can add additional classes to the `#main-content` element by setting
|
507
|
+
the `main_content_classes` variable in each layout.
|
508
|
+
|
509
|
+
For example:
|
510
|
+
|
511
|
+
```markdown
|
512
|
+
---
|
513
|
+
layout: bas-style-kit/bsk--standard
|
514
|
+
main_content_classes: foo
|
515
|
+
---
|
516
|
+
|
517
|
+
Page content
|
518
|
+
```
|
519
|
+
|
520
|
+
### Includes
|
521
|
+
|
522
|
+
Refer to [Jekyll's documentation](https://jekyllrb.com/docs/includes/) for general information.
|
523
|
+
|
524
|
+
This theme uses includes extensively to give fine grained control over how elements such as the navbar behave, including
|
525
|
+
both their content and structure.
|
526
|
+
|
527
|
+
Includes are often used conditionally using a related configuration option, to be disabled more easily.
|
528
|
+
|
529
|
+
### Data files
|
530
|
+
|
531
|
+
Refer to [Jekyll's documentation](https://jekyllrb.com/docs/datafiles/) for general information.
|
532
|
+
|
533
|
+
This theme uses data files to define CSS and JavaScript resources to load and for some variables about the theme.
|
534
|
+
|
535
|
+
All data files use the `.yml` (Yaml) extension and are namespaced using a `bas-style-kit/` directory - i.e. a data
|
536
|
+
element `foo` in the data file `bsk-vars.yml` is available as `site.data.bas-style-kit.bsk-vars.foo`.
|
537
|
+
|
538
|
+
### Variables
|
539
|
+
|
540
|
+
Refer to [Jekyll's documentation](https://jekyllrb.com/docs/variables/) for general information.
|
541
|
+
|
542
|
+
#### Style Kit specific variables
|
543
|
+
|
544
|
+
| Variable | Fully Qualified Variable | Purpose | Example | Notes |
|
545
|
+
| --------------- | ------------------------------------------------ | ----------------------------------------------- | ------- | ----- |
|
546
|
+
| `theme_version` | `site.data.bas-style-kit.bsk-vars.theme_version` | Version of this theme | `0.3.0` | - |
|
547
|
+
| `bsk_version` | `site.data.bas-style-kit.bsk-vars.bsk_version` | Version of the Style Kit used within this theme | `0.3.0` | - |
|
548
|
+
|
549
|
+
### Configuration options
|
550
|
+
|
551
|
+
Refer to [Jekyll's documentation](https://jekyllrb.com/docs/configuration/) for general information.
|
552
|
+
|
553
|
+
Configuration options are used extensively throughout this theme. Some variables are used to set properties such as the
|
554
|
+
brand text or image in the navbar (attributes), others are used to enable various features (feature flags).
|
555
|
+
|
556
|
+
Configuration options operate at different scopes, *site* or *page*. Site options applies to across a site, whereas
|
557
|
+
page options can be applied to specific content items. Default values can be set for page options, which can then be
|
558
|
+
overridden by specific content items.
|
559
|
+
|
560
|
+
Configuration options for this theme are namespaced under a `bas_style_kit_jekyll_theme` option - i.e. an option `foo`
|
561
|
+
is set as `bas_style_kit_jekyll_theme.foo`.
|
562
|
+
|
563
|
+
Configuration options in this documentation use a dot notation to indicate a nested structure - i.e. an option `foo.bar`
|
564
|
+
should be set as:
|
565
|
+
|
566
|
+
```yml
|
567
|
+
foo:
|
568
|
+
bar
|
569
|
+
```
|
570
|
+
|
571
|
+
A configuration option `bas_style_kit_jekyll_theme.feature_flags.site.back_to_top_anchor` should be set as:
|
572
|
+
|
573
|
+
```yml
|
574
|
+
bas_style_kit_jekyll_theme:
|
575
|
+
feature_flags:
|
576
|
+
site:
|
577
|
+
back_to_top_anchor: '[value]'
|
578
|
+
```
|
579
|
+
|
580
|
+
These config options can be set at a page, collection or site level:
|
581
|
+
|
582
|
+
* `bas_style_kit_jekyll_theme.feature_flags.page.toc`
|
583
|
+
|
584
|
+
These config options should be changed or set for each website or application:
|
585
|
+
|
586
|
+
* `bas_style_kit_jekyll_theme.attributes.head_title.default`
|
587
|
+
* `bas_style_kit_jekyll_theme.attributes.head_title.appended`
|
588
|
+
* `bas_style_kit_jekyll_theme.attributes.head_description`
|
589
|
+
* `bas_style_kit_jekyll_theme.attributes.site_analytics.id`
|
590
|
+
* `bas_style_kit_jekyll_theme.attributes.site_brand.text`
|
591
|
+
* `bas_style_kit_jekyll_theme.attributes.site_development_phase`
|
592
|
+
* `bas_style_kit_jekyll_theme.attributes.site_feedback_href`
|
593
|
+
* `bas_style_kit_jekyll_theme.attributes.site_footer.legal_policies.cookies_href`
|
594
|
+
* `bas_style_kit_jekyll_theme.attributes.site_footer.legal_policies.copyright_href`
|
595
|
+
* `bas_style_kit_jekyll_theme.attributes.site_footer.legal_policies.privacy_href`
|
596
|
+
|
597
|
+
These config options may, but don't need to be, changed or set for each website or application:
|
598
|
+
|
599
|
+
* `bas_style_kit_jekyll_theme.attributes.container`
|
600
|
+
* `bas_style_kit_jekyll_theme.attributes.site_styles`
|
601
|
+
* `bas_style_kit_jekyll_theme.attributes.site_scripts`
|
602
|
+
* `bas_style_kit_jekyll_theme.attributes.head_favicon`
|
603
|
+
* `bas_style_kit_jekyll_theme.attributes.site_brand.img`
|
604
|
+
* `bas_style_kit_jekyll_theme.attributes.site_brand.href`
|
605
|
+
|
606
|
+
These config options do not normally, and should not, need to be changed or set:
|
607
|
+
|
608
|
+
* `bas_style_kit_jekyll_theme.attributes.site_back_to_top_target_href`
|
609
|
+
* `bas_style_kit_jekyll_theme.attributes.site_footer.ogl.href`
|
610
|
+
* `bas_style_kit_jekyll_theme.attributes.site_footer.ogl.version`
|
611
|
+
|
612
|
+
These config options must not be changed and should be treated as read only:
|
613
|
+
|
614
|
+
* `site.data.bas-style-kit.bsk-vars.theme_version`
|
615
|
+
* `site.data.bas-style-kit.bsk-vars.bsk_version`
|
616
|
+
|
617
|
+
| Config Option | Value Type | Allowed Values | Default Value | Notes |
|
618
|
+
| --------------------------------------------------------------------------------- | ---------- | ----------------------------------------------------------------------------------------------- | ------------------ | ---------------------------------------------------------- |
|
619
|
+
| `bas_style_kit_jekyll_theme.feature_flags.page.toc` | Boolean | `true` / `false` | `true` | Whether to show the table of contents in standard pages |
|
620
|
+
| `bas_style_kit_jekyll_theme.attributes.head_title.default` | String | Any string | 'site title' | Typically 1-3 words |
|
621
|
+
| `bas_style_kit_jekyll_theme.attributes.head_title.appended` | String | Any string | *None* | Typically 1-3 words |
|
622
|
+
| `bas_style_kit_jekyll_theme.attributes.head_description` | String | Any string | 'site description' | Typically 1-2 sentences |
|
623
|
+
| `bas_style_kit_jekyll_theme.attributes.site_analytics.id` | String | Google Analytics property ID | *None* | See [Site analytics](#site-analytics) |
|
624
|
+
| `bas_style_kit_jekyll_theme.attributes.site_brand.text` | String | Any string | 'site title' | Typically 1-3 words |
|
625
|
+
| `bas_style_kit_jekyll_theme.attributes.site_development_phase` | String | `discovery` / `alpha` / `beta` / `live` / `live-stable` / `retired` / `experimental` / `custom` | 'alpha' | See [Site development phase](#site-development-phase) |
|
626
|
+
| `bas_style_kit_jekyll_theme.attributes.site_feedback_href` | String | URL to feedback page or other content (e.g. model overlay) | '/feedback.html' | - |
|
627
|
+
| `bas_style_kit_jekyll_theme.attributes.site_footer.legal_policies.cookies_href` | String | URL to cookies legal policy | '/legal/cookies' | - |
|
628
|
+
| `bas_style_kit_jekyll_theme.attributes.site_footer.legal_policies.copyright_href` | String | URL to copyright legal policy | '/legal/copyright' | - |
|
629
|
+
| `bas_style_kit_jekyll_theme.attributes.site_footer.legal_policies.privacy_href` | String | URL to privacy legal policy | '/legal/privacy' | - |
|
630
|
+
| `bas_style_kit_jekyll_theme.attributes.container` | String | `fixed` / `fluid` | 'fixed' | - |
|
631
|
+
| `bas_style_kit_jekyll_theme.attributes.site_styles` | Array | Site style object | *Empty array* | See [Using custom CSS/JS](#using-custom-cssjs) |
|
632
|
+
| `bas_style_kit_jekyll_theme.attributes.site_scripts` | Array | Site script object | *Empty array* | See [Using custom CSS/JS](#using-custom-cssjs) |
|
633
|
+
| `bas_style_kit_jekyll_theme.attributes.head_favicon` | String | `default` | 'default' | The favicon to use, use 'default' the standard BAS favicon |
|
634
|
+
| `bas_style_kit_jekyll_theme.attributes.site_brand.img` | String | URL to image | *None* | See [Navigation menu branding](#navigation-menu-branding) |
|
635
|
+
| `bas_style_kit_jekyll_theme.attributes.site_brand.href` | String | URL to content | '/' | See [Navigation menu branding](#navigation-menu-branding) |
|
636
|
+
| `bas_style_kit_jekyll_theme.attributes.site_back_to_top_target_href` | String | CSS ID selector | '#site-top' | - |
|
637
|
+
| `bas_style_kit_jekyll_theme.attributes.site_footer.ogl.href` | String | URL to OGL information page | *As implemented* | - |
|
638
|
+
| `bas_style_kit_jekyll_theme.attributes.site_footer.ogl.version` | String | Any OGL version | *As implemented* | - |
|
639
|
+
| `site.data.bas-style-kit.bsk-vars.theme_version` | String | Any [SemVer](https://semver.org/) value | *As implemented* | - |
|
640
|
+
| `site.data.bas-style-kit.bsk-vars.bsk_version` | String | Any BAS Style Kit version | *As implemented* | - |
|
641
|
+
|
642
|
+
### Plugins
|
643
|
+
|
644
|
+
This theme depends on these plugins:
|
645
|
+
|
646
|
+
* [Jekyll data](https://github.com/ashmaroli/jekyll-data) - for including theme data files into a site's configuration
|
647
|
+
* [Jekyll menus](https://github.com/forestryio/jekyll-menus) - for managing navigation menus
|
648
|
+
* [Jekyll tidy](https://github.com/apsislabs/jekyll-tidy) - for rewriting HTML output to be well structured
|
649
|
+
|
650
|
+
**Note:** A patched version of the *Jekyll menus* plugin is used to fix a Ruby 3.0 incompatibility.
|
651
|
+
|
652
|
+
## Development
|
653
|
+
|
654
|
+
[Git](https://git-scm.com), [Docker](https://www.docker.com/community-edition) and
|
655
|
+
[Docker Compose](https://docs.docker.com/compose/overview/) are required to build this project locally.
|
656
|
+
|
657
|
+
To update the Docker image for this project, access to the private
|
658
|
+
[BAS Docker Registry](https://docker-registry.data.bas.ac.uk) [1] is also required.
|
659
|
+
|
660
|
+
```shell
|
661
|
+
$ git clone https://gitlab.data.bas.ac.uk/web-apps/bsk/bas-style-kit-jekyll-theme.git
|
662
|
+
$ cd bas-style-kit-jekyll-theme
|
663
|
+
$ docker-compose up
|
664
|
+
```
|
665
|
+
|
666
|
+
Visit [localhost:9000](http://localhost:9000) to see a preview of the theme.
|
667
|
+
|
668
|
+
**Note:** If you don't have access to the BAS Private Docker Registry, you will need to build the project Docker image
|
669
|
+
locally first using `docker-compose build`.
|
670
|
+
|
671
|
+
[1] The first time you use this registry, you will need to authenticate using:
|
672
|
+
|
673
|
+
```shell
|
674
|
+
$ docker login docker-registry.data.bas.ac.uk
|
675
|
+
```
|
676
|
+
|
677
|
+
### Updating dependencies
|
678
|
+
|
679
|
+
If the `.gemspec` for this project is changed, the project Docker image will need to be rebuilt and pushed to the
|
680
|
+
private BAS Docker Repository [1].
|
681
|
+
|
682
|
+
```shell
|
683
|
+
$ docker-compose build app
|
684
|
+
$ docker-compose push app
|
685
|
+
```
|
686
|
+
|
687
|
+
[1] The first time you use this registry, you will need to authenticate using:
|
688
|
+
|
689
|
+
```shell
|
690
|
+
$ docker login docker-registry.data.bas.ac.uk
|
691
|
+
```
|
692
|
+
|
693
|
+
### Jekyll plugins
|
694
|
+
|
695
|
+
Additional Jekyll plugins (gems) can be used by listing them as dependencies in the `gems` option in `_config.yml`.
|
696
|
+
|
697
|
+
They will be installed automatically when this theme is used by an end-user.
|
698
|
+
|
699
|
+
### Jekyll config options
|
700
|
+
|
701
|
+
The Jekyll Data plugin is used to set config options within sites that use this theme. Make sure to document which
|
702
|
+
config options are set by this theme.
|
703
|
+
|
704
|
+
### Ruby Gem
|
705
|
+
|
706
|
+
This theme is distributed as a Ruby Gem, through the public [Ruby Gems](https://rubygems.org) gem hosting service.
|
707
|
+
|
708
|
+
The `jekyll-theme-bas-style-kit.gemspec` file details the properties of the Gem for this project.
|
709
|
+
|
710
|
+
**Note:** The `spec.files` parameter controls which files in this project are copied into the Gem. If a file is not
|
711
|
+
listed it won't be included. This is separate to the Git `.gitignore` file.
|
712
|
+
|
713
|
+
## GitHub mirror
|
714
|
+
|
715
|
+
A read-only mirror of this project's repository is maintained on GitHub, to support Jekyll's automatic theme
|
716
|
+
installation, and to allow use by those outside of BAS.
|
717
|
+
|
718
|
+
Merge requests **WILL NOT** be accepted on this mirror.
|
719
|
+
|
720
|
+
## Release procedures
|
721
|
+
|
722
|
+
Before release:
|
723
|
+
|
724
|
+
1. create a release branch
|
725
|
+
3. build and push the app docker image [1]
|
726
|
+
4. if new config options have been set, update the usage section
|
727
|
+
5. update screen-shot (width: 900px)
|
728
|
+
6. close release in changelog
|
729
|
+
7. commit changes, merge with master and tag with new version
|
730
|
+
8. push the release to Ruby Gems [2]
|
731
|
+
|
732
|
+
**Note:** If the BAS Style Kit version changes, make sure to bump that version in `_data/bsk_jekyll_vars.json` too.
|
733
|
+
|
734
|
+
After release:
|
735
|
+
|
736
|
+
1. bump the version in:
|
737
|
+
* `jekyll-theme-bas-style-kit.gemspec`
|
738
|
+
* `_data/bsk_jekyll_vars.json` - or here? `_data/bas-style-kit/bsk-vars.yml`
|
739
|
+
2. build and push the app docker image [1]
|
740
|
+
3. commit changes, merge with master and close release branch
|
741
|
+
|
742
|
+
[1]
|
743
|
+
|
744
|
+
```shell
|
745
|
+
$ docker-compose build
|
746
|
+
$ docker-compose push
|
747
|
+
```
|
748
|
+
|
749
|
+
[2]
|
750
|
+
|
751
|
+
```shell
|
752
|
+
$ docker-compose run --entrypoint="" app ash
|
753
|
+
$ gem build jekyll-theme-bas-style-kit.gemspec
|
754
|
+
$ gem push jekyll-theme-bas-style-kit-*.gem
|
755
|
+
```
|
756
|
+
|
757
|
+
## Issue tracking
|
758
|
+
|
759
|
+
This project uses [issue tracking](https://trello.com/b/0Mhzizpk/bas-style-kit) to manage development of new
|
760
|
+
features/improvements and reporting bugs.
|
761
|
+
|
762
|
+
## Feedback
|
763
|
+
|
764
|
+
The maintainer of this project is the BAS Web & Applications Team, they can be contacted through the
|
765
|
+
[BAS Service Desk](mailto:servicedesk@bas.ac.uk).
|
766
|
+
|
767
|
+
## License
|
768
|
+
|
769
|
+
© UK Research and Innovation (UKRI), 2017-2021, British Antarctic Survey.
|
770
|
+
|
771
|
+
You may use and re-use this software and associated documentation files free of charge in any format or medium, under
|
772
|
+
the terms of the Open Government Licence v3.0.
|
773
|
+
|
774
|
+
You may obtain a copy of the Open Government Licence at http://www.nationalarchives.gov.uk/doc/open-government-licence/
|