jekyll-ham 0.3.3 → 1.0.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: 769f98fe84eb7167ea5cc8d3e7e00c1b6ff7578585b5445526f98fe831a09a4f
4
- data.tar.gz: 790e013b11d4370c0d494269e6aa0e1a6354b6bbc05e796768a91cad624121a5
3
+ metadata.gz: 21d9bce136793f181a7227a0bd17ef8d2191e3bf834aa80a48d1f509feb7a7cd
4
+ data.tar.gz: cf3a60ab44ce32017302ffd28fee2b91dcbb213c31fd7528d68efbf12ce35d71
5
5
  SHA512:
6
- metadata.gz: bc01baf56a40058362babeeb31f5ce05a46d5c46cbd9484c7f67dbdf1dcff3a27dda50cc2d1343bfb85994d630496973f8b778a7e3b3bbfbd06bf9c5c9bfebb9
7
- data.tar.gz: 5e1e5e700e1b42c396c0584ee93d63be8e13297bc56f8d8c0b5f9130a21b87e9cfbb33e475ade6559806bb9858050833fb7b278c46d8e31e4a34d7ee91640fe9
6
+ metadata.gz: 9d06d7430743e1ee12b58bf02fbf9ed8b5676f1a05abc29571cd4be206e4be32726d7be2d5b6c1e9fcbb9cfa15d2709a7bc426325a02a5511c59046d99084a3c
7
+ data.tar.gz: 5c584f8a2bc52bb734839d5e8137002980bb277fa5cd36edaafda4fb8b2b57f91dda198c79a768ff8f1927347e93755ffe5f514a8be0433273d3877c1efb98f6
data/README.md CHANGED
@@ -30,6 +30,8 @@ external_links:
30
30
 
31
31
  # HAM 🥩
32
32
 
33
+ > [!IMPORTANT]
34
+ >
33
35
  > **BREAKING CHANGE:** HAM is currently being upgraded to Halfmoon 2.0, which introduce visual breaking changes. See <https://github.com/reinhart1010/HAM/issues/6>.
34
36
 
35
37
  HAM is a Jekyll-based boilerplate template for generating better, static wiki-style websites. HAM can be instantly used to build static wiki pages. But the best of all, the default theme of HAM can be easily customized to create more personalized wiki pages, unlike those from MediaWiki, for example.
@@ -64,6 +66,9 @@ We believe that everyone should be able to theme HAM websites according to their
64
66
 
65
67
  ### What HAM would be
66
68
  - [ ] Supporting Forem (DEV.to) liquid tags (YouTube embeds, Twitter posts, etc.)
69
+ - Actually, we are starting to support some of them with privacy-preserving options, like this YouTube embed below (we promised this would not be another rickroll).
70
+
71
+ {% youtube 0FKaIiRhUME %}
67
72
 
68
73
  ## Usage
69
74
  ### For [GitHub Pages](https://pages.github.com)
@@ -128,6 +133,31 @@ ham:
128
133
 
129
134
  Note: You can also override the whole favicon settings (either to entirely remove, or adding mobile or browser-specific icon formats) by overriding `_includes/favicon.html`.
130
135
 
136
+ ### Navigation
137
+ HAM currently provides two navigation areas: the **navigation bar** and the **index** (as on the sidebar).
138
+
139
+ #### Navigation Bar
140
+ You can freely add items in the navigation bar by modifying `_includes/navbar.html`, including placing additional nested menus, dialogs/modals, and other HTML tags.
141
+
142
+ #### Sidebar
143
+ Just like the "On This Page" section, you can add custom sections into the sidebar. Note that the configuration is stored **outside** the `ham` section of `_config.yml` (see below example).
144
+
145
+ ```yaml
146
+ ham:
147
+ # Other HAM configuration here
148
+ data:
149
+ index:
150
+ - name: "Customise Me"
151
+ id: "customize-me"
152
+ children:
153
+ - name: "Sample Menu 1"
154
+ url: "#"
155
+ - name: "Sample Menu 2"
156
+ url: "#"
157
+ - name: "Sample Menu 3"
158
+ url: "#"
159
+ ```
160
+
131
161
  ### Comments
132
162
  HAM provides built-in support for Facebook, Giscus, Telegram, and Utteranc.es widgets plugins. However, you can also add your own widgets or links by following these instructions.
133
163
 
data/_config.yml CHANGED
@@ -6,6 +6,8 @@ defaults:
6
6
  ham:
7
7
  site_icon: https://raw.githubusercontent.com/googlefonts/noto-emoji/main/svg/emoji_u1f969.svg
8
8
  highlighter: rouge
9
+ include:
10
+ - _embed
9
11
  kramdown:
10
12
  input: GFM
11
13
  syntax_highlighter: rouge
@@ -1,49 +1,4 @@
1
- {% assign contributing = page.contributing | default: site.ham.contributing %}
2
- {% if contributing != null %}
3
- {% if contributing.discuss.type != 'url' %}
4
- <h5 id="discuss" class="sidebar-title">Discuss this page</h5>
5
- <div class="sidebar-title">
6
- {% case contributing.discuss.type %}
7
- {% when 'custom' %}
8
- {% include custom-comments.html %}
9
- {% when 'commentbox.io %}
10
- <div class="commentbox"></div>
11
- <script src="https://unpkg.com/commentbox.io/dist/commentBox.min.js"></script>
12
- <script>commentBox("{{ page.project_id }}")</script>
13
- {% when 'disqus' %}
14
- <div id="disqus_thread"></div>
15
- <script>
16
- var disqus_config = function () {
17
- this.page.url = "{{ page.url }}";
18
- this.page.identifier = "{{ page.url }}";
19
- };
20
- (function() {
21
- var d = document, s = d.createElement('script');
22
- s.src = 'https://{{ contributing.discuss.forum_shortname }}.disqus.com/embed.js';
23
- s.setAttribute('data-timestamp', +new Date());
24
- (d.head || d.body).appendChild(s);
25
- })();
26
- </script>
27
- {% when 'facebook' %}
28
- {% if contributing.discuss.facebook_app_id != null %}
29
- <div id="fb-root"></div>
30
- <script async defer crossorigin="anonymous" src="https://connect.facebook.net/{{ contributing.discuss.lang }}/sdk.js#xfbml=1&version=v17.0&appId={{ contributing.discuss.facebook_app_id }}&autoLogAppEvents=1" nonce="mqsBinib"></script>
31
- <div class="fb-comments" data-href="https://developers.facebook.com/docs/plugins/comments#configurator" data-width="" data-numposts="5"></div>
32
- {% endif %}
33
- {% when 'giscus' %}
34
- <script src="https://giscus.app/client.js" data-repo="{{ contributing.discuss.repo }}" data-repo-id="{{ contributing.discuss.repo_id }}" data-category="{{ contributing.discuss.category }}" data-category-id="{{ contributing.discuss.category_id }}" data-mapping="{{ contributing.discuss.mapping }}" data-reactions-enabled="{{ contributing.discuss.reactions_enabled | default: 1 }}" data-emit-metadata="{{ contributing.discuss.emit_metadata | default: 0 }}" data-theme="{{ contributing.discuss.theme | default: 'preferred_color_scheme' }}" data-lang="{{ contributing.discuss.lang | default: 'en' }}" crossorigin="anonymous" async></script>
35
- {% when 'telegram' %}
36
- <script src="https://telegram.org/js/telegram-widget.js?15" {% if contributing.discuss.telegram_discussion != null %} data-telegram-discussion="{{ contributing.discuss.telegram_discussion }}" {% endif %} data-comments-limit="{{ contributing.discuss.comments_limit | default: '5' }}" {% if contributing.discuss.height != null %} data-height="{{ contributing.discuss.height }}" {% endif %} data-color="{{ contributing.discuss.color | default: '319BE6' }}" data-dark-color="{{ contributing.discuss.color | default: '4BA3E2' }}" data-colorful="{{ contributing.discuss.colorful | default: 0 }}" data-dark="{{ contributing.discuss.dark | default: 0 }}" crossorigin="anonymous" async></script>
37
- {% when 'utterances' %}
38
- <script src="https://utteranc.es/client.js" repo="{{ contributing.discuss.repo }}" issue-term="{{ contributing.discuss.issue_term }}"
39
- {% if contributing.discuss.label != null %}
40
- label="{{ contributing.discuss.label }}"
41
- {% endif %}
42
- theme="{{ contributing.discuss.theme | default: 'preferred-color-scheme' }}" crossorigin="anonymous" async></script>
43
- {% endcase %}
44
- <noscript>
45
- Please enable JavaScript to view comments and discussions
46
- </noscript>
47
- </div>
48
- {% endif %}
49
- {% endif %}
1
+ <div class="alert alert-danger" role="alert">
2
+ <h4 class="alert-heading">Error: Custom comment widget is not set up.</h4>
3
+ Make sure that the custom comment widget code is placed under <code>/_includes/custom-comments.html</code>, then recompile.
4
+ </div>
@@ -0,0 +1,49 @@
1
+ {% assign contributing = page.contributing | default: site.ham.contributing %}
2
+ {% if contributing != null %}
3
+ {% if contributing.discuss.type != 'url' %}
4
+ <h5 id="discuss" class="sidebar-title">Discuss this page</h5>
5
+ <div class="sidebar-title">
6
+ {% case contributing.discuss.type %}
7
+ {% when 'custom' %}
8
+ {% include comments.html %}
9
+ {% when 'commentbox.io %}
10
+ <div class="commentbox"></div>
11
+ <script src="https://unpkg.com/commentbox.io/dist/commentBox.min.js"></script>
12
+ <script>commentBox("{{ page.project_id }}")</script>
13
+ {% when 'disqus' %}
14
+ <div id="disqus_thread"></div>
15
+ <script>
16
+ var disqus_config = function () {
17
+ this.page.url = "{{ page.url }}";
18
+ this.page.identifier = "{{ page.url }}";
19
+ };
20
+ (function() {
21
+ var d = document, s = d.createElement('script');
22
+ s.src = 'https://{{ contributing.discuss.forum_shortname }}.disqus.com/embed.js';
23
+ s.setAttribute('data-timestamp', +new Date());
24
+ (d.head || d.body).appendChild(s);
25
+ })();
26
+ </script>
27
+ {% when 'facebook' %}
28
+ {% if contributing.discuss.facebook_app_id != null %}
29
+ <div id="fb-root"></div>
30
+ <script async defer crossorigin="anonymous" src="https://connect.facebook.net/{{ contributing.discuss.lang }}/sdk.js#xfbml=1&version=v17.0&appId={{ contributing.discuss.facebook_app_id }}&autoLogAppEvents=1" nonce="mqsBinib"></script>
31
+ <div class="fb-comments" data-href="https://developers.facebook.com/docs/plugins/comments#configurator" data-width="" data-numposts="5"></div>
32
+ {% endif %}
33
+ {% when 'giscus' %}
34
+ <script src="https://giscus.app/client.js" data-repo="{{ contributing.discuss.repo }}" data-repo-id="{{ contributing.discuss.repo_id }}" data-category="{{ contributing.discuss.category }}" data-category-id="{{ contributing.discuss.category_id }}" data-mapping="{{ contributing.discuss.mapping }}" data-reactions-enabled="{{ contributing.discuss.reactions_enabled | default: 1 }}" data-emit-metadata="{{ contributing.discuss.emit_metadata | default: 0 }}" data-theme="{{ contributing.discuss.theme | default: 'preferred_color_scheme' }}" data-lang="{{ contributing.discuss.lang | default: 'en' }}" crossorigin="anonymous" async></script>
35
+ {% when 'telegram' %}
36
+ <script src="https://telegram.org/js/telegram-widget.js?15" {% if contributing.discuss.telegram_discussion != null %} data-telegram-discussion="{{ contributing.discuss.telegram_discussion }}" {% endif %} data-comments-limit="{{ contributing.discuss.comments_limit | default: '5' }}" {% if contributing.discuss.height != null %} data-height="{{ contributing.discuss.height }}" {% endif %} data-color="{{ contributing.discuss.color | default: '319BE6' }}" data-dark-color="{{ contributing.discuss.color | default: '4BA3E2' }}" data-colorful="{{ contributing.discuss.colorful | default: 0 }}" data-dark="{{ contributing.discuss.dark | default: 0 }}" crossorigin="anonymous" async></script>
37
+ {% when 'utterances' %}
38
+ <script src="https://utteranc.es/client.js" repo="{{ contributing.discuss.repo }}" issue-term="{{ contributing.discuss.issue_term }}"
39
+ {% if contributing.discuss.label != null %}
40
+ label="{{ contributing.discuss.label }}"
41
+ {% endif %}
42
+ theme="{{ contributing.discuss.theme | default: 'preferred-color-scheme' }}" crossorigin="anonymous" async></script>
43
+ {% endcase %}
44
+ <noscript>
45
+ Please enable JavaScript to view comments and discussions
46
+ </noscript>
47
+ </div>
48
+ {% endif %}
49
+ {% endif %}
@@ -1,4 +1,4 @@
1
- <a href="{{ link.url }}" class="sidebar-link sidebar-link-with-icon" target="{{ link.target }}">
1
+ <a href="{{ link.url }}" class="list-group-item list-group-item-action" target="{{ link.target }}">
2
2
  <span class="sidebar-icon">
3
3
  <i class="{{ link.icon | default: 'bi bi-file-text' }}" aria-hidden="true"></i>
4
4
  </span>
@@ -0,0 +1,25 @@
1
+ <nav class="navbar navbar-expand-lg sticky-top" style="background-color: var(--bs-content-bg); border-bottom: var(--bs-border-width) solid var(--bs-content-border-color);">
2
+ <div class="container-fluid">
3
+ <div class="d-md-none" role="group">
4
+ <button type="button" data-bs-toggle="offcanvas" data-bs-target="#_ham_sidebar" aria-controls="_ham_sidebar" aria-description="Open sidebar" class="btn btn-secondary btn-square">
5
+ <i class="bi bi-list-nested" aria-hidden="true"></i>
6
+ </button>
7
+ </div>
8
+ <a class="navbar-brand" href="#">
9
+ {% if site.ham.site_icon != null %}
10
+ <img src="{{ site.ham.site_icon }}" alt="{{ site.title }}" width="24" height="24" class="d-inline-block align-text-top">
11
+ {% endif %}{{ site.title }}
12
+ </a>
13
+ <div class="d-md-none" role="group">
14
+ <button type="button" data-bs-toggle="collapse" data-bs-target="#_ham_settings" aria-controls="_ham_settings" aria-description="Open navigation menu" class="btn btn-secondary btn-square">
15
+ <i class="bi bi-three-dots" aria-hidden="true"></i>
16
+ </button>
17
+ </div>
18
+ <div class="collapse navbar-collapse" id="_ham_settings">
19
+ {% if site.tagline != null %}
20
+ <span>{{ site.tagline }}</span>
21
+ {% endif %}
22
+ {% include navbar.html %}
23
+ </div>
24
+ </div>
25
+ </nav>
@@ -5,7 +5,7 @@
5
5
  <span aria-hidden="true">&times;</span>
6
6
  </a>
7
7
  <input id="search-input" type="text" class="form-control" placeholder="Keyword">
8
- <ul id="results-container" class="my-10"></ul>
8
+ <ul id="_ham_search_results_container" class="my-10"></ul>
9
9
  <span>Search articles on this site...</span>
10
10
  </div>
11
11
  </div>
@@ -0,0 +1,39 @@
1
+ <nav class="sidebar offcanvas-start offcanvas-md" tabindex="-1" id="_ham_sidebar">
2
+ <div class="offcanvas-header d-md-none border-bottom border-secondary border-opacity-25">
3
+ <a href="/" class="sidebar-brand">
4
+ {% if site.ham.site_icon != null %}
5
+ <img src="{{ site.ham.site_icon }}" alt="{{ site.title }}">
6
+ {% endif %}{{ site.title }}
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>
11
+ </div>
12
+ <div class="offcanvas-body">
13
+ <div class="mb-3">
14
+ <h5 id="on-this-page" class="sidebar-title">Search</h5>
15
+ <input type="text" class="form-control" id="_ham_search_input" placeholder="Search...">
16
+ <div id="_ham_search_results_container" class="list-group"></div>
17
+ </div>
18
+ {% if site.data.index %}
19
+ <div class="mb-3">
20
+ {% for section in site.data.index %}
21
+ <h5 class="sidebar-title" id="{{ section.id }}">
22
+ {{ section.name }}
23
+ </h5>
24
+ <ul class="list-group">
25
+ {% for child in section.children %}
26
+ <a href="{{ child.url }}" class="list-group-item">
27
+ <span class="name">{{ child.name }}</span>
28
+ </a>
29
+ {% endfor %}
30
+ </ul>
31
+ {% endfor %}
32
+ </div>
33
+ {% endif %}
34
+ <div class="mb-3">
35
+ <h5 id="on-this-page" class="sidebar-title">On This Page</h5>
36
+ <div id="_ham_on_this_page_ul"></div>
37
+ </div>
38
+ </div>
39
+ </nav>
@@ -1,27 +1,3 @@
1
- <nav class="navbar">
2
- <div class="navbar-content">
3
- <button class="btn btn-action" type="button" onclick="halfmoon.toggleSidebar()">
4
- <i class="bi bi-list ham-menu-button-icon-open" aria-hidden="true"></i>
5
- <i class="bi bi-x-lg ham-menu-button-icon-close" aria-hidden="true"></i>
6
- <span class="sr-only">Toggle sidebar</span>
7
- </button>
8
- </div>
9
- <a href="/" class="navbar-brand">
10
- {% if site.ham.site_icon != null %}
11
- <img src="{{ site.ham.site_icon }}" alt="{{ site.title }}">
12
- {% endif %}{{ site.title }}
13
- </a>
14
- {% if site.tagline != null %}
15
- <span class="navbar-text d-none d-sm-block">{{ site.tagline }}</span> <!-- text-monospace = font-family shifted to monospace -->
16
- {% endif %}
17
- <div class="ml-auto">
18
- <button onClick="halfmoon.toggleDarkMode()" class="btn btn-action">
19
- <i class="bi bi-moon-stars" aria-hidden="true"></i>
20
- <span class="sr-only">Toggle Dark Mode</span>
21
- </button>
22
- <a href="#search" class="btn btn-action btn-primary" onClick="document.getElementById('search-input').focus()">
23
- <i class="bi bi-search" aria-hidden="true"></i>
24
- <span class="sr-only">Search</span>
25
- </a>
26
- </div>
27
- </nav>
1
+ <ul class="navbar-nav me-auto my-2 my-lg-0 navbar-nav-scroll" style="--bs-scroll-height: 100px;">
2
+ <!-- See also https://www.gethalfmoon.com/docs/navbar/ to customize the navbar content -->
3
+ </ul>
@@ -33,30 +33,43 @@
33
33
  <link href="{{ link }}" rel="me" />
34
34
  {% endfor %}
35
35
  </head>
36
- <body class="with-custom-webkit-scrollbars with-custom-css-scrollbars" data-dm-shortcut-enabled="true" data-sidebar-shortcut-enabled="true" data-set-preferred-mode-onload="true">
37
- {% include search-modal.html %}
36
+ <body class="ps-md-sbwidth" data-dm-shortcut-enabled="true" data-sidebar-shortcut-enabled="true" data-set-preferred-mode-onload="true">
38
37
  <div class="page-wrapper with-navbar with-sidebar">
39
38
  <div class="sticky-alerts"></div>
40
- {% include navbar.html %}
41
- {% include sidebar.html %}
39
+ {% include ham/navbar.html %}
40
+ {% include ham/sidebar.html %}
42
41
  <div class="content-wrapper">
43
42
  <div class="container-fluid">
44
43
  {{ content }}
45
44
  </div>
46
45
  </div>
47
- {% include footer.html %}
46
+ {% include ham/footer.html %}
48
47
  </div>
49
48
 
50
49
  <!-- Simple Jekyll Search JS -->
51
50
  <script src="{{ site.url }}/assets/simple-jekyll-search.min.js"></script>
52
51
  <script>
53
52
  var sjs = SimpleJekyllSearch({
54
- searchInput: document.getElementById('search-input'),
55
- resultsContainer: document.getElementById('results-container'),
56
- json: '{{ site.url }}/assets/search.json'
57
- })
53
+ searchInput: document.getElementById('_ham_search_input'),
54
+ resultsContainer: document.getElementById('_ham_search_results_container'),
55
+ searchResultTemplate: '<a href="{{ site.url }}{url}" class="list-group-item"><span class="fw-semibold">{title}</span><br><small>{url}</small></a>',
56
+ limit: 20,
57
+ noResultsText: 'No results...',
58
+ json: '{{ site.url }}/assets/search.json',
59
+ });
60
+ function updateSearchResultsVisibility (event) {
61
+ if (event.srcElement.value.length == 0) {
62
+ document.getElementById('_ham_search_results_container').classList.remove('mt-2');
63
+ } else {
64
+ document.getElementById('_ham_search_results_container').classList.add('mt-2');
65
+ }
66
+ }
67
+ document.getElementById('_ham_search_input').addEventListener('change', updateSearchResultsVisibility);
68
+ document.getElementById('_ham_search_input').addEventListener('input', updateSearchResultsVisibility);
58
69
  </script>
59
70
  <!-- Halfmoon JS -->
60
71
  <script src="{{ site.url }}/assets/halfmoon.min.js"></script>
72
+ <!-- Bootstrap JS for color modes -->
73
+ <script src="{{ site.url }}/assets/bootstrap-color-modes.js"></script>
61
74
  </body>
62
75
  </html>
data/_layouts/page.html CHANGED
@@ -1,33 +1,84 @@
1
1
  ---
2
2
  layout: default
3
3
  ---
4
- <article class="row">
5
- <div class="col-xl-8 p-20 collapse-group article-wrapper" id="_ham_content">
4
+ <article class="row px-1 py-3">
5
+ <div class="col-xl-8 collapse-group article-wrapper" id="_ham_content">
6
6
  {{ content }}
7
7
  </div>
8
- <div class="col-xl-4 pt-xl-20 pb-20">
8
+ <div class="col-xl-4">
9
9
  {% if page.related_topics != null %}
10
- <h5 id="related-topics" class="sidebar-title">Related Topics</h5>
11
- <div class="sidebar-divider"></div>
12
- {% for link in page.related_topics %}
13
- {% include external-link.html %}
14
- {% endfor %}
10
+ <div class="mb-3">
11
+ <h5 id="related-topics" class="sidebar-title">Related Topics</h5>
12
+ <div class="list-group">
13
+ {% for link in page.related_topics %}
14
+ {% include ham/external-link.html %}
15
+ {% endfor %}
16
+ </div>
17
+ </div>
15
18
  {% endif %}
16
19
  {% if page.further_reading != null %}
17
- <h5 id="further-reading" class="sidebar-title">Further Reading</h5>
18
- <div class="sidebar-divider"></div>
19
- {% for link in page.further_reading %}
20
- {% include external-link.html %}
21
- {% endfor %}
20
+ <div class="mb-3">
21
+ <h5 id="further-reading" class="sidebar-title">Further Reading</h5>
22
+ <div class="list-group">
23
+ {% for link in page.further_reading %}
24
+ {% include ham/external-link.html %}
25
+ {% endfor %}
26
+ </div>
27
+ </div>
22
28
  {% endif %}
23
29
  {% if page.external_links != null %}
24
- <h5 id="external-links" class="sidebar-title">External Links</h5>
25
- <div class="sidebar-divider"></div>
26
- {% for link in page.external_links %}
27
- {% include external-link.html %}
28
- {% endfor %}
30
+ <div class="mb-3">
31
+ <h5 id="external-links" class="sidebar-title">External Links</h5>
32
+ <div class="list-group">
33
+ {% for link in page.external_links %}
34
+ {% include ham/external-link.html %}
35
+ {% endfor %}
36
+ </div>
37
+ </div>
29
38
  {% endif %}
30
- {% include comments.html %}
39
+ {% if page.contributing != null or site.ham.contributing != null %}
40
+ <div class="mb-3">
41
+ <h5 id="contribute" class="sidebar-title">Contribute to This Page</h5>
42
+ <div class="list-group">
43
+ {% if page.contributing.discuss.type != null or site.ham.contributing.discuss.type != null %}
44
+ <a
45
+ {% if page.contributing.discuss.type == 'url' or site.ham.contributing.discuss.type == 'url' %}
46
+ href="{{ page.contributing.discuss.url | default: site.ham.contributing.discuss.url }}"
47
+ {% else %}
48
+ #discuss
49
+ {% endif %} class="list-group-item">
50
+ <span class="sidebar-icon">
51
+ <i class="bi bi-chat-dots" aria-hidden="true"></i>
52
+ </span>
53
+ Discuss
54
+ </a>
55
+ {% endif %}
56
+ {% if page.contributing.issue_url != null or site.ham.contributing.issue_url != null %}
57
+ <a href="{{ page.contributing.issue_url | default: site.ham.contributing.issue_url }}" class="list-group-item">
58
+ <span class="sidebar-icon">
59
+ <i class="bi bi-bug" aria-hidden="true"></i>
60
+ </span>
61
+ Report New Issue
62
+ </a>
63
+ {% endif %}
64
+ {% if page.contributing.view_source_url != null or site.ham.contributing.view_source_base_url != null %}
65
+ <a
66
+ {% if page.contributing.issue_url != null %}
67
+ href="{{ page.contributing.view_source_url }}"
68
+ {% else %}
69
+ href="{{ site.ham.contributing.view_source_base_url }}{{ page.path }}"
70
+ {% endif %}
71
+ class="list-group-item">
72
+ <span class="sidebar-icon">
73
+ <i class="bi bi-code-slash" aria-hidden="true"></i>
74
+ </span>
75
+ View Source
76
+ </a>
77
+ {% endif %}
78
+ </div>
79
+ </div>
80
+ {% endif %}
81
+ {% include ham/comments.html %}
31
82
  </div>
32
83
  </div>
33
84
 
@@ -0,0 +1,90 @@
1
+ /*!
2
+ * Color mode toggler for Bootstrap's docs (https://getbootstrap.com/)
3
+ * Copyright 2011-2023 The Bootstrap Authors
4
+ * Licensed under the Creative Commons Attribution 3.0 Unported License.
5
+ */
6
+
7
+ // (() => {
8
+ "use strict";
9
+
10
+ const getStoredTheme = () => localStorage.getItem("theme");
11
+ const setStoredTheme = (theme) => localStorage.setItem("theme", theme);
12
+
13
+ const getPreferredTheme = () => {
14
+ const storedTheme = getStoredTheme();
15
+ if (storedTheme) {
16
+ return storedTheme;
17
+ }
18
+
19
+ return window.matchMedia("(prefers-color-scheme: dark)").matches
20
+ ? "dark"
21
+ : "light";
22
+ };
23
+
24
+ const setTheme = (theme) => {
25
+ if (
26
+ theme === "auto" &&
27
+ window.matchMedia("(prefers-color-scheme: dark)").matches
28
+ ) {
29
+ document.documentElement.setAttribute("data-bs-theme", "dark");
30
+ } else {
31
+ document.documentElement.setAttribute("data-bs-theme", theme);
32
+ }
33
+ };
34
+
35
+ setTheme(getPreferredTheme());
36
+
37
+ const showActiveTheme = (theme, focus = false) => {
38
+ const themeSwitcher = document.querySelector("#bd-theme");
39
+
40
+ if (!themeSwitcher) {
41
+ return;
42
+ }
43
+
44
+ const themeSwitcherText = document.querySelector("#bd-theme-text");
45
+ const activeThemeIcon = document.querySelector(".theme-icon-active use");
46
+ const btnToActive = document.querySelector(
47
+ `[data-bs-theme-value="${theme}"]`
48
+ );
49
+ const svgOfActiveBtn = btnToActive
50
+ .querySelector("svg use")
51
+ .getAttribute("href");
52
+
53
+ document.querySelectorAll("[data-bs-theme-value]").forEach((element) => {
54
+ element.classList.remove("active");
55
+ element.setAttribute("aria-pressed", "false");
56
+ });
57
+
58
+ btnToActive.classList.add("active");
59
+ btnToActive.setAttribute("aria-pressed", "true");
60
+ activeThemeIcon.setAttribute("href", svgOfActiveBtn);
61
+ const themeSwitcherLabel = `${themeSwitcherText.textContent} (${btnToActive.dataset.bsThemeValue})`;
62
+ themeSwitcher.setAttribute("aria-label", themeSwitcherLabel);
63
+
64
+ if (focus) {
65
+ themeSwitcher.focus();
66
+ }
67
+ };
68
+
69
+ window
70
+ .matchMedia("(prefers-color-scheme: dark)")
71
+ .addEventListener("change", () => {
72
+ const storedTheme = getStoredTheme();
73
+ if (storedTheme !== "light" && storedTheme !== "dark") {
74
+ setTheme(getPreferredTheme());
75
+ }
76
+ });
77
+
78
+ window.addEventListener("DOMContentLoaded", () => {
79
+ showActiveTheme(getPreferredTheme());
80
+
81
+ document.querySelectorAll("[data-bs-theme-value]").forEach((toggle) => {
82
+ toggle.addEventListener("click", () => {
83
+ const theme = toggle.getAttribute("data-bs-theme-value");
84
+ setStoredTheme(theme);
85
+ setTheme(theme);
86
+ showActiveTheme(theme, true);
87
+ });
88
+ });
89
+ });
90
+ // })();
data/assets/cookies.js ADDED
@@ -0,0 +1,21 @@
1
+ function setCookie(name, value, exdays) {
2
+ const now = new Date();
3
+ now.setTime(now.getTime() + (exdays * 24 * 60 * 60 * 1000));
4
+ let expires = "expires="+ now.toUTCString();
5
+ document.cookie = name + "=" + value + ";" + expires + ";path=/";
6
+ }
7
+
8
+ function getCookie(name) {
9
+ var nameEQ = name + "=";
10
+ var ca = document.cookie.split(';');
11
+ for(var i=0;i < ca.length;i++) {
12
+ var c = ca[i];
13
+ while (c.charAt(0)==' ') c = c.substring(1,c.length);
14
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
15
+ }
16
+ return null;
17
+ }
18
+
19
+ function eraseCookie(name) {
20
+ document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
21
+ }
data/assets/default.css CHANGED
@@ -22,21 +22,30 @@
22
22
  margin-right: 0.5rem;
23
23
  }
24
24
 
25
+ /* Removes the unnecessary bottom padding on alerts */
26
+ .alert address, .alert dl, .alert ol, .alert p, .alert ul {
27
+ margin-bottom: 0.5rem;
28
+ }
29
+
30
+ .alert > :last-child {
31
+ margin-bottom: 0;
32
+ }
33
+
25
34
  /* Make syntax highlighter */
26
35
  .content-wrapper pre {
27
36
  word-wrap: normal;
28
37
  padding: 20px;
29
38
  border-radius: 4px;
30
- white-space:pre;
31
- transform:translate3d(0, 0, 0);
39
+ white-space: pre;
40
+ transform: translate3d(0, 0, 0);
32
41
  overflow-x:auto;
33
- -webkit-overflow-scrolling:touch;
34
- word-wrap:normal;
35
- -moz-tab-size:4;
36
- -o-tab-size:4;
37
- -webkit-tab-size:4;
38
- -ms-tab-size:4;
39
- tab-size:4;
42
+ -webkit-overflow-scrolling: touch;
43
+ word-wrap: normal;
44
+ -moz-tab-size: 4;
45
+ -o-tab-size: 4;
46
+ -webkit-tab-size: 4;
47
+ -ms-tab-size: 4;
48
+ tab-size: 4;
40
49
  }
41
50
  .content-wrapper pre::-webkit-scrollbar-thumb {
42
51
  background-color: rgba(255, 255, 255, 0.5);