fenton-jekyll-boilerplate 0.0.11 → 0.0.12
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 +4 -4
- data/_data/language.yaml +8 -0
- data/_includes/breadcrumbs.html +11 -8
- data/_includes/head.html +2 -1
- data/_includes/navigation.html +29 -14
- data/_layouts/author.html +2 -0
- data/_layouts/page.html +2 -0
- data/_layouts/post.html +3 -1
- data/_layouts/search.html +1 -1
- data/assets/css/main.css +39 -9
- data/assets/css/vars.css +2 -1
- data/assets/js/main.js +7 -5
- data/assets/js/modules/animation.js +5 -9
- data/assets/js/modules/click-blocks.js +20 -14
- data/assets/js/modules/focus.js +1 -1
- data/assets/js/modules/nav-expand.js +7 -30
- data/assets/js/modules/nav-mobile.js +17 -11
- data/assets/js/modules/nav-sticky.js +6 -6
- data/assets/js/modules/query.js +4 -4
- data/assets/js/modules/resizing.js +2 -2
- data/assets/search/search.json +54 -32
- data/assets/search/search.md +0 -2
- data/assets/sitemap/authors.xml +12 -2
- data/assets/sitemap/pages.xml +13 -3
- data/assets/sitemap/posts.xml +12 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c9147748f6d04738a5ac523a9bb3152e3b20e63a93d3a0800c29a139925efc4
|
4
|
+
data.tar.gz: 36bcab32d83e1efd66eba6d00aa55fe1f563e7fb04bfe2c5fa8712511ff7e8f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad7d18e6a4da9c033d1ecd9a31d127d41988e4621fa2b7fba6041edc62bb6499309cec55f196b334c4fd060765888a7090391a58aea7dc9421b7e645b6ab7a63
|
7
|
+
data.tar.gz: d0b0374cfcb23fc215601466c3d6e634259ca71192f7917af4b12a2f6532e45bb965af63350e07a42733dd42bc3c93de5787fbf74d390f5385dd0189768c7caa
|
data/_data/language.yaml
CHANGED
@@ -7,6 +7,14 @@
|
|
7
7
|
# If you are running Jekyll v4.3.0 or higher, you don't need this file in your site
|
8
8
|
# as it will be read from the theme's _data folder
|
9
9
|
|
10
|
+
aria:
|
11
|
+
breadcrumbs:
|
12
|
+
en: Breadcrumb
|
13
|
+
site_navigation:
|
14
|
+
en: Site Navigation
|
15
|
+
paging:
|
16
|
+
en: Paging
|
17
|
+
|
10
18
|
skiplinks:
|
11
19
|
skip_to_navigation:
|
12
20
|
en: Skip to navigation
|
data/_includes/breadcrumbs.html
CHANGED
@@ -1,19 +1,22 @@
|
|
1
|
-
|
1
|
+
{%- assign current_url = page.url | remove: 'index.html' %}
|
2
|
+
<nav class="site-breadcrumbs" aria-label="{{ 'aria' | t: 'breadcrumbs' }}">
|
2
3
|
<ol vocab="http://schema.org/" typeof="BreadcrumbList">
|
3
4
|
{%- for crumb in breadcrumbs %}
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
{%- if forloop.last %}
|
6
|
+
<li property="itemListElement" typeof="ListItem">
|
7
|
+
<a property="item" typeof="WebPage" href="{{ crumb.url | relative_url }}" aria-current="page">
|
8
|
+
<span property="name">{{ crumb.title }}</span>
|
9
|
+
<meta property="position" content="{{ crumb.position }}" />
|
10
|
+
</a>
|
11
|
+
</li>
|
12
|
+
{%- else %}
|
11
13
|
<li property="itemListElement" typeof="ListItem">
|
12
14
|
<a property="item" typeof="WebPage" href="{{ crumb.url | relative_url }}">
|
13
15
|
<span property="name">{{ crumb.title }}</span>
|
14
16
|
<meta property="position" content="{{ crumb.position }}" />
|
15
17
|
</a>
|
16
18
|
</li>
|
19
|
+
{%- endif %}
|
17
20
|
{%- endfor %}
|
18
21
|
</ol>
|
19
22
|
</nav>
|
data/_includes/head.html
CHANGED
@@ -22,6 +22,7 @@
|
|
22
22
|
<link rel="alternate" href="{{ "/sitemap.xml" | prepend: site.baseurl }}" type="application/rss+xml" />
|
23
23
|
<link rel="stylesheet" href="{{ "/assets/css/vars.css" | prepend: site.baseurl }}" />
|
24
24
|
<link rel="stylesheet" href="{{ "/assets/css/main.css" | prepend: site.baseurl }}" />
|
25
|
-
<link rel="stylesheet" href="{{ "/assets/css/code.css" | prepend: site.baseurl }}"
|
25
|
+
<link rel="stylesheet" href="{{ "/assets/css/code.css" | prepend: site.baseurl }}" media="print" onload="this.media = 'all'" />
|
26
|
+
<noscript><link rel="stylesheet" href="{{ "/assets/css/code.css" | prepend: site.baseurl }}" /></noscript>
|
26
27
|
{% include analytics.html %}
|
27
28
|
</head>
|
data/_includes/navigation.html
CHANGED
@@ -1,34 +1,49 @@
|
|
1
|
-
<nav class="site-nav" id="site-nav">
|
1
|
+
<nav class="site-nav" id="site-nav" aria-label="{{ 'aria' | t: 'site_navigation' }}">
|
2
2
|
<h2 class="site-nav-title">{{ 'navigation' | t: 'title' }}</h2>
|
3
3
|
<ul>
|
4
|
+
{%- assign current_url = page.url | remove: 'index.html' %}
|
4
5
|
{%- assign previous = null %}
|
5
6
|
{%- assign regex = '/' | append: site.paginate_page | append: '[0-9]/' %}
|
6
7
|
{%- assign main_pages = site.pages | where: 'nav-level', '1' | sort: 'nav-order' -%}
|
7
|
-
{% for
|
8
|
-
{%- assign current =
|
8
|
+
{% for item in main_pages %}
|
9
|
+
{%- assign current = item.nav-title | default: item.title %}
|
9
10
|
{%- if (current != previous) %}
|
10
|
-
|
11
|
-
|
11
|
+
{%- assign previous = item.nav-title | default: item.title %}
|
12
|
+
|
13
|
+
{%- assign parent_perma = item.permalink %}
|
14
|
+
{%- assign parent_perma_size = parent_perma | size %}
|
15
|
+
{%- assign sub_pages = '' | split: '' %}
|
16
|
+
|
17
|
+
{%- for p in site.pages %}
|
18
|
+
{%- assign child_perma = p.permalink %}
|
19
|
+
{%- assign child_perma_truncated = child_perma | truncate: parent_perma_size, '' %}
|
20
|
+
|
21
|
+
{%- if parent_perma != '/' and child_perma_truncated == parent_perma and child_perma != parent_perma %}
|
22
|
+
{%- assign sub_pages = sub_pages | push: p %}
|
23
|
+
{%- endif %}
|
24
|
+
{%- endfor %}
|
25
|
+
|
12
26
|
<li{%- if sub_pages.size > 0 %} class="has-children"{% endif %}>
|
13
|
-
|
27
|
+
{%- assign item_url = item.url | regex_replace: regex,'/' | prepend: site.baseurl %}
|
28
|
+
{%- if sub_pages.size > 0 %}
|
14
29
|
<details class="sub-nav">
|
15
|
-
<summary><span>{{
|
16
|
-
|
17
|
-
<a href="{{
|
18
|
-
|
19
|
-
|
30
|
+
<summary><span>{{ item.nav-section | default: item.nav-title | default: item.title }}</span></summary>
|
31
|
+
{%- else %}
|
32
|
+
<a href="{{ item_url }}"{% if item_url == current_url) %} class="current-item" aria-current="page"{% endif %}>{{ item.nav-title | default: item.title }}</a>
|
33
|
+
{%- endif -%}
|
34
|
+
{% if sub_pages.size > 0 %}
|
20
35
|
<ul>
|
21
36
|
<li>
|
22
|
-
<a href="{{
|
37
|
+
<a href="{{ item_url }}"{% if item_url == current_url) %} class="current-item" aria-current="page"{% endif %}>{{ item.nav-title | default: item.title }}</a>
|
23
38
|
</li>
|
24
39
|
{%- for child in sub_pages %}
|
25
40
|
<li>
|
26
|
-
<a href="{{ child.url | prepend: site.baseurl }}">{{ child.nav-title | default: child.title }}</a>
|
41
|
+
<a href="{{ child.url | prepend: site.baseurl }}"{% if child.url == current_url) %} class="current-item" aria-current="page"{% endif %}>{{ child.nav-title | default: child.title }}</a>
|
27
42
|
</li>
|
28
43
|
{%- endfor %}
|
29
44
|
</ul>
|
30
45
|
</details>
|
31
|
-
|
46
|
+
{%- endif %}
|
32
47
|
</li>
|
33
48
|
{%- endif %}
|
34
49
|
{%- endfor %}
|
data/_layouts/author.html
CHANGED
data/_layouts/page.html
CHANGED
data/_layouts/post.html
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
layout: default
|
3
3
|
---
|
4
4
|
<main id="site-main">
|
5
|
+
<article>
|
5
6
|
<header>
|
6
7
|
<h1>{{ page.title }}</h1>
|
7
8
|
</header>
|
@@ -18,7 +19,7 @@ layout: default
|
|
18
19
|
<img src="/{{ author.picture }}" alt="{{ author.name }}" class="author-image" />
|
19
20
|
{%- endif %}
|
20
21
|
{%- capture data -%}
|
21
|
-
<a href="{{ site.url }}{{ site.baseurl }}/
|
22
|
+
<a href="{{ site.url }}{{ site.baseurl }}/authors/{{ author.username }}/">{{ author.name }}</a>
|
22
23
|
{%- endcapture %}
|
23
24
|
{%- assign authordata = authordata | push: data %}
|
24
25
|
{%- endif %}
|
@@ -34,4 +35,5 @@ layout: default
|
|
34
35
|
<div>
|
35
36
|
{{ content }}
|
36
37
|
</div>
|
38
|
+
</article>
|
37
39
|
</main>
|
data/_layouts/search.html
CHANGED
@@ -7,7 +7,7 @@ layout: default
|
|
7
7
|
</header>
|
8
8
|
<div>
|
9
9
|
{{ content }}
|
10
|
-
<form method="GET" action="{{ site.search_fallback_url }}" id="site-search" class="site-search note" autocomplete="off">
|
10
|
+
<form method="GET" action="{{ site.search_fallback_url }}" role="search" id="site-search" class="site-search note" autocomplete="off">
|
11
11
|
<fieldset>
|
12
12
|
<input type="hidden" name="{{ site.search_fallback_site }}" value="{{ site.url | prepend: 'site:' }}" />
|
13
13
|
<div>
|
data/assets/css/main.css
CHANGED
@@ -68,7 +68,7 @@ blockquote {
|
|
68
68
|
padding: 0.1px 1.2em;
|
69
69
|
position: relative;
|
70
70
|
box-shadow: var(--box-shadow);
|
71
|
-
margin:
|
71
|
+
margin: var(--paragraph-margin) 0;
|
72
72
|
}
|
73
73
|
|
74
74
|
blockquote::after {
|
@@ -133,18 +133,18 @@ h4, h5, h6 {
|
|
133
133
|
}
|
134
134
|
|
135
135
|
hr {
|
136
|
-
border: 0.5px
|
136
|
+
border: 0.5px dashed var(--fore);
|
137
137
|
opacity: 0.5;
|
138
138
|
width: 80%;
|
139
|
-
margin:
|
139
|
+
margin: var(--paragraph-margin) auto;
|
140
140
|
}
|
141
141
|
|
142
142
|
img {
|
143
143
|
max-width: 100%;
|
144
144
|
}
|
145
145
|
|
146
|
-
p
|
147
|
-
margin:
|
146
|
+
p {
|
147
|
+
margin: var(--paragraph-margin) 0;
|
148
148
|
}
|
149
149
|
|
150
150
|
strong {
|
@@ -286,6 +286,12 @@ body > footer {
|
|
286
286
|
content: ''
|
287
287
|
}
|
288
288
|
|
289
|
+
.site-breadcrumbs a[aria-current] {
|
290
|
+
color: var(--fore);
|
291
|
+
text-decoration: none;
|
292
|
+
}
|
293
|
+
|
294
|
+
|
289
295
|
/* Content Group */
|
290
296
|
|
291
297
|
.content-group {
|
@@ -334,7 +340,7 @@ nav.site-nav li.has-children ul a {
|
|
334
340
|
text-indent: calc(var(--marker-size) * 2);
|
335
341
|
}
|
336
342
|
|
337
|
-
nav.site-nav
|
343
|
+
nav.site-nav a[aria-current] {
|
338
344
|
font-weight: bold;
|
339
345
|
}
|
340
346
|
|
@@ -373,11 +379,15 @@ main {
|
|
373
379
|
}
|
374
380
|
|
375
381
|
main ul, main ol {
|
376
|
-
margin
|
382
|
+
margin: var(--paragraph-margin) 0 var(--paragraph-margin) 1.2rem;
|
377
383
|
}
|
378
384
|
|
379
|
-
main ul
|
380
|
-
|
385
|
+
main ul ol, main ul ul, main ol ol, main ol ul {
|
386
|
+
margin: 0 0 0 1.2rem;
|
387
|
+
}
|
388
|
+
|
389
|
+
li::marker {
|
390
|
+
color: var(--fore-headings);
|
381
391
|
}
|
382
392
|
|
383
393
|
/* Jekyll Post List */
|
@@ -414,6 +424,11 @@ main ul li, main ol li {
|
|
414
424
|
text-align: center;
|
415
425
|
}
|
416
426
|
|
427
|
+
.post-paging > * {
|
428
|
+
display: inline-block;
|
429
|
+
padding: 0.3rem;
|
430
|
+
}
|
431
|
+
|
417
432
|
/* Jekyll Post */
|
418
433
|
.post-meta {
|
419
434
|
display: flex;
|
@@ -555,6 +570,21 @@ form.site-search button {
|
|
555
570
|
display: block;
|
556
571
|
}
|
557
572
|
|
573
|
+
/* Collapse Paging */
|
574
|
+
|
575
|
+
.post-paging > * {
|
576
|
+
display: none;
|
577
|
+
}
|
578
|
+
|
579
|
+
.post-paging > *:first-child {
|
580
|
+
display: inline-block;
|
581
|
+
}
|
582
|
+
|
583
|
+
.post-paging > *:last-child {
|
584
|
+
display: inline-block;
|
585
|
+
}
|
586
|
+
|
587
|
+
|
558
588
|
/* */
|
559
589
|
form.site-search div {
|
560
590
|
grid-template-columns: repeat(1, auto);
|
data/assets/css/vars.css
CHANGED
data/assets/js/main.js
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
// @ts-check
|
2
2
|
|
3
|
-
import { setNavigationTree
|
3
|
+
import { setNavigationTree } from './modules/nav-expand.js';
|
4
4
|
import { setClickableBlocks } from './modules/click-blocks.js';
|
5
5
|
import { addResizedEvent } from './modules/resizing.js';
|
6
6
|
import { addStickyNavigation } from './modules/nav-sticky.js';
|
7
7
|
import { addMobileNavigation } from './modules/nav-mobile.js';
|
8
8
|
import { addIntersectionObserver } from './modules/animation.js';
|
9
|
+
import { qsa } from './modules/query.js';
|
9
10
|
|
10
11
|
setNavigationTree('details.sub-nav');
|
11
|
-
|
12
|
-
setClickableBlocks('data-destination');
|
12
|
+
setClickableBlocks();
|
13
13
|
|
14
|
-
|
14
|
+
const resizedEventName = addResizedEvent();
|
15
15
|
|
16
16
|
addStickyNavigation('.site-header', '.site-nav', '.site-nav > ul', resizedEventName);
|
17
17
|
addMobileNavigation('.navigation-icon', '.site-nav', resizedEventName);
|
18
|
-
addIntersectionObserver('.post-list .list-item, main img, main .note, main blockquote');
|
18
|
+
addIntersectionObserver('.post-list .list-item, main img, main .note, main blockquote');
|
19
|
+
|
20
|
+
qsa('pre.highlight').forEach((elem) => elem.setAttribute('tabindex', '0'));
|
@@ -17,25 +17,21 @@ import { qsa } from './query.js';
|
|
17
17
|
*/
|
18
18
|
function addIntersectionObserver(listItemQuery) {
|
19
19
|
function handleIntersection(entries, observer) {
|
20
|
-
for (
|
21
|
-
|
20
|
+
for (let entry of entries) {
|
21
|
+
const value = entry.isIntersecting ? 1 : 0;
|
22
22
|
entry.target.style.setProperty('--shown', value);
|
23
23
|
}
|
24
24
|
}
|
25
25
|
|
26
|
-
|
26
|
+
const options = {
|
27
27
|
root: null,
|
28
28
|
rootMargin: '0px',
|
29
29
|
threshold: 0
|
30
30
|
};
|
31
31
|
|
32
|
-
|
32
|
+
const observer = new IntersectionObserver(handleIntersection, options)
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
for (var i = 0; i < items.length; i++) {
|
37
|
-
observer.observe(items[i]);
|
38
|
-
}
|
34
|
+
qsa(listItemQuery).forEach((elem) => observer.observe(elem));
|
39
35
|
}
|
40
36
|
|
41
37
|
export { addIntersectionObserver };
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
import { qsa } from './query.js';
|
4
4
|
|
5
|
+
const dataAttributeName = 'data-destination';
|
6
|
+
|
5
7
|
/**
|
6
8
|
* Makes an entire block clickable based on a data-attribute, usually "data-destination"
|
7
9
|
*
|
@@ -12,23 +14,27 @@ import { qsa } from './query.js';
|
|
12
14
|
* Use clickable blocks to allow keyboard users to tab through the real links, but still
|
13
15
|
* capture clicks elsewhere on the block.
|
14
16
|
*
|
15
|
-
* @param {string} dataAttributeName
|
16
17
|
*/
|
17
|
-
function setClickableBlocks(
|
18
|
-
|
19
|
-
|
20
|
-
for(var i = 0; i < listItems.length; i++) {
|
21
|
-
var listItem = listItems[i];
|
18
|
+
function setClickableBlocks() {
|
19
|
+
qsa('[' + dataAttributeName + ']').forEach((listItem) => {
|
22
20
|
listItem.style.cursor = 'pointer';
|
23
|
-
listItem.addEventListener('click',
|
24
|
-
|
21
|
+
listItem.addEventListener('click', handleClick);
|
22
|
+
});
|
23
|
+
}
|
24
|
+
|
25
|
+
/**
|
26
|
+
* Handles the block-level clicks
|
27
|
+
*
|
28
|
+
* @param {Event} e
|
29
|
+
* @returns
|
30
|
+
*/
|
31
|
+
function handleClick(e) {
|
32
|
+
const location = this.getAttribute(dataAttributeName);
|
25
33
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
}
|
31
|
-
});
|
34
|
+
if (location) {
|
35
|
+
e.preventDefault();
|
36
|
+
document.location = location;
|
37
|
+
return false;
|
32
38
|
}
|
33
39
|
}
|
34
40
|
|
data/assets/js/modules/focus.js
CHANGED
@@ -14,7 +14,7 @@ import { qsa } from './query.js';
|
|
14
14
|
* @returns {{first: HTMLElement, last: HTMLElement, all: HTMLElement[]}}
|
15
15
|
*/
|
16
16
|
function getFocusableElement(target) {
|
17
|
-
|
17
|
+
const focusElements = Array.from(
|
18
18
|
qsa('a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])', target)
|
19
19
|
).filter(function(el) {
|
20
20
|
return !el.hasAttribute('disabled') && !el.getAttribute('aria-hidden');
|
@@ -12,40 +12,17 @@ import { qs, qsa } from './query.js';
|
|
12
12
|
* @param {string} className
|
13
13
|
*/
|
14
14
|
function setNavigationTree(className) {
|
15
|
-
|
16
|
-
|
17
|
-
var location = document.location.pathname;
|
15
|
+
const site = document.location.origin;
|
16
|
+
const location = document.location.pathname;
|
18
17
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
var address = anchorElement.href.replace(site, '');
|
18
|
+
qsa(className).forEach((summary) => {
|
19
|
+
const anchorElement = /** @type {HTMLAnchorElement} */(qs('a', summary));
|
20
|
+
const address = anchorElement.href.replace(site, '');
|
23
21
|
|
24
22
|
if (location.startsWith(address)){
|
25
23
|
summary.setAttribute('open', 'open');
|
26
24
|
}
|
27
|
-
}
|
25
|
+
});
|
28
26
|
}
|
29
27
|
|
30
|
-
|
31
|
-
* Highlights the current navigation item
|
32
|
-
*
|
33
|
-
* @param {string} navQuery
|
34
|
-
* @param {string} selectedClass
|
35
|
-
*/
|
36
|
-
function setNavigationItem(navQuery, selectedClass) {
|
37
|
-
var anchors = qsa(navQuery);
|
38
|
-
var site = document.location.origin;
|
39
|
-
var location = document.location.pathname;
|
40
|
-
|
41
|
-
for (var j = 0; j < anchors.length; j++) {
|
42
|
-
var anchor = /** @type {HTMLAnchorElement} */ (anchors[j]);
|
43
|
-
var href = anchor.href.replace(site, '');
|
44
|
-
|
45
|
-
if (href === location) {
|
46
|
-
anchor.classList.add(selectedClass);
|
47
|
-
}
|
48
|
-
}
|
49
|
-
}
|
50
|
-
|
51
|
-
export { setNavigationTree, setNavigationItem };
|
28
|
+
export { setNavigationTree };
|
@@ -1,6 +1,6 @@
|
|
1
1
|
// @ts-check
|
2
2
|
|
3
|
-
import { qs } from './query.js';
|
3
|
+
import { qs, qsa } from './query.js';
|
4
4
|
import { getFocusableElement, trapFocusForward, trapReverseFocus } from './focus.js';
|
5
5
|
|
6
6
|
/**
|
@@ -15,13 +15,15 @@ import { getFocusableElement, trapFocusForward, trapReverseFocus } from './focus
|
|
15
15
|
*
|
16
16
|
* @param {string} iconSelector
|
17
17
|
* @param {string} navigationSelector
|
18
|
+
* @param {string} resizedEventName
|
18
19
|
*/
|
19
20
|
function addMobileNavigation(iconSelector, navigationSelector, resizedEventName) {
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
const icon = qs(iconSelector);
|
22
|
+
const originalIcon = icon.innerHTML;
|
23
|
+
const overlay = document.createElement('div');
|
24
|
+
const dataOpen = 'data-open';
|
24
25
|
|
26
|
+
// Focus trap (forwards the tab / shift-tab back to the menu)
|
25
27
|
icon.addEventListener('keydown', function(e) {
|
26
28
|
if (icon.getAttribute(dataOpen) === dataOpen) {
|
27
29
|
var focusElements = getFocusableElement(overlay);
|
@@ -30,6 +32,7 @@ import { getFocusableElement, trapFocusForward, trapReverseFocus } from './focus
|
|
30
32
|
}
|
31
33
|
});
|
32
34
|
|
35
|
+
// Opens and closes menu
|
33
36
|
function handleIconInteraction() {
|
34
37
|
if (icon.dataset.open == dataOpen) {
|
35
38
|
closeMobileMenu();
|
@@ -40,22 +43,25 @@ import { getFocusableElement, trapFocusForward, trapReverseFocus } from './focus
|
|
40
43
|
|
41
44
|
function openMobileMenu(){
|
42
45
|
document.body.style.overflow = 'hidden';
|
43
|
-
var navigation = qs(navigationSelector);
|
44
46
|
|
45
|
-
overlay.innerHTML =
|
47
|
+
overlay.innerHTML = qs(navigationSelector).outerHTML;
|
46
48
|
overlay.className = 'overlay';
|
47
49
|
overlay.style.display = 'block';
|
48
50
|
|
51
|
+
qsa('[id]', overlay).forEach((elem) => {
|
52
|
+
elem.id = 'overlay__' + elem.id
|
53
|
+
});
|
54
|
+
|
49
55
|
// Modal Accessibility
|
50
|
-
|
56
|
+
const title = qs('.site-nav-title', overlay);
|
51
57
|
title.setAttribute('id', 'modal-title');
|
52
58
|
title.setAttribute('tabindex', '-1');
|
53
59
|
overlay.setAttribute('role', 'dialog');
|
54
60
|
overlay.setAttribute('aria-modal', 'true');
|
55
|
-
overlay.setAttribute('aria-
|
61
|
+
overlay.setAttribute('aria-labelledby', 'modal-title');
|
56
62
|
|
57
63
|
// Trap Focus to Visible Overlay
|
58
|
-
|
64
|
+
const focusElements = getFocusableElement(overlay);
|
59
65
|
|
60
66
|
focusElements.first.addEventListener('keydown', function(e) {
|
61
67
|
trapReverseFocus(e, icon);
|
@@ -74,7 +80,7 @@ import { getFocusableElement, trapFocusForward, trapReverseFocus } from './focus
|
|
74
80
|
|
75
81
|
document.body.appendChild(overlay);
|
76
82
|
icon.setAttribute(dataOpen, dataOpen);
|
77
|
-
|
83
|
+
focusElements.first.focus();
|
78
84
|
}
|
79
85
|
|
80
86
|
function closeMobileMenu() {
|
@@ -15,14 +15,14 @@ import { qs, qsa } from './query.js';
|
|
15
15
|
*/
|
16
16
|
function addStickyNavigation(headerSelector, navigationSelector, navigationListSelector, resizedEventName) {
|
17
17
|
function setNavigationMode() {
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
const header = qs(headerSelector);
|
19
|
+
const navigation = qs(navigationSelector);
|
20
|
+
const navigationList = qs(navigationListSelector);
|
21
21
|
|
22
|
-
|
23
|
-
|
22
|
+
const buffer = 50;
|
23
|
+
const className = 'sticky';
|
24
24
|
|
25
|
-
|
25
|
+
const dimensions = {
|
26
26
|
browserHeight: window.innerHeight,
|
27
27
|
browserWidth: window.innerWidth,
|
28
28
|
headerHeight: header.clientHeight,
|
data/assets/js/modules/query.js
CHANGED
@@ -8,12 +8,12 @@
|
|
8
8
|
* @returns {HTMLElement}
|
9
9
|
*/
|
10
10
|
function qs(query, container) {
|
11
|
-
|
11
|
+
const target = (container)
|
12
12
|
? container
|
13
13
|
: document;
|
14
14
|
|
15
15
|
/** @type {HTMLElement | null} */
|
16
|
-
|
16
|
+
const result = target.querySelector(query);
|
17
17
|
|
18
18
|
if (result) {
|
19
19
|
return result;
|
@@ -30,12 +30,12 @@
|
|
30
30
|
* @returns {NodeListOf<any>}
|
31
31
|
*/
|
32
32
|
function qsa(query, container) {
|
33
|
-
|
33
|
+
const target = (container)
|
34
34
|
? container
|
35
35
|
: document;
|
36
36
|
|
37
37
|
/** @type {NodeListOf<HTMLElement>} */
|
38
|
-
|
38
|
+
const result = target.querySelectorAll(query);
|
39
39
|
return result;
|
40
40
|
}
|
41
41
|
|
@@ -15,7 +15,7 @@ var height = window.innerHeight;
|
|
15
15
|
* @returns {string}
|
16
16
|
*/
|
17
17
|
function addResizedEvent() {
|
18
|
-
|
18
|
+
let debounce = null;
|
19
19
|
|
20
20
|
function resizeEnd(e) {
|
21
21
|
window.clearTimeout(debounce);
|
@@ -23,7 +23,7 @@ var height = window.innerHeight;
|
|
23
23
|
}
|
24
24
|
|
25
25
|
function raiseResizeEvent() {
|
26
|
-
|
26
|
+
const change = {
|
27
27
|
width: window.innerWidth - width,
|
28
28
|
height: window.innerHeight - height
|
29
29
|
};
|
data/assets/search/search.json
CHANGED
@@ -2,36 +2,58 @@
|
|
2
2
|
layout: null
|
3
3
|
permalink: /search.json
|
4
4
|
---
|
5
|
-
{%- assign
|
6
|
-
|
7
|
-
{%-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
{
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
"url" : "{{ site.baseurl }}{{ author.url }}",
|
23
|
-
"date" : "{{ author.date }}"
|
24
|
-
}{%- unless forloop.last %},{% endunless %}
|
25
|
-
{%- endfor %}
|
26
|
-
{%- if posts.size > 0 %},{% endif %}
|
27
|
-
{%- for post in posts %}{
|
28
|
-
"title" : "{{ post.title | escape }}",
|
29
|
-
"category" : "{{ post.category }}",
|
30
|
-
"tags" : "{{ page.tags | join: ' ' }} {{page.keywords}}",
|
31
|
-
"url" : "{{ site.baseurl }}{{ post.url }}",
|
32
|
-
"date" : "{{ post.date }}"
|
33
|
-
}
|
34
|
-
{%- unless forloop.last %},{% endunless %}
|
35
|
-
{%- endfor %}
|
36
|
-
]
|
5
|
+
{%- assign entries = '' | split:'@' %}
|
6
|
+
|
7
|
+
{%- for item in site.pages %}
|
8
|
+
{%- assign nav_search = item.nav-search | isnil: true %}
|
9
|
+
{% if nav_search and item.title %}
|
10
|
+
{%- capture data -%}
|
11
|
+
{
|
12
|
+
"title" : "{{ item.title | escape }}",
|
13
|
+
"category" : "{{ item.category }}",
|
14
|
+
"tags" : "{{ item.tags | join: ' ' }} {{item.keywords}}",
|
15
|
+
"url" : "{{ site.baseurl }}{{ item.url }}",
|
16
|
+
"date" : "{{ item.date }}"
|
17
|
+
}
|
18
|
+
{%- endcapture %}
|
19
|
+
{%- assign entries = entries | push: data %}
|
20
|
+
{% endif %}
|
21
|
+
{%- endfor %}
|
37
22
|
|
23
|
+
{%- for item in site.posts %}
|
24
|
+
{%- assign nav_search = item.nav-search | isnil: true %}
|
25
|
+
{% if nav_search and item.title %}
|
26
|
+
{%- capture data -%}
|
27
|
+
{
|
28
|
+
"title" : "{{ item.title | escape }}",
|
29
|
+
"category" : "{{ item.category }}",
|
30
|
+
"tags" : "{{ item.tags | join: ' ' }} {{item.keywords}}",
|
31
|
+
"url" : "{{ site.baseurl }}{{ item.url }}",
|
32
|
+
"date" : "{{ item.date }}"
|
33
|
+
}
|
34
|
+
{%- endcapture %}
|
35
|
+
{%- assign entries = entries | push: data %}
|
36
|
+
{% endif %}
|
37
|
+
{%- endfor %}
|
38
|
+
|
39
|
+
{%- for item in site.authors %}
|
40
|
+
{%- assign nav_search = item.nav-search | isnil: true %}
|
41
|
+
{%- if nav_search and item.title %}
|
42
|
+
{%- capture data -%}
|
43
|
+
{
|
44
|
+
"title" : "{{ item.name | escape }}",
|
45
|
+
"category" : "{{ item.category }}",
|
46
|
+
"tags" : "{{ item.tags | join: ' ' }} {{item.keywords}}",
|
47
|
+
"url" : "{{ site.baseurl }}{{ item.url }}",
|
48
|
+
"date" : "{{ item.date }}"
|
49
|
+
}
|
50
|
+
{%- endcapture %}
|
51
|
+
{%- assign entries = entries | push: data %}
|
52
|
+
{%- endif %}
|
53
|
+
{%- endfor %}
|
54
|
+
[
|
55
|
+
{%- for entry in entries -%}
|
56
|
+
{{ entry }}
|
57
|
+
{%- unless forloop.last %},{%- endunless -%}
|
58
|
+
{%- endfor -%}
|
59
|
+
]
|
data/assets/search/search.md
CHANGED
data/assets/sitemap/authors.xml
CHANGED
@@ -7,10 +7,20 @@ permalink: /sitemap/authors.xml
|
|
7
7
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
8
8
|
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
|
9
9
|
http://www.sitemaps.org/schemas/sitemap/0.9.xsd">
|
10
|
-
{%- assign
|
11
|
-
{%- for author in authors %}
|
10
|
+
{%- assign entries = '' | split:'@' %}
|
11
|
+
{%- for author in site.authors %}
|
12
|
+
{%- assign nav_sitemap = author.nav-sitemap | isnil: true %}
|
13
|
+
{%- if nav_sitemap and author.title %}
|
14
|
+
{%- capture data -%}
|
15
|
+
<url>
|
12
16
|
<loc>{{ site.url }}{{ author.url }}</loc>
|
13
17
|
<lastmod>{{ author.date }}</lastmod>
|
14
18
|
</url>
|
19
|
+
{%- endcapture %}
|
20
|
+
{%- assign entries = entries | push: data %}
|
21
|
+
{%- endif %}
|
15
22
|
{%- endfor %}
|
23
|
+
{%- for entry in entries -%}
|
24
|
+
{{ entry }}
|
25
|
+
{%- endfor -%}
|
16
26
|
</urlset>
|
data/assets/sitemap/pages.xml
CHANGED
@@ -7,10 +7,20 @@ permalink: /sitemap/pages.xml
|
|
7
7
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
8
8
|
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
|
9
9
|
http://www.sitemaps.org/schemas/sitemap/0.9.xsd">
|
10
|
-
{%- assign
|
11
|
-
{
|
10
|
+
{%- assign entries = '' | split:'@' %}
|
11
|
+
{%- for page in site.pages %}
|
12
|
+
{%- assign nav_sitemap = page.nav-sitemap | isnil: true %}
|
13
|
+
{%- if nav_sitemap and page.title %}
|
14
|
+
{%- capture data -%}
|
15
|
+
<url>
|
12
16
|
<loc>{{ site.url }}{{ page.url }}</loc>
|
13
17
|
<lastmod>{{ page.date }}</lastmod>
|
14
18
|
</url>
|
15
|
-
{
|
19
|
+
{%- endcapture %}
|
20
|
+
{%- assign entries = entries | push: data %}
|
21
|
+
{%- endif %}
|
22
|
+
{%- endfor %}
|
23
|
+
{%- for entry in entries -%}
|
24
|
+
{{ entry }}
|
25
|
+
{%- endfor -%}
|
16
26
|
</urlset>
|
data/assets/sitemap/posts.xml
CHANGED
@@ -7,10 +7,20 @@ permalink: /sitemap/posts.xml
|
|
7
7
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
8
8
|
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
|
9
9
|
http://www.sitemaps.org/schemas/sitemap/0.9.xsd">
|
10
|
-
{%- assign
|
11
|
-
{%- for post in posts %}
|
10
|
+
{%- assign entries = '' | split:'@' %}
|
11
|
+
{%- for post in site.posts %}
|
12
|
+
{%- assign nav_sitemap = post.nav-sitemap | isnil: true %}
|
13
|
+
{%- if nav_sitemap and post.title %}
|
14
|
+
{%- capture data -%}
|
15
|
+
<url>
|
12
16
|
<loc>{{ site.url }}{{ post.url }}</loc>
|
13
17
|
<lastmod>{{ post.date }}</lastmod>
|
14
18
|
</url>
|
19
|
+
{%- endcapture %}
|
20
|
+
{%- assign entries = entries | push: data %}
|
21
|
+
{%- endif %}
|
15
22
|
{%- endfor %}
|
23
|
+
{%- for entry in entries -%}
|
24
|
+
{{ entry }}
|
25
|
+
{%- endfor -%}
|
16
26
|
</urlset>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fenton-jekyll-boilerplate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Fenton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|