fenton-jekyll-boilerplate 0.0.11 → 0.0.13

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7eb6a36141efac9ebe7f0670c51c3a6f8f6b5418b987f8c8690923ec310c0b14
4
- data.tar.gz: e55728ed07589138ffc7099a6dadf4c9926f560590954adb4d283da6c93ff423
3
+ metadata.gz: 24baa59c2c4906b3070f0707dfd96b27e6dec1b249b4450b285b8ddd04bafde2
4
+ data.tar.gz: '059859afc1cd21a7c046d135001ffc391e2d80baf6be2f095eab46a7abf09189'
5
5
  SHA512:
6
- metadata.gz: 4bc3dfc6ba2e9a290d130e0057bf1b5731ae4748442ab031419327842a3c9836dfe2440246912e6004cf2ecab764634b602c7a65e4d7eb65ce50685bdbc38323
7
- data.tar.gz: c10a24863d143d5cd4737efa0b0d2e21ce7542e0441275157a9e31781a034e2c232dd942d329004ba84fbb138384b7e7bb224248dd9be1eebf90220a0ae87ae9
6
+ metadata.gz: b55521d33500ad548a419fb85bec040fbf100a57b4350a25970a3cba0e61b2008fc93e65a733e9e9b69ee4bd9f502a275c7d7655914149180133650be3156b9c
7
+ data.tar.gz: 151e8c5a96bfa7ab6be798dbcc3a835b1b697bdce4365b218dd28ea8aab4284791674721f3b7c02103cf0b49540d4e2e6ca23e78be75721c83e8cc3da2b502f0
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
@@ -1,19 +1,22 @@
1
- <nav class="site-breadcrumbs">
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
- {%- if forloop.last %}
5
- <li property="itemListElement" typeof="ListItem">
6
- <span property="name">{{ crumb.title }}</span>
7
- <meta property="position" content="{{ crumb.position }}" />
8
- </li>
9
- {%- continue %}
10
- {%- endif %}
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 }}" defer="defer" />
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>
@@ -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 page in main_pages %}
8
- {%- assign current = page.nav-title | default: page.title %}
8
+ {% for item in main_pages %}
9
+ {%- assign current = item.nav-title | default: item.title %}
9
10
  {%- if (current != previous) %}
10
- {%- assign previous = page.nav-title | default: page.title %}
11
- {%- assign sub_pages = site.pages | where: 'nav-level', page.title | sort: 'nav-order' %}
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 p.nav-level != 0 and 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
- {%- if sub_pages.size > 0 %}
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>{{ page.nav-section | default: page.nav-title | default: page.title }}</span></summary>
16
- {%- else %}
17
- <a href="{{ page.url | regex_replace: regex,'/' | prepend: site.baseurl }}">{{ page.nav-title | default: page.title }}</a>
18
- {%- endif -%}
19
- {% if sub_pages.size > 0 %}
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="{{ page.url | regex_replace: regex,'/' | prepend: site.baseurl }}">{{ page.nav-title | default: page.title }}</a>
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
- {%- for child in sub_pages %}
39
+ {%- for child in sub_pages | sort: 'nav-order' %}
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
- {%- endif %}
46
+ {%- endif %}
32
47
  </li>
33
48
  {%- endif %}
34
49
  {%- endfor %}
data/_layouts/author.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.name }}</h1>
7
8
  </header>
@@ -36,4 +37,5 @@ layout: default
36
37
  {%- endfor %}
37
38
  </ul>
38
39
  </div>
40
+ </article>
39
41
  </main>
data/_layouts/page.html CHANGED
@@ -2,10 +2,12 @@
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>
8
9
  <div>
9
10
  {{ content }}
10
11
  </div>
12
+ </article>
11
13
  </main>
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 }}/author/{{ author.username }}/">{{ author.name }}</a>
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: 1.2em 0;
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 dotted var(--fore);
136
+ border: 0.5px dashed var(--fore);
137
137
  opacity: 0.5;
138
138
  width: 80%;
139
- margin: 0 auto;
139
+ margin: var(--paragraph-margin) auto;
140
140
  }
141
141
 
142
142
  img {
143
143
  max-width: 100%;
144
144
  }
145
145
 
146
- p, main ul, main ol {
147
- margin: 1.2em 0;
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 .current-item {
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-left: 1.2em;
382
+ margin: var(--paragraph-margin) 0 var(--paragraph-margin) 1.2rem;
377
383
  }
378
384
 
379
- main ul li, main ol li {
380
- line-height: 2em;
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
@@ -38,7 +38,8 @@
38
38
 
39
39
  --block-gap: 2rem;
40
40
 
41
- --marker-size: 1.2em;
41
+ --marker-size: 1.2rem;
42
+ --paragraph-margin: 1.2rem;
42
43
 
43
44
  --box-shadow: 0 12px 24px -12px rgb(0 0 0 / 80%);
44
45
 
data/assets/js/main.js CHANGED
@@ -1,18 +1,20 @@
1
1
  // @ts-check
2
2
 
3
- import { setNavigationTree, setNavigationItem } from './modules/nav-expand.js';
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
- setNavigationItem('.site-nav a', 'current-item')
12
- setClickableBlocks('data-destination');
12
+ setClickableBlocks();
13
13
 
14
- var resizedEventName = addResizedEvent();
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 (var entry of entries) {
21
- var value = entry.isIntersecting ? 1 : 0;
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
- var options = {
26
+ const options = {
27
27
  root: null,
28
28
  rootMargin: '0px',
29
29
  threshold: 0
30
30
  };
31
31
 
32
- var observer = new IntersectionObserver(handleIntersection, options)
32
+ const observer = new IntersectionObserver(handleIntersection, options)
33
33
 
34
- var items = qsa(listItemQuery);
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(dataAttributeName) {
18
- var listItems = qsa('[' + dataAttributeName + ']');
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', function (e) {
24
- var location = this.getAttribute(dataAttributeName);
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
- if (location) {
27
- e.preventDefault();
28
- document.location = location;
29
- return false;
30
- }
31
- });
34
+ if (location) {
35
+ e.preventDefault();
36
+ document.location = location;
37
+ return false;
32
38
  }
33
39
  }
34
40
 
@@ -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
- var focusElements = Array.from(
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
- var summaries = qsa(className);
16
- var site = document.location.origin;
17
- var location = document.location.pathname;
15
+ const site = document.location.origin;
16
+ const location = document.location.pathname;
18
17
 
19
- for (var i = 0; i < summaries.length; i++) {
20
- var summary = summaries[i];
21
- var anchorElement = /** @type {HTMLAnchorElement} */(qs('a', summary));
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
- var icon = qs(iconSelector);
21
- var originalIcon = icon.innerHTML;
22
- var overlay = document.createElement('div');
23
- var dataOpen = 'data-open';
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 = navigation.outerHTML;
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
- var title = qs('.site-nav-title', overlay);
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-labelled-by', 'modal-title');
61
+ overlay.setAttribute('aria-labelledby', 'modal-title');
56
62
 
57
63
  // Trap Focus to Visible Overlay
58
- var focusElements = getFocusableElement(overlay);
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
- title.focus();
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
- var header = qs(headerSelector);
19
- var navigation = qs(navigationSelector);
20
- var navigationList = qs(navigationListSelector);
18
+ const header = qs(headerSelector);
19
+ const navigation = qs(navigationSelector);
20
+ const navigationList = qs(navigationListSelector);
21
21
 
22
- var buffer = 50;
23
- var className = 'sticky';
22
+ const buffer = 50;
23
+ const className = 'sticky';
24
24
 
25
- var dimensions = {
25
+ const dimensions = {
26
26
  browserHeight: window.innerHeight,
27
27
  browserWidth: window.innerWidth,
28
28
  headerHeight: header.clientHeight,
@@ -8,12 +8,12 @@
8
8
  * @returns {HTMLElement}
9
9
  */
10
10
  function qs(query, container) {
11
- var target = (container)
11
+ const target = (container)
12
12
  ? container
13
13
  : document;
14
14
 
15
15
  /** @type {HTMLElement | null} */
16
- var result = target.querySelector(query);
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
- var target = (container)
33
+ const target = (container)
34
34
  ? container
35
35
  : document;
36
36
 
37
37
  /** @type {NodeListOf<HTMLElement>} */
38
- var result = target.querySelectorAll(query);
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
- var debounce = null;
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
- var change = {
26
+ const change = {
27
27
  width: window.innerWidth - width,
28
28
  height: window.innerHeight - height
29
29
  };
@@ -2,36 +2,58 @@
2
2
  layout: null
3
3
  permalink: /search.json
4
4
  ---
5
- {%- assign pages = site.pages | where: 'nav-search', 'true' %}
6
- {%- assign posts = site.posts | where: 'nav-search', 'true' %}
7
- {%- assign authors = site.authors | where: 'nav-search', 'true' %}
8
- [
9
- {% for page in pages %}{
10
- "title" : "{{ page.title | escape }}",
11
- "category" : "{{ page.category }}",
12
- "tags" : "{{ page.tags | join: ' ' }} {{page.keywords}}",
13
- "url" : "{{ site.baseurl }}{{ page.url }}",
14
- "date" : "{{ page.date }}"
15
- }{%- unless forloop.last %},{% endunless %}
16
- {%- endfor %}
17
- {%- if authors.size > 0 %},{% endif %}
18
- {%- for author in authors %}{
19
- "title" : "{{ author.name | escape }}",
20
- "category" : "{{ author.category }}",
21
- "tags" : "{{ page.tags | join: ' ' }} {{page.keywords}}",
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
+ ]
@@ -6,9 +6,7 @@ date: 2022-09-06
6
6
  authors: steve-fenton
7
7
  description: Search the website.
8
8
  nav-title: Search
9
- nav-level: 0
10
9
  nav-order: 0
11
- published: true
12
10
  nav-sitemap: false
13
11
  nav-search: false
14
12
  ---
@@ -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 authors = site.authors | where: 'nav-sitemap','true' %}
11
- {%- for author in authors %} <url>
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>
@@ -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 pages = site.pages | where: 'nav-sitemap','true' %}
11
- {% for page in pages %} <url>
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
- {% endfor %}
19
+ {%- endcapture %}
20
+ {%- assign entries = entries | push: data %}
21
+ {%- endif %}
22
+ {%- endfor %}
23
+ {%- for entry in entries -%}
24
+ {{ entry }}
25
+ {%- endfor -%}
16
26
  </urlset>
@@ -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 posts = site.posts | where: 'nav-sitemap','true' %}
11
- {%- for post in posts %} <url>
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.11
4
+ version: 0.0.13
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-14 00:00:00.000000000 Z
11
+ date: 2022-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll