jekyll-theme-amethyst 0.3.1 → 0.4.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: 0aaebdf3c406b02d936449860b4c7a5ba6c095bbd9e5c38f7b285baeeb7a0076
4
- data.tar.gz: 63ef83f3c508dccf24cfd7b1fe932601acaccf117437b11cf48f366f15e3eef9
3
+ metadata.gz: 885f5b7a5ae2e9b5997b2fb05ef3cd16d41d836da975e255bd98f28b184e2b5d
4
+ data.tar.gz: a483603a8616df9defba29971850177b4a29697d764af354f04679039f6e8297
5
5
  SHA512:
6
- metadata.gz: 8608f987de9794140e314ddcbff2df3bb45057e48de3b73e0f71cbca2bf2a1ccb474e4b0191fc06ea2e8222e8a513ff30a7d8a8e1e0699d990967fed83235409
7
- data.tar.gz: f61ecbe0b8d1d33d1033a7bf419e53ef6e17149cc2cfc7624e6915afe6baab935c63abcd8076f846edff4cd45a6dca00eb3ef203d0ab3e039bbf952c9c5a9d6f
6
+ metadata.gz: 69aba6c9b3385f9f11fa03752747f03168481ce74c9e8d9148da623b14fd1292f2db5ed44bf6d1149921ecdecf7974147a74349d506fcc3b0173ed749bdc0d61
7
+ data.tar.gz: 20d6ab32044f7ad93d4e358f32d95921ab2b05df7586412fe98c3b037e3026d22be8241531842eea08c1816046b1ecf8eed633e3defa1fc676281e49f6b1c778
@@ -1,11 +1,13 @@
1
1
  - group: foo
2
- expand: true
2
+ expand: initial
3
+ initial: /api/
3
4
 
4
5
  - group: lorem
5
6
 
6
7
  - type: link
7
8
  url: /api/deprecated/
8
9
  title: Deprecated
10
+
9
11
  - type: link
10
12
  url: /api/removed/
11
13
  title: Removed
@@ -33,11 +33,15 @@ Block data:
33
33
  When using a "list" block, an array of objects with "title"
34
34
  and "url" properties.
35
35
 
36
- * expand: [Default: active]
36
+ * expand: [Default: "active"]
37
37
  Whether a block should be expanded.
38
38
  - true: Always expanded.
39
39
  - false: Never expanded.
40
40
  - active: Expand when the current page is in the list.
41
+ - initial: Expand on the home page, and when the current page is in the list.
42
+
43
+ * initial: [Default: "/"]
44
+ Override which address the "initial" expand mode will compare to.
41
45
 
42
46
  {%- endcomment -%}
43
47
  <aside class="sidebar" role="complementary">
@@ -47,9 +51,10 @@ Block data:
47
51
  {%- assign block_url = block.url -%}
48
52
  {%- assign block_contents = block.list -%}
49
53
  {%- assign block_expand = block.expand -%}
50
- {%- if block_expand != true and block_expand != false -%}
54
+ {%- if block_expand != true and block_expand != false and block_expand != "initial" -%}
51
55
  {%- assign block_expand = "active" -%}
52
56
  {%- endif -%}
57
+ {%- assign block_initial = block.initial | default: "/" -%}
53
58
 
54
59
  {%- if block_type == "group" -%}
55
60
  {%- assign group_page = site.pages | where: "layout", "group" | where: "group", block.group | first -%}
@@ -67,6 +72,15 @@ Block data:
67
72
  {%- assign block_expand = false -%}
68
73
  {%- endif -%}
69
74
 
75
+ {%- if block_expand == "initial" -%}
76
+ {%- assign block_expand = false -%}
77
+ {%- if page.url == block_initial -%}
78
+ {%- assign block_expand = true -%}
79
+ {%- else -%}
80
+ {%- assign block_expand = "active" -%}
81
+ {%- endif -%}
82
+ {%- endif -%}
83
+
70
84
  {%- if block_expand == "active" -%}
71
85
  {%- assign self_in_contents = block_contents | where: 'url', page.url | size -%}
72
86
  {%- if page.url == block_url or self_in_contents > 0 -%}
data/amethyst.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "jekyll-theme-amethyst"
3
- spec.version = "0.3.1"
3
+ spec.version = "0.4.0"
4
4
  spec.summary = "https://github.com/qunitjs/jekyll-theme-amethyst"
5
5
  spec.authors = ["Timo Tijhof", "Trent Willis"]
6
6
  spec.files = `git ls-files -z`.split("\x0")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-amethyst
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timo Tijhof