jekyll-ham 1.0.1 → 1.0.2

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: 21d9bce136793f181a7227a0bd17ef8d2191e3bf834aa80a48d1f509feb7a7cd
4
- data.tar.gz: cf3a60ab44ce32017302ffd28fee2b91dcbb213c31fd7528d68efbf12ce35d71
3
+ metadata.gz: a62916483d33bfe35d4ba07584c67024a2805656337f17a74400001fb0ff0736
4
+ data.tar.gz: f41683049c26e0fbd4ac22dc1a7081dec4085675fd46f7325e08427b92fa0093
5
5
  SHA512:
6
- metadata.gz: 9d06d7430743e1ee12b58bf02fbf9ed8b5676f1a05abc29571cd4be206e4be32726d7be2d5b6c1e9fcbb9cfa15d2709a7bc426325a02a5511c59046d99084a3c
7
- data.tar.gz: 5c584f8a2bc52bb734839d5e8137002980bb277fa5cd36edaafda4fb8b2b57f91dda198c79a768ff8f1927347e93755ffe5f514a8be0433273d3877c1efb98f6
6
+ metadata.gz: 2bff65101e73ca1379b195a0fba6c21acafefb1e37d2f582a18401131c2bad163243f38ead09f3c7070b4864446902b82abcdbbf70081f064991bdab0e591c77
7
+ data.tar.gz: e8573a85f3fb71985695f1caee6da374d33e0a969322f1b80e42ecdfbd7053863d4691b5aeaa4c834cfff0b7aaced6dc118edaeccd040f9ac5fab524b5eb8657
@@ -5,7 +5,7 @@
5
5
  <i class="bi bi-list-nested" aria-hidden="true"></i>
6
6
  </button>
7
7
  </div>
8
- <a class="navbar-brand" href="#">
8
+ <a class="navbar-brand" href="/">
9
9
  {% if site.ham.site_icon != null %}
10
10
  <img src="{{ site.ham.site_icon }}" alt="{{ site.title }}" width="24" height="24" class="d-inline-block align-text-top">
11
11
  {% endif %}{{ site.title }}
@@ -2,12 +2,10 @@
2
2
  <div class="offcanvas-header d-md-none border-bottom border-secondary border-opacity-25">
3
3
  <a href="/" class="sidebar-brand">
4
4
  {% if site.ham.site_icon != null %}
5
- <img src="{{ site.ham.site_icon }}" alt="{{ site.title }}">
5
+ <img src="{{ site.ham.site_icon }}" alt="{{ site.title }}" width="24" height="24">
6
6
  {% endif %}{{ site.title }}
7
7
  </a>
8
- <button type="button" class="btn-close d-md-none" data-bs-dismiss="offcanvas" aria-label="Close" data-bs-target="#_ham_sidebar">
9
- <i class="bi bi-x-lg" aria-description="Close sidebar"></i>
10
- </button>
8
+ <button type="button" class="btn-close d-md-none" aria-label="Close" data-bs-dismiss="offcanvas" data-bs-target="#_ham_sidebar"></button>
11
9
  </div>
12
10
  <div class="offcanvas-body">
13
11
  <div class="mb-3">
@@ -67,7 +67,7 @@
67
67
  document.getElementById('_ham_search_input').addEventListener('change', updateSearchResultsVisibility);
68
68
  document.getElementById('_ham_search_input').addEventListener('input', updateSearchResultsVisibility);
69
69
  </script>
70
- <!-- Halfmoon JS -->
70
+ <!-- Bootstrap JS -->
71
71
  <script src="{{ site.url }}/assets/halfmoon.min.js"></script>
72
72
  <!-- Bootstrap JS for color modes -->
73
73
  <script src="{{ site.url }}/assets/bootstrap-color-modes.js"></script>
data/_layouts/page.html CHANGED
@@ -2,10 +2,10 @@
2
2
  layout: default
3
3
  ---
4
4
  <article class="row px-1 py-3">
5
- <div class="col-xl-8 collapse-group article-wrapper" id="_ham_content">
5
+ <div class="col-xl-8 collapse-group article-wrapper mb-3" id="_ham_content">
6
6
  {{ content }}
7
7
  </div>
8
- <div class="col-xl-4">
8
+ <div class="col-xl-4 mb-3">
9
9
  {% if page.related_topics != null %}
10
10
  <div class="mb-3">
11
11
  <h5 id="related-topics" class="sidebar-title">Related Topics</h5>
@@ -61,12 +61,14 @@ function parseRawEntry(originalContent, onThisPageEntry, siteTitle, siteTagline)
61
61
  var newA = document.createElement('a');
62
62
  newA.href = '#' + node.id;
63
63
  newA.className = 'nav-link text-truncate';
64
- newA.setAttribute('onclick', 'expandAccordion(\'' + currentAccordionId + '\')');
64
+ newA.setAttribute('data-bs-dismiss', 'offcanvas');
65
+ newA.setAttribute('data-bs-target', '#_ham_sidebar');
66
+ newA.setAttribute('onclick', 'expandAccordion(\'' + currentAccordionId + '\', \'' + node.id + '\')');
65
67
  for (j = 2; j < currentHeadingLevel; j++){
66
68
  var newSpan = document.createElement('span');
67
69
  if (j == currentHeadingLevel - 1) {
68
70
  newSpan.className = 'me-1 d-inline-block text-body-tertiary';
69
- newSpan.textContent = '';
71
+ newSpan.innerHTML = '<i class="bi bi-arrow-return-right"></i>';
70
72
  } else {
71
73
  newSpan.className = 'ms-3 d-inline-block';
72
74
  }
@@ -193,9 +195,14 @@ function autoexpandAccordion(){
193
195
  }
194
196
  }
195
197
 
196
- async function expandAccordion(id){
197
- var el = new bootstrap.Collapse(document.getElementById(id + "-content"), {toggle: false});
198
+ async function expandAccordion(collapsibleId, contentId){
199
+ var el = new bootstrap.Collapse(document.getElementById(collapsibleId + "-content"), {toggle: false});
198
200
  await el.show();
201
+ if (contentId) {
202
+ location.hash = "";
203
+ location.hash = "#" + contentId;
204
+ scrollBy(0, -66);
205
+ }
199
206
  }
200
207
 
201
208
  window.addEventListener("load", autoexpandAccordion);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-ham
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reinhart Previano Koentjoro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-14 00:00:00.000000000 Z
11
+ date: 2023-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll