jekyll-theme-bas-style-kit 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43005268ee83aaa5337b6e532257497dc626f6d3
4
- data.tar.gz: ac58744ceca48c0205bf4829d5a05bb40c143220
3
+ metadata.gz: 701f3780545273cb9e5be5babe4ba472ca48ea5f
4
+ data.tar.gz: 8733cd26e3f1b349a5966a59ee582a440ab9be0e
5
5
  SHA512:
6
- metadata.gz: b5e731ccf2c76965384e261b14a2ff7163f4f3c0163c74dfbf10a44cd51fb6b36f8170d8cebbbb0e0db0808f18cc7720e7b1bfa40aae5a5ba7408d51930facc4
7
- data.tar.gz: 34472b3459a6e0511ac07bb5f838b3be723ed47366c0541fc130ccb1dafce84c003c574ce9ee1c30b0f645205ad7889edf59844d6a98f537aa40c37bc716c284
6
+ metadata.gz: ece2cbf1c87461c38737df47a6dffef98825f6052d4b74a89d5e6d2d167fab9de069b7b33fcfdbe11a43d74980d0d6f6dc8d559e2f7691c04e89e79c3b6d57cb
7
+ data.tar.gz: f530d32dae6a5eafdbf016d97b667f9067868ccae4c5b5ded114528336b84bb7699344b56d4420b256646c40e29ec0d8ca882af79bbbbaa75101536e2402814d
data/CHANGELOG.md CHANGED
@@ -5,6 +5,27 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
5
5
 
6
6
  ## [Unreleased][unreleased]
7
7
 
8
+ ## 0.2.0 - 20/03/2017
9
+
10
+ ### Added
11
+
12
+ * Variables data file to provide information about the theme and version of the Style Kit version used for example
13
+
14
+ ### Fixed
15
+
16
+ * Documenting that the site base URL will be prefixed to navigation item URLs if one is defined
17
+
18
+ ### Changed
19
+
20
+ * Body JS include now references files from a data file, and allows per-page files to loaded using front-matter
21
+ * Updating theme screen shot
22
+
23
+ ## 0.1.2 - 14/03/2017
24
+
25
+ ### Fixed
26
+
27
+ * Active site navigation item support when using 'pretty' permalinks
28
+
8
29
  ## 0.1.1 - Skipped
9
30
 
10
31
  ## 0.1.0 - 12/03/2017
data/README.md CHANGED
@@ -167,12 +167,10 @@ include.
167
167
 
168
168
  **File:** `snippets/body-js.html`
169
169
 
170
- Inserts `<script>` tags for:
170
+ Inserts `<script>` tags to reference JavaScript files. Entries defined in the `bsk_jekyll_js.json` data file will be
171
+ output first, followed by per-page files using the `body_js_files` front-matter option.
171
172
 
172
- * jQuery (required for Bootstrap's JavaScript components and the cookie banner)
173
- * Bootstrap JavaScript components (required for components such as drop-down menus)
174
- * JS Cookie (required for the cookie banner)
175
- * cookie banner (a script to hide the cookie banner using a cookie, if the user chooses to)
173
+ See the *JavaScript* section for more information.
176
174
 
177
175
  **Note:** This snippet is designed for loading JavaScript *after* the main page content. If a script needs to be run
178
176
  before this content, you will need to do this manually.
@@ -229,6 +227,8 @@ All assets in this theme are scoped to the `bsk-jekyll` directory.
229
227
  website that uses this theme. This makes such sites more consistent, and gives performance benefits using browser
230
228
  caching.
231
229
 
230
+ **Note:** To include JavaScript files, after the page has loaded, see the *JavaScript* section.
231
+
232
232
  #### `bsk-jekyll/bas-style-kit-jekyll-theme.scss`
233
233
 
234
234
  CSS styles specific to this theme, designed to be the same for each site using this theme.
@@ -249,6 +249,8 @@ Simple script to set a cookie when the user dismisses the cookie banner. If this
249
249
  be shown on subsequent pages for a period of 30 days. After this time the banner will be shown again, until dismissed
250
250
  again for another 30 days.
251
251
 
252
+ See the *JavaScript* section for more information on how this file is loaded.
253
+
252
254
  #### `css/main.scss`
253
255
 
254
256
  CSS styles specific to each website. This file is empty by default and is designed to be overiden by each website.
@@ -280,6 +282,96 @@ Theme specific options which **SHOULD** be set:
280
282
  | `nav_items` | List | Items in this website to include in the site navigation | *List of items* | See the *Site navigation* section for more information |
281
283
  | `nav_related_sites` | List | Items for other BAS websites to include in the site navigation | *List of items* | See the *Site navigation* section for more information |
282
284
 
285
+ ### Theme variables
286
+
287
+ The `bsk_jekyll_vars.json` Jekyll data file contains variables which can be used by websites using this theme.
288
+
289
+ | Variable | Type | Description | Notes |
290
+ | --------------- | ------ | --------------------------------------------------- | ----- |
291
+ | `theme_version` | String | Version of the BAS Style Kit Jekyll Theme | - |
292
+ | `bsk_version` | String | Version of the BAS Style Kit used within this theme | - |
293
+
294
+ ### JavaScript
295
+
296
+ JavaScript files can be loaded after the main site content in two ways:
297
+
298
+ 1. Using the `bsk_jekyll_js.json` Jekyll data file - for files that should be loaded in all pages
299
+ 2. Using the `body_js_files` front-matter option - for files that should only be loaded for specific pages
300
+
301
+ Both methods are added to the page using the *Body JS* include, using the following structure for each script:
302
+
303
+ | Property | Type | Required | Description | Example Value | Notes |
304
+ | --------- | ------ | -------- | ------------------------------------------------- | ---------------------------------------- | ------------------------------------------------ |
305
+ | `comment` | String | Yes | Used as a HTML comment added before each script | `Code for managing cookie banner` | - |
306
+ | `href` | String | Yes | Defines the location of the script to be loaded | `/assets/bsk-jekyll/js/cookie-banner.js` | Depends on the type property value |
307
+ | `type` | String | Yes | Controls how this item is processed and displayed | `local` | See below for valid values |
308
+
309
+ Supported script types are:
310
+
311
+ * `local`
312
+ * `remote`
313
+
314
+ **Note:** See the `bsk_jekyll_js.json` Jekyll data file for scripts which are included in all pages by default.
315
+
316
+ **Example**
317
+
318
+ For scripts referenced in the `bsk_jekyll_js.json` Jekyll data file:
319
+
320
+ ```json
321
+ {
322
+ {
323
+ "comment": "Cookie library used to persistently hide the cookie banner",
324
+ "href": "https://cdn.web.bas.ac.uk/js-libs/js.cookie-2.1.3.min.js",
325
+ "type": "remote"
326
+ },
327
+ {
328
+ "comment": "Code for managing cookie banner",
329
+ "href": "/assets/bsk-jekyll/js/cookie-banner.js",
330
+ "type": "local"
331
+ }
332
+ ]
333
+ ```
334
+
335
+ For scripts referenced in the `body_js_files` front-matter option:
336
+
337
+ ```md
338
+ ---
339
+ title: A page
340
+ body_js_files:
341
+ - comment: Cookie library used to persistently hide the cookie banner
342
+ href: https://cdn.web.bas.ac.uk/js-libs/js.cookie-2.1.3.min.js
343
+ type: remote
344
+ - comment: Code for managing cookie banner
345
+ href: /assets/bsk-jekyll/js/cookie-banner.js
346
+ type: local
347
+ ---
348
+
349
+ # Page content
350
+ ...
351
+ ```
352
+
353
+ #### Remote scripts
354
+
355
+ Set the `href` property to the URL of a remote file.
356
+
357
+ **Example**
358
+
359
+ ```
360
+ href: https://cdn.web.bas.ac.uk/js-libs/js.cookie-2.1.3.min.js
361
+ ```
362
+
363
+ #### Local scripts
364
+
365
+ Set the `href` property to a URL relative to the base of the current website.
366
+
367
+ **Note:** The base URL of the website will be prepended to the `href` property, if one is defined.
368
+
369
+ **Example**
370
+
371
+ ```
372
+ href: /assets/bsk-jekyll/js/cookie-banner.js
373
+ ```
374
+
283
375
  ### Site navigation
284
376
 
285
377
  Two kinds of navigation item are supported within the site navigation (an instance of the
@@ -329,6 +421,8 @@ The most basic item type, set manually and displayed as a navbar item (link).
329
421
  | -------- | ------ | -------- | --------------------------------- | ------------- | ------------------------------------------------ |
330
422
  | `href` | String | Yes | Used as the link `href` attribute | `/about` | Set the `href` property to `/` for the home page |
331
423
 
424
+ **Note:** The base URL of the website will be prepended to the `href` property, if one is defined.
425
+
332
426
  **Active item**
333
427
 
334
428
  When the current page matches the `href` attribute, the item is made the active navbar item.
@@ -362,6 +456,8 @@ A more complex item type, set manually and displayed as a
362
456
  | `actions.*.name` | String | Yes | Used as the action text | `Downloads` | Example of a single action |
363
457
  | `actions.*.href` | String | Yes | Used as the action `href` atttibute | `/resources/downloads` | Example of a single action |
364
458
 
459
+ **Note:** The base URL of the website will be prepended to the `action.*.href` property, if one is defined.
460
+
365
461
  **Active item**
366
462
 
367
463
  When the current page matches the `href` attribute of an action in a drop-down item, the drop-down action is made
@@ -604,7 +700,7 @@ listed it won't be included. This is separate to the Git `.gitignore` file.
604
700
 
605
701
  ## Release procedures
606
702
 
607
- 1. bump version in `jekyll-theme-bas-style-kit.gemspec` and `docker-compose.yml`
703
+ 1. bump version in `jekyll-theme-bas-style-kit.gemspec` and `docker-compose.yml` and `_data/bsk_jekyll_vars.json`
608
704
  2. `docker-compose build`
609
705
  3. `docker-compose push`
610
706
  4. close release
@@ -0,0 +1,22 @@
1
+ [
2
+ {
3
+ "comment": "jQuery (necessary for Bootstrap's JavaScript plugins)",
4
+ "href": "https://cdn.web.bas.ac.uk/js-libs/jquery-3.1.1.min.js",
5
+ "type": "remote"
6
+ },
7
+ {
8
+ "comment": "Compiled and minified Bootstrap JavaScript plugins, include individual plugins instead if needed",
9
+ "href": "https://cdn.web.bas.ac.uk/js-libs/boostrap-3.3.7.min.js",
10
+ "type": "remote"
11
+ },
12
+ {
13
+ "comment": "Cookie library used to persistently hide the cookie banner (slightly ironic we need a cookie to do this)",
14
+ "href": "https://cdn.web.bas.ac.uk/js-libs/js.cookie-2.1.3.min.js",
15
+ "type": "remote"
16
+ },
17
+ {
18
+ "comment": "Code for managing cookie banner",
19
+ "href": "/assets/bsk-jekyll/js/cookie-banner.js",
20
+ "type": "local"
21
+ }
22
+ ]
@@ -0,0 +1,4 @@
1
+ {
2
+ "theme_version": "0.2.0",
3
+ "bsk_version": "0.1.0"
4
+ }
@@ -1,8 +1,14 @@
1
- <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
2
- <script src="https://cdn.web.bas.ac.uk/js-libs/jquery-3.1.1.min.js"></script>
3
- <!-- Compiled and minified Bootstrap JavaScript plugins, include individual plugins instead if needed -->
4
- <script src="https://cdn.web.bas.ac.uk/js-libs/boostrap-3.3.7.min.js"></script>
5
- <!-- Cookie library used to persistently hide the cookie banner (slightly ironic we need a cookie to do this) -->
6
- <script src="https://cdn.web.bas.ac.uk/js-libs/js.cookie-2.1.3.min.js"></script>
7
- <!-- Code for managing cookie banner -->
8
- <script src="{{ '/assets/bsk-jekyll/js/cookie-banner.js' | prepend: site.baseurl }}"></script>
1
+ {% comment %}BSK Jekyll Theme core JS files{% endcomment %}
2
+ {% for script in site.data.bsk_jekyll_js %}
3
+ <!-- {{ script.comment }} -->
4
+ {% if script.type == 'remote' %}<script src="{{ script.href }}"></script>{% endif %}
5
+ {% if script.type == 'local' %}<script src="{{ script.href | prepend: site.baseurl }}"></script>{% endif %}
6
+ {% endfor %}
7
+ {% comment %}Additional JS files listed on per-page basis{% endcomment %}
8
+ {% if body_js_files %}
9
+ {% for script in page.body_js_files %}
10
+ <!-- {{ script.comment }} -->
11
+ {% if script.type == 'remote' %}<script src="{{ script.href }}"></script>{% endif %}
12
+ {% if script.type == 'local' %}<script src="{{ script.href | prepend: site.baseurl }}"></script>{% endif %}
13
+ {% endfor %}
14
+ {% endif %}
data/screenshot.png CHANGED
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-bas-style-kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Fennell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-14 00:00:00.000000000 Z
11
+ date: 2017-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -64,6 +64,8 @@ files:
64
64
  - LICENSE-MIT.md
65
65
  - LICENSE.md
66
66
  - README.md
67
+ - _data/bsk_jekyll_js.json
68
+ - _data/bsk_jekyll_vars.json
67
69
  - _includes/layout/cookie-banner.html
68
70
  - _includes/layout/phase-banner.html
69
71
  - _includes/layout/site-footer.html