jekyll-scouts_uk_2018 1.0.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e4e1e2faf95ba31dce2ef5a42a921b6da0a07fca3f5c4bc23b0087e5fa22407
4
- data.tar.gz: 6366e3ccef39ad1f775ff0e0753a57f6a19643d85d8fe845b1b0e00ee4932880
3
+ metadata.gz: 6f13a6c70ea2fe5c4718d566517fbf10b37704f03e0be93205b2170bb39c7bba
4
+ data.tar.gz: fed326a637a25ae28e3b8a1d3853b8d5d27e30de066c8fba6b0914b37520ae1a
5
5
  SHA512:
6
- metadata.gz: edcffa3effe4c9b1ed8f6a6191e0354b452a5a1ac7c8ae29a8b9311cd84bfb2c67f0f47b3815ad72e316a9080a2c2be12822fb78cb17b1240313e2cfbdd5d201
7
- data.tar.gz: 89a0c683dd5a70759bfa96e30bbee5e7eb29eb08eecec2f7e63444f1942eb0ec41007c85c44369a94b7abd263abeb47c1968d97271a42cab146ee8bda7c2c21f
6
+ metadata.gz: 94e6db136730c4a9b89b2a1c1617997988d91f139f224b491dd85199e0dfc8c1ba9a895e5f1cbeabcc37ce92f415cc420f39edb35a0b7ddbafdbdeeccf1cfe5c
7
+ data.tar.gz: 30c772f509b4eb8d950c0d3f8a658fc7f10f7e4145f07e2cbe4e93c8457eb64731a000e5a6f79291abcf6b005b7e68db67c99bf3b0b5a94b14353c4338e7be7b
data/README.md CHANGED
@@ -8,7 +8,7 @@ A [Jekyll](https://jekyllrb.com/) template for the UK Scouts brand (2018). You c
8
8
  Add this line to your Jekyll site's Gemfile:
9
9
 
10
10
  ```ruby
11
- gem 'jekyll-scouts_uk_2018', '~> 1.0'
11
+ gem 'jekyll-scouts_uk_2018', '~> 1.3', group: 'jekyll_plugins'
12
12
  ```
13
13
 
14
14
  And add this line to your Jekyll site's _config.yml:
@@ -81,10 +81,9 @@ defaults:
81
81
 
82
82
  Then create your files in the _sections directory. A number of front matter settings are available:
83
83
  * title:
84
- * type: squirrels / beavers / cubs / scouts / explorers / network / activesupport - causes the correct logo to be shown
85
- * logo_type: (only for squirrels) primary / symbol
86
- * logo_colour: black / white / (others that vary by section e.g. blue / colourful for beavers, green for cubs / scouts)
87
- * youth_approved: foundation / bronze (causes the relevant seal to be displayed)
84
+ * type: squirrels / beavers / cubs / scouts / explorers / network / activesupport
85
+ * youth_approved.level: foundation / bronze (causes the relevant seal to be displayed)
86
+ * youth_approved.expires: date of certificate expiry in YYYY-MM-DD format.
88
87
  * social_links.email
89
88
  * social_links.twitter
90
89
  * social_links.facebook
@@ -97,12 +96,44 @@ Then create your files in the _sections directory. A number of front matter sett
97
96
 
98
97
  ### Other things you get
99
98
 
99
+ #### Included Tags
100
+
101
+ The gem **MUST** be in the jekyll_plugins group to use the included tags.
102
+
103
+ ##### youth_approved
104
+
105
+ ```
106
+ {% youth_approved %}
107
+ ```
108
+ Will render an image of [Scout Scotland's Youth Approved](https://www.scouts.scot/members/youth-involvement/youth-approved-award/) seal, with the level chosen by:
109
+
110
+ * The value of the youth_approved.level front matter
111
+ * The generic Youth Approved logo
112
+
113
+ If the frontmatter youth_approved.expires is present and in the past then nothing will be rendered.
114
+
115
+ ```
116
+ {% youth_approved <level> %}
117
+ ```
118
+ Will render an image of Scout Scotland's Youth Approved seal at the passed level.
119
+
120
+ ```
121
+ {% youth_approved <level> <expires> %}
122
+ ```
123
+ Will render an image of Scout Scotland's Youth Approved seal at the passed level if the passed expires (format YYYY-MM-DD) has not passed.
124
+
125
+ In all cases the img has a class of youth-approved-seal and is enclosed by a link to the scheme on Scouts Scotland's website.
126
+
100
127
  #### Ability to display twitter content (provided by [jekyll-twitter-plugin](https://github.com/rob-murray/jekyll-twitter-plugin))
101
128
 
102
129
  If a section has a social_links.twitter value and the screen is wide enough then their last five tweets will be displayed at the side of the page.
103
130
  #### Basic search engine optimisation (provided by [jekyll-seo-tag](https://github.com/jekyll/jekyll-seo-tag))
104
131
 
105
- #### Selection of images
106
- * Look in assets/images/logos
132
+ #### Selection of images/assets
133
+ * Logos: assets/images/logos
134
+ * Sections and Active Support
135
+ * Linear / Stacked
136
+ * FleurDeLis
107
137
  * [Tabler icons](https://tablericons.com/): assets/images/tabler-icons-sprite.svg
108
138
  * Scouts Scotland's Youth Approved seals: assets/images
139
+ * Nunito Sans font: assets/fonts/NunitoSans
data/_includes/head.html CHANGED
@@ -3,5 +3,4 @@
3
3
  {%- seo -%}
4
4
  <link rel="stylesheet" href="{{ "/assets/css/main.css" | relative_url }}">
5
5
  <link rel="icon" type="image/x-icon" href="{{ "/assets/favicon.ico" | relative_url }}">
6
- <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito+Sans:400,700,900">
7
6
  </head>
@@ -1,6 +1,6 @@
1
1
  <header class="layout-{{ page.layout }}">
2
2
  <div id="header-logo">
3
- <a href="{{ "/" | relative_url }}">
3
+ <a href="{{ "/" | relative_url }}" title="{{ site.name | escape }}">
4
4
  {%- include header-logo.html -%}
5
5
  </a>
6
6
  </div>
@@ -6,50 +6,8 @@ main_class: section
6
6
  <div id="content">
7
7
  <div id="content-header">
8
8
  <h1>
9
- {%- assign logo = page.type | capitalize -%}
10
- {%- case page.type | downcase -%}
11
- {%- when "squirrels" -%}
12
- {%- assign type = page.logo_type | default: "primary" | capitalize -%}
13
- {%- assign colour = page.logo_colour | default: "red" | capitalize -%}
14
- {%- if type == "Symbol" -%}
15
- {%- assign widths = "100" -%}
16
- {%- endif -%}
17
- {%- when "beavers" -%}
18
- {%- assign colour = page.logo_colour | default: "blue" | capitalize -%}
19
- {%- when "cubs" -%}
20
- {%- assign colour = page.logo_colour | default: "green" | capitalize -%}
21
- {%- assign widths = "100,320,480,640" -%}
22
- {%- when "scouts" -%}
23
- {%- assign colour = page.logo_colour | default: "green" | capitalize -%}
24
- {%- when "explorers" -%}
25
- {%- assign colour = page.logo_colour | default: "blue" | capitalize -%}
26
- {%- when "network" -%}
27
- {%- assign widths = "100,320,480" -%}
28
- {%- when "activesupport" -%}
29
- {%- if logo == "Activesupport" -%}
30
- {%- assign logo = "ActiveSupport" -%}
31
- {%- endif -%}
32
- {%- else -%}
33
- {%- assign colour = page.logo_colour | default: "black" | capitalize -%}
34
- {%- endcase -%}
35
- {%- assign path = "assets/images/logos/" | append: logo | append: type | append: colour | relative_url -%}
36
- {%- assign widths = widths | default: "100,320,480,640,800" | split: "," -%}
37
- {%- capture srcset -%}
38
- {%- for i in widths -%}
39
- {{ path }}-{{ i }}.png {{ i }}w,
40
- {%- endfor -%}
41
- {%- endcapture -%}
42
- <img src="{{ path }}.png" srcset="{{ srcset }}" alt="{{ page.type }}" loading="eager">
9
+ {{ page.title | escape }}
43
10
  </h1>
44
-
45
- {%- if page.youth_approved -%}
46
- <a href="https://www.scouts.scot/members/youth-involvement/youth-approved-award/" rel="nofollow noopener" target="_blank" class="youth-approved">
47
- {%- assign logo = page.youth_approved | capitalize -%}
48
- {%- assign logo = "assets/images/YouthApproved" | append: logo | relative_url -%}
49
- {%- assign alt = "We've got the " | append: page.youth_approved | append: " Youth Approved award from Scouts Scotland." -%}
50
- <img src="{{ logo }}.png" srcset="{{ logo }}-100.png 100w, {{ logo }}-320.png 320w, {{ logo }}-480.png 480w, {{ logo }}-640.png 640w" alt="{{ alt }}">
51
- </a>
52
- {%- endif -%}
53
11
  </div>
54
12
 
55
13
 
@@ -60,12 +18,13 @@ main_class: section
60
18
  <div id="content-footer">
61
19
  {%- assign social_links = page.social_links -%}
62
20
  {%- include social-links.html -%}
21
+ {%- if page.youth_approved -%}{% youth_approved %}{%- endif -%}
63
22
  </div>
64
23
  </div>
65
24
 
66
25
  {%- if page.social_links.twitter -%}
67
26
  <div id="tweets">
68
27
  {% assign twitter_url = 'https://twitter.com/' | append: page.social_links.twitter %}
69
- {% twitternocache twitter_url limit=3 %}
28
+ {% twitter twitter_url limit=3 %}
70
29
  </div>
71
30
  {%- endif -%}
data/_sass/sections.scss CHANGED
@@ -3,29 +3,28 @@ main.layout-section {
3
3
  flex-direction: row;
4
4
 
5
5
  #content {
6
- #content-header {
7
- display: flex;
8
- justify-content: space-between;
9
- align-items: center;
10
-
11
- h1 {
12
- margin: 0;
13
- }
14
-
15
- img {
16
- max-width: 20rem;
17
- max-height: 10rem;
18
- }
19
- }
20
-
21
6
  #content-body {
22
7
  max-width: 45rem;
23
8
  }
24
9
 
25
10
  #content-footer {
26
11
  display: flex;
27
- justify-content: space-between;
28
- align-items: center;
12
+ flex-wrap: wrap;
13
+ justify-content: space-around;
14
+ align-items: flex-start;
15
+
16
+ .youth-approved-seal {
17
+ max-width: 10rem;
18
+ }
19
+
20
+ @media screen and (max-width: 32rem) {
21
+ flex-direction: column;
22
+ align-items: center;
23
+
24
+ .youth-approved-seal {
25
+ max-width: 7.5rem;
26
+ }
27
+ }
29
28
  }
30
29
  }
31
30
 
@@ -41,27 +40,3 @@ main.layout-section {
41
40
  display: none;
42
41
  }
43
42
  }
44
-
45
- @media screen and (max-width: 40rem) {
46
- main.layout-section {
47
- #content {
48
- #content-header {
49
- img {
50
- max-width: 15rem;
51
- }
52
- }
53
- }
54
- }
55
- }
56
-
57
- @media screen and (max-width: 30rem) {
58
- main.layout-section {
59
- #content {
60
- #content-header {
61
- img {
62
- max-width: 10rem;
63
- }
64
- }
65
- }
66
- }
67
- }
data/assets/css/main.scss CHANGED
@@ -23,8 +23,33 @@
23
23
  --text-color: var(--scout-black);
24
24
  }
25
25
 
26
+ @font-face {
27
+ font-family: 'Nunito Sans';
28
+ font-style: normal;
29
+ font-weight: 400;
30
+ src: url({{ "assets/fonts/NunitoSans/NunitoSans-Regular.ttf" | relative_url}});
31
+ }
32
+ @font-face {
33
+ font-family: 'Nunito Sans';
34
+ font-style: italic;
35
+ font-weight: 400;
36
+ src: url({{ "assets/fonts/NunitoSans/NunitoSans-Italic.ttf" | relative_url}});
37
+ }
38
+ @font-face {
39
+ font-family: 'Nunito Sans';
40
+ font-style: normal;
41
+ font-weight: 700;
42
+ src: url({{ "assets/fonts/NunitoSans/NunitoSans-Black.ttf" | relative_url}});
43
+ }
44
+ @font-face {
45
+ font-family: 'Nunito Sans';
46
+ font-style: italic;
47
+ font-weight: 700;
48
+ src: url({{ "assets/fonts/NunitoSans/NunitoSans-BlackItalic.ttf" | relative_url}});
49
+ }
50
+
26
51
  html {
27
- font-family: "Nunito Sans", Arial, sans-serif;
52
+ font-family: 'Nunito Sans', Arial, sans-serif;
28
53
  scroll-behavior: smooth;
29
54
  }
30
55
 
@@ -129,6 +154,10 @@ ul.social-links {
129
154
  }
130
155
  }
131
156
 
157
+ .youth-approved-seal {
158
+ max-width: 20rem;
159
+ }
160
+
132
161
 
133
162
  @import "header";
134
163
 
@@ -0,0 +1,93 @@
1
+ Copyright 2016 The Nunito Sans Project Authors (https://github.com/Fonthausen/NunitoSans)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Jekyll
4
+ module ScoutsUk2018
5
+ class Tag < Liquid::Tag
6
+ def initialize(_tag_name, markup, _parse_context)
7
+ super
8
+
9
+ @level, @expires = markup.strip.split(/\s+/, 2)
10
+ end
11
+
12
+ def render(context)
13
+ expires = @expires || context.registers[:page]['youth_approved']&.[]('expires')
14
+ return if expires && expires.to_s < Date.today.to_s
15
+ level = @level || context.registers[:page]['youth_approved']&.[]('level')
16
+
17
+ logo = "#{context.registers[:site].config.fetch('baseurl', '').to_s.chomp('/')}/assets/images/YouthApproved#{level&.capitalize}"
18
+ alt = if level
19
+ "We've got the #{level.capitalize} Youth Approved award from Scouts Scotland."
20
+ else
21
+ "Scouts Scotland's Youth Approved award."
22
+ end
23
+
24
+ html = <<~__HTML__
25
+ <a href="https://www.scouts.scot/members/youth-involvement/youth-approved-award/" rel="nofollow noopener" target="_blank">
26
+ <img
27
+ class="youth-approved-seal"
28
+ src="#{logo}.png"
29
+ srcset="#{logo}-100.png 100w,
30
+ #{logo}-320.png 320w,
31
+ #{logo}-480.png 480w,
32
+ #{logo}-640.png 640w"
33
+ alt="#{alt}"
34
+ >
35
+ </a>
36
+ __HTML__
37
+ html.gsub(/\s+\>/, '>').gsub(/\s+\</, '<').gsub(/\s+/, ' ')
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'jekyll-scouts_uk_2018/tag'
4
+
5
+ module Jekyll
6
+ module ScoutsUk2018
7
+ end
8
+ end
9
+
10
+
11
+ Liquid::Template.register_tag('youth_approved', Jekyll::ScoutsUk2018::Tag)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-scouts_uk_2018
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Gauld
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-23 00:00:00.000000000 Z
11
+ date: 2022-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -61,7 +61,6 @@ extra_rdoc_files: []
61
61
  files:
62
62
  - LICENSE.txt
63
63
  - README.md
64
- - _config.yml
65
64
  - _includes/footer.html
66
65
  - _includes/head.html
67
66
  - _includes/header-logo.html
@@ -78,6 +77,21 @@ files:
78
77
  - _sass/sections.scss
79
78
  - assets/css/main.scss
80
79
  - assets/favicon.ico
80
+ - assets/fonts/NunitoSans/NunitoSans-Black.ttf
81
+ - assets/fonts/NunitoSans/NunitoSans-BlackItalic.ttf
82
+ - assets/fonts/NunitoSans/NunitoSans-Bold.ttf
83
+ - assets/fonts/NunitoSans/NunitoSans-BoldItalic.ttf
84
+ - assets/fonts/NunitoSans/NunitoSans-ExtraBold.ttf
85
+ - assets/fonts/NunitoSans/NunitoSans-ExtraBoldItalic.ttf
86
+ - assets/fonts/NunitoSans/NunitoSans-ExtraLight.ttf
87
+ - assets/fonts/NunitoSans/NunitoSans-ExtraLightItalic.ttf
88
+ - assets/fonts/NunitoSans/NunitoSans-Italic.ttf
89
+ - assets/fonts/NunitoSans/NunitoSans-Light.ttf
90
+ - assets/fonts/NunitoSans/NunitoSans-LightItalic.ttf
91
+ - assets/fonts/NunitoSans/NunitoSans-Regular.ttf
92
+ - assets/fonts/NunitoSans/NunitoSans-SemiBold.ttf
93
+ - assets/fonts/NunitoSans/NunitoSans-SemiBoldItalic.ttf
94
+ - assets/fonts/NunitoSans/OFL.txt
81
95
  - assets/images/YouthApproved-100.png
82
96
  - assets/images/YouthApproved-320.png
83
97
  - assets/images/YouthApproved-480.png
@@ -287,6 +301,8 @@ files:
287
301
  - assets/images/logos/SquirrelsSymbolYellow-100.png
288
302
  - assets/images/logos/SquirrelsSymbolYellow.png
289
303
  - assets/images/tabler-icons-sprite.svg
304
+ - lib/jekyll-scouts_uk_2018.rb
305
+ - lib/jekyll-scouts_uk_2018/tag.rb
290
306
  homepage: https://github.com/27thAberdeenScoutGroup/jekyll-scouts_uk_2018
291
307
  licenses:
292
308
  - BSD-3-Clause
data/_config.yml DELETED
File without changes