jekyll-theme-amethyst 0.2.0 → 0.2.1

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: ae1f567530a5c557779c453ab8ea18940c3620baa598d0362fe922bd2b6fff2f
4
- data.tar.gz: 1c202be8204ee0d9073f337cff0b5145a3ef7019b8b1c59e835e750fe1353c72
3
+ metadata.gz: 38574e61b505ed9369e00635883fa96c647777477a4948f2014cddc262294347
4
+ data.tar.gz: 3615fc09dd924333280fe835755d20bee3b6b961c8e212faab0a14f03f3c1b58
5
5
  SHA512:
6
- metadata.gz: f633624fe399ba7a0258b0109c530d3c45155d2b6c350b3bb655895e36beb07b844275f9b479d3b37794bb98b0ac833120c79be16a9a609f5d5e8605849844f8
7
- data.tar.gz: 0102d31b93866380a0018c5529c0c78e018ba10833eb8fa57300fe2463acfc3de746ba4d64894cfe1d4b5bf8e201bab107dbd6e1f677b57f37abb1600df8f26f
6
+ metadata.gz: c0c56a50b0bcd33d9a638d4c9fe933a63c404a5c9fef7b0172056516cd2072cfd9f703bebd0bd05eab33f6467de7e58cf1480529edf08685028f961e585c2128
7
+ data.tar.gz: a7da06f4ff9453c14cdf8d1c9d61f62c5cf27be9d9e1aa81f06400c8f935bd016f828e8bc328701ab3921e17421afe4a59ebbecc9fe2a666024882489257c45a
data/_data/sitenav.yml CHANGED
@@ -1,10 +1,13 @@
1
1
  - name: Guides
2
- href: /guides/
3
2
  sub:
4
3
  - name: Getting Started
5
4
  href: /intro/
6
5
  - name: Documentation
7
- href: /api/
6
+ sub:
7
+ - name: Foobar
8
+ href: /api/foo/
9
+ - name: Lorem ipsum
10
+ href: /api/lorem/
8
11
  - name: Blog
9
12
  href: /blog/
10
13
  - name: About
@@ -21,13 +21,15 @@
21
21
  <nav class="site-nav"><ul class="site-nav-list">
22
22
  {%- for item in site.data.sitenav -%}
23
23
  <li class="site-nav-item{%- if item.sub %} has-sub-list{% endif %}">
24
- <a class="site-nav-link{%- if item.sub %} has-sub-list{% endif %}" href="{{ item.href | relative_url | escape }}">{{ item.name }}</a>
25
24
  {%- if item.sub -%}
25
+ <span class="site-nav-link has-sub-list" tabindex="0">{{ item.name | escape }}</span>
26
26
  <ul class="site-nav-sub-list">
27
27
  {%- for sub in item.sub -%}
28
28
  <li><a class="site-sub-nav-link" href="{{ sub.href | relative_url | escape }}">{{ sub.name | escape }}</a></li>
29
29
  {%- endfor -%}
30
30
  </ul>
31
+ {%- elsif item.href -%}
32
+ <a class="site-nav-link" href="{{ item.href | relative_url | escape }}">{{ item.name | escape }}</a>
31
33
  {%- endif -%}
32
34
  </li>
33
35
  {%- endfor -%}
@@ -104,29 +106,5 @@
104
106
  {%- if site.amethyst.algolia.search_only_api_key -%}
105
107
  {%- include search-js.html -%}
106
108
  {%- endif -%}
107
- <script type="module">
108
- window.addEventListener('DOMContentLoaded', function setupSubNav() {
109
- const siteNav = document.querySelector('.site-nav-list');
110
- const closeSubNav = () => {
111
- const prevSub = siteNav.querySelector('.is-open');
112
- if (prevSub) {
113
- prevSub.classList.remove('is-open');
114
- }
115
- }
116
- siteNav.addEventListener('click', (event) => {
117
- if (event.target.classList.contains('has-sub-list')) {
118
- event.preventDefault();
119
- event.stopPropagation();
120
-
121
- if (event.target.parentNode.classList.contains('is-open')) {
122
- closeSubNav();
123
- } else {
124
- closeSubNav();
125
- event.target.parentNode.classList.add('is-open');
126
- }
127
- }
128
- });
129
- });
130
- </script>
131
109
  </body>
132
110
  </html>
data/_sass/amethyst.scss CHANGED
@@ -367,6 +367,7 @@ table {
367
367
  height: 100%;
368
368
  padding: $size-1;
369
369
  text-decoration: none;
370
+ cursor: pointer; // For non-link <span> with sub list
370
371
 
371
372
  @media (min-width: $screen-m) {
372
373
  color: $color-bright;
@@ -413,7 +414,21 @@ table {
413
414
  }
414
415
  }
415
416
 
416
- .site-nav-item.is-open .site-nav-sub-list {
417
+ // Modern browsers support focus-within.
418
+ // Open menu on clicking the entry link, and stay open until
419
+ // a click outside the menu or a click on a different menu.
420
+ // Specifically, when using accessibility tools to focus links
421
+ // in the submenu (thus not focussing the entry link any more),
422
+ // the menu must stay open.
423
+ .site-nav-item:focus-within .site-nav-sub-list {
424
+ display: block;
425
+ }
426
+ // In older browsers, fall back to opening on click,
427
+ // and trying to stay open so long as the cursor is within the menu.
428
+ // This must be a separate selector block.
429
+ // <https://css-tricks.com/solved-with-css-dropdown-menus/>
430
+ .site-nav-link:focus ~ .site-nav-sub-list,
431
+ .site-nav-sub-list:hover {
417
432
  display: block;
418
433
  }
419
434
 
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.2.0"
3
+ spec.version = "0.2.1"
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")
data/docs/config.md CHANGED
@@ -17,6 +17,7 @@ timezone: UTC
17
17
  # Amethyst theme options are documented at:
18
18
  # https://github.com/qunitjs/jekyll-theme-amethyst/blob/main/docs/config.md
19
19
  #
20
+ theme: jekyll-theme-amethyst
20
21
  amethyst:
21
22
  # Default: "/favicon.svg"
22
23
  favicon:
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.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timo Tijhof
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-09-06 00:00:00.000000000 Z
12
+ date: 2021-09-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jekyll
@@ -189,7 +189,6 @@ files:
189
189
  - docs/config.md
190
190
  - docs/getting-started.md
191
191
  - favicon.svg
192
- - guides.md
193
192
  - index.md
194
193
  - intro.md
195
194
  - lib/jekyll-theme-amethyst.rb
data/guides.md DELETED
@@ -1,11 +0,0 @@
1
- ---
2
- layout: page
3
- title: Guides
4
- ---
5
-
6
- <p class="lead">The following guides are here to help you.</p>
7
-
8
- ## [Getting Started](./intro.md)
9
-
10
- A guided introduction. If you've never before, or need a refresher on the basics, this is for you.
11
-