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 +4 -4
- data/_data/sitenav.yml +5 -2
- data/_layouts/wrapper.html +3 -25
- data/_sass/amethyst.scss +16 -1
- data/amethyst.gemspec +1 -1
- data/docs/config.md +1 -0
- metadata +2 -3
- data/guides.md +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38574e61b505ed9369e00635883fa96c647777477a4948f2014cddc262294347
|
4
|
+
data.tar.gz: 3615fc09dd924333280fe835755d20bee3b6b961c8e212faab0a14f03f3c1b58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
data/_layouts/wrapper.html
CHANGED
@@ -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
|
-
|
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.
|
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
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.
|
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-
|
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