jekyll-ham 0.3.1 → 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: f39da1492ade7da78cd6e948bb5d35d9bcfa88b53b32056d384fd3ed2f56d880
4
- data.tar.gz: b8017ac2f62c87fa9412e385b350789b11ced1bf42f39ee23f0d20b057c14b44
3
+ metadata.gz: 21d9bce136793f181a7227a0bd17ef8d2191e3bf834aa80a48d1f509feb7a7cd
4
+ data.tar.gz: cf3a60ab44ce32017302ffd28fee2b91dcbb213c31fd7528d68efbf12ce35d71
5
5
  SHA512:
6
- metadata.gz: 89f5c4597c9686272e9547d67912b71304319706c2f03226b8a31b2686778254c42140560d7edaafa3e62821280bfd44fdfe0c2b4bb7e6ad27e70f7b2a26bdf7
7
- data.tar.gz: c529c06a6d050d3e65f2024fae47398e536d9fddef50e7e6d5211557053ef44ded0091ee103b8a523b114f15a6c1ea1f510e8051d17aedc63e035e522f2ce7d6
6
+ metadata.gz: 9d06d7430743e1ee12b58bf02fbf9ed8b5676f1a05abc29571cd4be206e4be32726d7be2d5b6c1e9fcbb9cfa15d2709a7bc426325a02a5511c59046d99084a3c
7
+ data.tar.gz: 5c584f8a2bc52bb734839d5e8137002980bb277fa5cd36edaafda4fb8b2b57f91dda198c79a768ff8f1927347e93755ffe5f514a8be0433273d3877c1efb98f6
data/README.md CHANGED
@@ -29,6 +29,11 @@ external_links:
29
29
  ---
30
30
 
31
31
  # HAM 🥩
32
+
33
+ > [!IMPORTANT]
34
+ >
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>.
36
+
32
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.
33
38
 
34
39
  This project is built to replace the current, MediaWiki installation at <hackapedia.reinhart1010.id> after I found out difficult to create custom styles for it, while other, Git-based alternatives such as GitHub Wiki sucks (no, really) and may not support self-hosting on shared hosting providers.
@@ -41,6 +46,11 @@ HAM is short for:
41
46
  + [Halfmoon] and Markdown
42
47
  + && i++ (can we get more pull requests to add more stuff into this list?)
43
48
 
49
+ ## Why does HAM look boring?
50
+ HAM ships the default [Halfmoon] theme by default, which might be considered boring by some. But that's the beauty of it, because **HAM supports Halfmoon's CSS variables to play with!**
51
+
52
+ We believe that everyone should be able to theme HAM websites according to their brand and preferences, [including us over @reinhart1010 and @1010bots](https://github.com/reinhart1010/dotfiles/blob/main/halfmoon.css).
53
+
44
54
  ## Features
45
55
  ### What HAM is
46
56
  - [x] A static-site wiki generator
@@ -56,6 +66,9 @@ HAM is short for:
56
66
 
57
67
  ### What HAM would be
58
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 %}
59
72
 
60
73
  ## Usage
61
74
  ### For [GitHub Pages](https://pages.github.com)
@@ -81,7 +94,7 @@ gem "minima"
81
94
  on your `Gemfile` with
82
95
 
83
96
  ```gemspec
84
- gem "jekyll-ham", "~> 0.2.3"
97
+ gem "jekyll-ham", "~> 0.3.3"
85
98
  ```
86
99
 
87
100
  Also don't forget to change the `theme` configuration on your `_config.yml` to `jekyll-ham` instead of `minima`.
@@ -112,12 +125,39 @@ ham:
112
125
  content: BBBBBB
113
126
  contributing: # Additional metadata for "Contribute to This Page" section on sidebar
114
127
  discuss: # For "Discuss" (or "Talk page" on MediaWiki)
115
- type: url | custom | facebook | giscus | telegram | utterances
128
+ type: url | custom | commentbox.io | disqus | facebook | giscus | telegram | utterances
116
129
  url: https://github.com/reinhart1010/HAM/discussions/
117
130
  view_source_base_url: https://github.com/reinhart1010/HAM/blob/main/ # The base URL to publicly view the original (Markdown) source code
118
131
  issue_url: https://github.com/reinhart1010/HAM/issues/ # The URL to report an issue related to site or content
119
132
  ```
120
133
 
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`.
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
+
121
161
  ### Comments
122
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.
123
163
 
@@ -133,7 +173,7 @@ ham:
133
173
  ```
134
174
 
135
175
  #### Custom Comments Widget (HTML code)
136
- You can use an custom-made comments widget (e.g. JavaScript-based or `<iframe>` element) into HAM by placing the code under `_includes/custom-comments.html`. You can also use Jekyll-specific variables and attributes including `{{ site.url }}` to render custom widget code.
176
+ You can use an custom-made comments widget (e.g. JavaScript-based or `<iframe>` element) into HAM by placing the code under `_includes/custom-comments.html`. You can also use Jekyll-specific variables and attributes including `site.title`, `site.ham.contributing.issue_url` and `page.tags` to render custom widget code.
137
177
 
138
178
  ```yaml
139
179
  ham:
@@ -142,6 +182,28 @@ ham:
142
182
  type: custom
143
183
  ```
144
184
 
185
+ #### CommentBox.io
186
+ To set up CommentBox.io for HAM, [follow their installation instructions](https://commentbox.io), and modify the `_config.yml` according to the values obtained from the generated HTML snippet.
187
+
188
+ ```yaml
189
+ ham:
190
+ contributing:
191
+ discuss:
192
+ type: commentbox.io
193
+ project_id: CommentBox.io Project ID
194
+ ```
195
+
196
+ #### Disqus
197
+ To set up Disqus for HAM, [follow their installation instructions](https://commentbox.io), and modify the `_config.yml` according to the values obtained from the generated HTML snippet.
198
+
199
+ ```yaml
200
+ ham:
201
+ contributing:
202
+ discuss:
203
+ type: disqus
204
+ forum_shortname: example-forum # Disqus forum shortname, such as `example-forum` from `https://example-forum.disqus.com`.
205
+ ```
206
+
145
207
  #### Facebook
146
208
  HAM includes an external JavaScript from Facebook in order to render the Facebook Comments Widget. You are also required to register your website as an app on Facebook, [switch from Development Mode to Live/Public Mode](https://developers.facebook.com/docs/development/build-and-test/app-modes), and insert your App ID and preferred language into the configuration below.
147
209
 
@@ -176,7 +238,7 @@ ham:
176
238
  #### Telegram (@DiscussBot)
177
239
  HAM supports for Telegram's [@DiscussBot](https://t.me/DiscussBot) web comments widget. **This widget may not sync with comments on Telegram channels set up via [discussion groups](https://telegram.org/blog/privacy-discussions-web-bots).**
178
240
 
179
- To set up the widget, follow the instructions provided on https://comments.app under your Telegram account, and modify the `_config.yml` according to the values obtained from the generated HTML snippet.
241
+ To set up the widget, follow the instructions provided on <https://comments.app> under your Telegram account, and modify the `_config.yml` according to the values obtained from the generated HTML snippet.
180
242
 
181
243
  ```yaml
182
244
  ham:
@@ -184,6 +246,11 @@ ham:
184
246
  discuss:
185
247
  type: telegram
186
248
  telegram_discussion: data-telegram-discussion
249
+ comments_limit: data-comments-limit # Optional, default: 5
250
+ height: data-height # Optional
251
+ color: data-color # Optional
252
+ dark_color: data-dark-color # Optional
253
+ dark: data-dark # Optional, default: 0
187
254
  ```
188
255
 
189
256
  #### Utterances
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,50 +1,4 @@
1
- {% if page.contributing != null || site.ham.contributing != null %}
2
- {% if page.contributing.discuss.type != 'url' || site.ham.contributing.discuss.type != 'url' %}
3
- <h5 id="discuss" class="sidebar-title">Discuss this page</h5>
4
- <div class="sidebar-title">
5
- {% if page.contributing.discuss.type != null %}
6
- {% case page.contributing.discuss.type %}
7
- {% when 'custom' %}
8
- {% include custom-comments.html %}
9
- {% when 'facebook' %}
10
- {% if page.contributing.discuss.facebook_app_id != null %}
11
- <div id="fb-root"></div>
12
- <script async defer crossorigin="anonymous" src="https://connect.facebook.net/{{ page.contributing.discuss.lang }}/sdk.js#xfbml=1&version=v17.0&appId={{ page.contributing.discuss.facebook_app_id }}&autoLogAppEvents=1" nonce="mqsBinib"></script>
13
- <div class="fb-comments" data-href="https://developers.facebook.com/docs/plugins/comments#configurator" data-width="" data-numposts="5"></div>
14
- {% endif %}
15
- {% when 'giscus' %}
16
- <script src="https://giscus.app/client.js" data-repo="{{ page.contributing.discuss.repo }}" data-repo-id="{{ page.contributing.discuss.repo_id }}" data-category="{{ page.contributing.discuss.category }}" data-category-id="{{ page.contributing.discuss.category_id }}" data-mapping="{{ page.contributing.discuss.mapping }}" data-reactions-enabled="{{ page.contributing.discuss.reactions_enabled | default: 1 }}" data-emit-metadata="{{ page.contributing.discuss.emit_metadata | default: 0 }}" data-theme="{{ page.contributing.discuss.theme | default: 'preferred_color_scheme' }}" data-lang="{{ page.contributing.discuss.lang | default: 'en' }}" crossorigin="anonymous" async></script>
17
- {% when 'telegram' %}
18
- <script src="https://telegram.org/js/telegram-widget.js?15" {% if page.contributing.discuss.telegram_discussion != null %} data-telegram-discussion="{{ page.contributing.discuss.telegram_discussion }}" {% endif %} data-comments-limit="{{ page.contributing.discuss.comments_limit | default: '5' }}" {% if page.contributing.discuss.height != null %} data-height="{{ page.contributing.discuss.height }}" {% endif %} data-color="{{ page.contributing.discuss.color | default: '319BE6' }}" data-dark-color="{{ page.contributing.discuss.color | default: '4BA3E2' }}" data-colorful="{{ page.contributing.discuss.colorful | default: 0 }}" data-dark="{{ page.contributing.discuss.dark | default: 0 }}" crossorigin="anonymous" async></script>
19
- {% when 'utterances' %}
20
- <script src="https://utteranc.es/client.js" repo="{{ page.contributing.discuss.repo }}" issue-term="{{ page.contributing.discuss.issue_term }}"
21
- {% if page.contributing.discuss.label != null %}
22
- label="{{ page.contributing.discuss.label }}"
23
- {% endif %}
24
- theme="{{ page.contributing.discuss.theme | default: 'preferred-color-scheme' }}" crossorigin="anonymous" async></script>
25
- {% endcase %}
26
- {% else %}
27
- {% case site.ham.contributing.discuss.type %}
28
- {% when 'custom' %}
29
- {% include custom-comments.html %}
30
- {% when 'facebook' %}
31
- {% if site.ham.contributing.discuss.facebook_app_id != null %}
32
- <div id="fb-root"></div>
33
- <script async defer crossorigin="anonymous" src="https://connect.facebook.net/{{ site.ham.contributing.discuss.lang }}/sdk.js#xfbml=1&version=v17.0&appId={{ site.ham.contributing.discuss.facebook_app_id }}&autoLogAppEvents=1" nonce="mqsBinib"></script>
34
- <div class="fb-comments" data-href="https://developers.facebook.com/docs/plugins/comments#configurator" data-width="" data-numposts="5"></div>
35
- {% endif %}
36
- {% when 'giscus' %}
37
- <script src="https://giscus.app/client.js" data-repo="{{ site.ham.contributing.discuss.repo }}" data-repo-id="{{ site.ham.contributing.discuss.repo_id }}" data-category="{{ site.ham.contributing.discuss.category }}" data-category-id="{{ site.ham.contributing.discuss.category_id }}" data-mapping="{{ site.ham.contributing.discuss.mapping }}" data-reactions-enabled="{{ site.ham.contributing.discuss.reactions_enabled | default: 1 }}" data-emit-metadata="{{ site.ham.contributing.discuss.emit_metadata | default: 0 }}" data-theme="{{ site.ham.contributing.discuss.theme | default: 'preferred_color_scheme' }}" data-lang="{{ site.ham.contributing.discuss.lang | default: 'en' }}" crossorigin="anonymous" async></script>
38
- {% when 'telegram' %}
39
- <script src="https://telegram.org/js/telegram-widget.js?15" {% if site.ham.contributing.discuss.telegram_discussion != null %} data-telegram-discussion="{{ site.ham.contributing.discuss.telegram_discussion }}" {% endif %} data-comments-limit="{{ site.ham.contributing.discuss.comments_limit | default: '5' }}" {% if site.ham.contributing.discuss.height != null %} data-height="{{ site.ham.contributing.discuss.height }}" {% endif %} data-color="{{ site.ham.contributing.discuss.color | default: '319BE6' }}" data-dark-color="{{ site.ham.contributing.discuss.color | default: '4BA3E2' }}" data-colorful="{{ site.ham.contributing.discuss.colorful | default: 0 }}" data-dark="{{ site.ham.contributing.discuss.dark | default: 0 }}" crossorigin="anonymous" async></script>
40
- {% when 'utterances' %}
41
- <script src="https://utteranc.es/client.js" repo="{{ site.ham.contributing.discuss.repo }}" issue-term="{{ site.ham.contributing.discuss.issue_term }}"
42
- {% if site.ham.contributing.discuss.label != null %}
43
- label="{{ site.ham.contributing.discuss.label }}"
44
- {% endif %}
45
- theme="{{ site.ham.contributing.discuss.theme | default: 'preferred-color-scheme' }}" crossorigin="anonymous" async></script>
46
- {% endcase %}
47
- {% endif %}
48
- </div>
49
- {% endif %}
50
- {% 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,3 @@
1
+ <!-- Default favicon template. To override, create your own `_includes/favicon.html` file. -->
2
+ <!-- You may want to use a favicon generator such as https://www.websiteplanet.com/webtools/favicon-generator/ -->
3
+ <link rel="icon" href="{{ site.ham.site_favicon | default: site.ham.site_icon }}">
@@ -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 bg-dark-lm bg-white-dm text-white-lm text-dark-dm">
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>
@@ -9,8 +9,10 @@
9
9
  <meta name="{{ meta.name }}" content="{{ meta.content }}" />
10
10
  {% endfor %}
11
11
 
12
- <!-- Favicon and title -->
13
- <link rel="icon" href="{{ site.ham.site_favicon | default: site.ham.site_icon }}">
12
+ <!-- Favicon -->
13
+ {% include favicon.html %}
14
+
15
+ <!-- Title -->
14
16
  <title>{{ page.title }} - {{ site.title }}</title>
15
17
 
16
18
  <!-- Halfmoon CSS -->
@@ -31,30 +33,43 @@
31
33
  <link href="{{ link }}" rel="me" />
32
34
  {% endfor %}
33
35
  </head>
34
- <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">
35
- {% 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">
36
37
  <div class="page-wrapper with-navbar with-sidebar">
37
38
  <div class="sticky-alerts"></div>
38
- {% include navbar.html %}
39
- {% include sidebar.html %}
39
+ {% include ham/navbar.html %}
40
+ {% include ham/sidebar.html %}
40
41
  <div class="content-wrapper">
41
42
  <div class="container-fluid">
42
43
  {{ content }}
43
44
  </div>
44
45
  </div>
45
- {% include footer.html %}
46
+ {% include ham/footer.html %}
46
47
  </div>
47
48
 
48
49
  <!-- Simple Jekyll Search JS -->
49
50
  <script src="{{ site.url }}/assets/simple-jekyll-search.min.js"></script>
50
51
  <script>
51
52
  var sjs = SimpleJekyllSearch({
52
- searchInput: document.getElementById('search-input'),
53
- resultsContainer: document.getElementById('results-container'),
54
- json: '{{ site.url }}/assets/search.json'
55
- })
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);
56
69
  </script>
57
70
  <!-- Halfmoon JS -->
58
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>
59
74
  </body>
60
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