jekyll-bonsai 0.0.4 → 0.0.5

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: f9568553876fa541b204abf563405253d78cf950447c7bf497807d6df3f6163b
4
- data.tar.gz: 360fb7492e19718e636a9edbd061f5c9cc357b471dd6817a1d24e0a48306695b
3
+ metadata.gz: 72585ceda9750c7f60eca2d8bc006503f12bc2331fd2b6de9da5b2a250e78faf
4
+ data.tar.gz: 643b66086e0e131c9241c0b7a9dc8028da22abc1e917133c5bf5c521a6db6c45
5
5
  SHA512:
6
- metadata.gz: ecff422cced7fc1e943869742e1dd362a6afbb99c95c15d06cfd2e0a0415c7656541914185c7ee3fd75449b794acd67600f3c1486adb708a9fcfee51b1f47212
7
- data.tar.gz: a294d563c5af997ea0b9f184ea75b95f11b3ac1f298ba419d92298371292a491e9f89e03301f0404045ae71caaf68eddbb913d507c9ee02aabc79bbe87d008b6
6
+ metadata.gz: e751ee29986f817f0eb1d586fd58b2fb315ede3b44ce69074bb1cae5d74da0e820214e28225ec1f7b64d725c8dc1d7155a39c62a2bbfcc9ef1d6035e7866bd89
7
+ data.tar.gz: 8297fec38537840a069284f7fa67cb425549fbc42628152d74fd3dd1ae27163ce21dbbc2e65196070c0a3c00ef3e7376812327645cad035a98e43bb52907f751
data/README.md CHANGED
@@ -5,3 +5,5 @@
5
5
  ⚠️ This template is newly sprouted ⚠️
6
6
 
7
7
  Consider this a beta.
8
+
9
+ Setup instructions are [here](https://jekyll-bonsai.netlify.app/post/0b9db15818/).
data/_config.yml CHANGED
@@ -104,7 +104,7 @@ compress_html:
104
104
  #
105
105
 
106
106
  # Google Analytics (ip is anonymized by default)
107
- ga_tracking: UA-190413040-4
107
+ # ga_tracking: UA-190413040-4
108
108
 
109
109
  # seo
110
110
  # tagline: ""
data/_data/emoji.yml CHANGED
@@ -35,7 +35,7 @@ tags: 🧺
35
35
  #
36
36
  # social
37
37
  connect: 🌊
38
- share: 🐝
38
+ share: 🐝 # this is also the emoji for anchor-headings
39
39
  # changes
40
40
  created: 🌩
41
41
  published: 🌤
@@ -0,0 +1,50 @@
1
+ {% comment %}
2
+
3
+ Usage:
4
+ {% assign tag_attr = page.attributes | link_type: "tags" %}
5
+ {% include tags.html tag_attr=tag_attr tag_fm=page.tags %}
6
+
7
+ Parameters:
8
+ * tag_attr (array) - array of attributes that are hashes with keys
9
+ 'type' and 'urls'
10
+ (which correspond to `jekyll-wikilinks`
11
+ attributes and attributed metadata)
12
+ * tag_fm (array) - array of strings that are tag names
13
+ (which correspond to entry filenames)
14
+
15
+ Note:
16
+ To be used with germ-type documents.
17
+ (e.g. markdown documents that use tags metadata to map to entries)
18
+
19
+ {% endcomment %}
20
+
21
+
22
+ <!-- 'tags' attribute -->
23
+ {% assign tag_attrs = page.attributes | link_type: "tags" %}
24
+ {% for tag_attrs in tag_attrs %}
25
+ {% for url in tag_attrs.urls %}
26
+ {% assign entry = site.entries | where: "url", url | first %}
27
+ <button class="tag-pill {% if entry %}{% else %}disabled{% endif %}">
28
+ {% if entry %}
29
+ {% include btn_state.html states=entry.status %}
30
+ <a class="sem-tag" href="{{ entry.url | relative_url }}">{{ entry.title }}</a>
31
+ {% else %}
32
+ <span class="text--small">{{ site.data.emoji.missing }} {{ sem_tag }}</span>
33
+ {% endif %}
34
+ </button>
35
+ {% endfor %}
36
+ {% endfor %}
37
+ <!-- 'tags' frontmatter -->
38
+ {% for sem_tag in page.tags %}
39
+ <!-- prefix with '/' to prevent matching subhierarchies -->
40
+ {% assign sem_tag_path = "/" | append: sem_tag | append: ".md" %}
41
+ {% assign entry = site.entries | find_exp: "item", "item.path contains sem_tag_path" %}
42
+ <button class="tag-pill {% if entry %}{% else %}disabled{% endif %}">
43
+ {% if entry %}
44
+ {% include btn_state.html states=entry.status %}
45
+ <a class="sem-tag" href="{{ entry.url | relative_url }}">{{ entry.title }}</a>
46
+ {% else %}
47
+ <span class="text--small">{{ site.data.emoji.missing }} {{ sem_tag }}</span>
48
+ {% endif %}
49
+ </button>
50
+ {% endfor %}
data/_layouts/book.html CHANGED
@@ -26,18 +26,8 @@ layout: base
26
26
  {% endif %}
27
27
  </div>
28
28
  <div class="infobox__sem-tags p-category">
29
- {% for sem_tag in page.tags %}
30
- {% assign sem_tag_file = sem_tag | append: ".md" %}
31
- {% assign entry = site.entries | find_exp: "item", "item.path contains sem_tag_file" %}
32
- <button class="tag-pill {% if entry %}{% else %}disabled{% endif %}">
33
- {% if entry %}
34
- {% include btn_state.html states=entry.status %}
35
- <a class="sem-tag" href="{{ entry.url | relative_url }}">{{ entry.title }}</a>
36
- {% else %}
37
- <span class="text--small">{{ site.data.emoji.missing }} {{ sem_tag }}</span>
38
- {% endif %}
39
- </button>
40
- {% endfor %}
29
+ {% assign tag_attrs = page.attributes | link_type: "tags" %}
30
+ {% include tags.html tag_attr=tag_attrs tag_fm=page.tags %}
41
31
  </div>
42
32
  </div>
43
33
  </section>
data/_layouts/entry.html CHANGED
@@ -149,7 +149,7 @@ layout: base
149
149
  {% else %}
150
150
  <!-- attributed -->
151
151
  <ul>
152
- {% for attr in page.attributed %}
152
+ {% for attr in entry_attrd %}
153
153
  {% for attr_url in attr.urls %}
154
154
  {% assign attr_doc = site.entries | where: "url", attr_url | first %}
155
155
  {% if attr_doc %}
@@ -160,7 +160,7 @@ layout: base
160
160
  </a>
161
161
  </li>
162
162
  {% else %}
163
- <li>]
163
+ <li>
164
164
  <span class="text--small text--no-point">{{ site.data.emoji.missing }} {{ attr_url }}</span>
165
165
  </li>
166
166
  {% endif %}
@@ -220,6 +220,23 @@ layout: base
220
220
  {% endif %}
221
221
  {% endfor %}
222
222
  </ul>
223
+ <!-- 'tags' attributed posts/books -->
224
+ <ul>
225
+ {% assign post_attrds = page.attributed | doc_type: "posts" %}
226
+ {% assign book_attrds = page.attributed | doc_type: "books" %}
227
+ {% assign pb_attrds = post_attrds | concat: book_attrds %}
228
+ {% assign tag_attrds = pb_attrds | link_type: "tags" %}
229
+ {% for tag_attrd in tag_attrds %}
230
+ {% for url in tag_attrd.urls %}
231
+ {% assign num_linked_docs = num_linked_docs | plus: 1 %}
232
+ {% assign doc = site.documents | where: "url", url | first %}
233
+ <li>
234
+ {% include btn_state.html states=doc.status %}
235
+ <a class="wiki-link" href="{{ doc.url | relative_url }}">{{ doc.title }}</a>
236
+ </li>
237
+ {% endfor %}
238
+ {% endfor %}
239
+ </ul>
223
240
  {% if site.bonsai.entries.backlinks %}
224
241
  <!-- backlinked posts/books -->
225
242
  <ul>
data/_layouts/post.html CHANGED
@@ -24,18 +24,8 @@ layout: base
24
24
  {% endif %}
25
25
  </div>
26
26
  <div class="infobox__sem-tags p-category">
27
- {% for sem_tag in page.tags %}
28
- {% assign sem_tag_file = sem_tag | append: ".md" %}
29
- {% assign entry = site.entries | find_exp: "item", "item.path contains sem_tag_file" %}
30
- <button class="tag-pill {% if entry %}{% else %}disabled{% endif %}">
31
- {% if entry %}
32
- {% include btn_state.html states=entry.status %}
33
- <a class="sem-tag" href="{{ entry.url | relative_url }}">{{ entry.title }}</a>
34
- {% else %}
35
- <span class="text--small">{{ site.data.emoji.missing }} {{ sem_tag }}</span>
36
- {% endif %}
37
- </button>
38
- {% endfor %}
27
+ {% assign tag_attrs = page.attributes | link_type: "tags" %}
28
+ {% include tags.html tag_attr=tag_attrs tag_fm=page.tags %}
39
29
  </div>
40
30
  </div>
41
31
  </section>
data/_layouts/recent.html CHANGED
@@ -29,9 +29,10 @@ layout: base
29
29
  {% for doc in recent_docs limit: site.bonsai.recent.cap %}
30
30
  <!-- determine if doc's recent status -->
31
31
  <!-- from: https://stackoverflow.com/questions/37340705/shopify-liquid-find-number-of-days-between-two-dates -->
32
- <!-- {% assign ctime = doc.created | date: '%s' %} -->
33
- {% assign ptime = doc.date | date: '%s' %}
34
- {% assign mtime = doc.updated | date: '%s' %}
32
+ <!-- note: slicing off milliseconds -->
33
+ <!-- {% assign ctime = doc.created | date: '%s' | slice: 0, 10 %} -->
34
+ {% assign ptime = doc.date | date: '%s' | slice: 0, 10 %}
35
+ {% assign mtime = doc.updated | date: '%s' | slice: 0, 10 %}
35
36
  {% assign sec_diff = mtime | minus: ptime %}
36
37
  {% assign is_same_day = sec_diff | divided_by: 3600 | divided_by: 24 %}
37
38
  <li>
data/assets/js/search.js CHANGED
@@ -41,6 +41,7 @@ export default class Search {
41
41
  const macKeys = (event.metaKey && (event.key === 'k'));
42
42
  const winKeys = (event.ctrlKey && (event.key === 'k'));
43
43
  if (macKeys || winKeys) {
44
+ event.preventDefault();
44
45
  this.toggleSearch();
45
46
  }
46
47
  });
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-bonsai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - manunamz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-24 00:00:00.000000000 Z
11
+ date: 2022-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 0.0.8
131
+ version: 0.0.9
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 0.0.8
138
+ version: 0.0.9
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: jekyll-graph
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -217,6 +217,7 @@ files:
217
217
  - _includes/img/pencil-filter.svg
218
218
  - _includes/share.html
219
219
  - _includes/site-nav.html
220
+ - _includes/tags.html
220
221
  - _includes/themes.scss.liquid
221
222
  - _includes/toc.html
222
223
  - _layouts/404.html