jekyll-theme-linky 0.2.6 → 0.2.8

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: a9e873eb39e0429fcf86ac52c5f27f9336fad7eaacfee54da29c6ed4b08a9616
4
- data.tar.gz: 39236108b4b7cd657d885485858705bbc459ecd7ef3aa99242b5ca75d59369a1
3
+ metadata.gz: 47c812cb5796f688a4f3b93396ef065432c1baf740a60ea14a5245863ac55b16
4
+ data.tar.gz: e0905b3244a235a064dff60d6432a94895bd7bba1f2d25d829ea3174ea386d24
5
5
  SHA512:
6
- metadata.gz: 9fee19b2a6ac03b7ee37c729ea883a79a0d17d2d0ce4e9771d5473805e174b85c2759fb2b1954b96489514eea64b66f2a710827db4be9d7cb5a1ebb0f442eda7
7
- data.tar.gz: 6bc62e5545229d60f674ea184307ef586670fd3a6256f5a698907605e48879c49ef8897092e9adfc46d1c8f3d1e123a2750c28b5292ac357b4ad7d7f06f90b15
6
+ metadata.gz: 442f20ea5e960f9047b9584ab77ee04f5f47c8192dfc2ef698818a094fb0ada2b002f0f9c18afcc82f4df4c0eedc770d45cfae10e020c4f310d4c15f046d436b
7
+ data.tar.gz: 321f7bc3b9c71e920c27d941d56999f035568712fc504e5fd9380cafc38fbda2c0c2cd3aa0b04aa9771e8a5ef7d659ba1c4348579849e3749574f9b635bd571f
data/README.md CHANGED
@@ -113,6 +113,7 @@ image: "/images/example.jpg"
113
113
  title: 'My link test'
114
114
  priority: 5
115
115
  expires: 2024-11-11
116
+ category: 'Example'
116
117
  ---
117
118
  ```
118
119
 
@@ -140,6 +141,11 @@ expires: 2024-11-11
140
141
 
141
142
  Note that this will only take effect on a rebuild; there's no runtime JavaScript, etc. to disable a link that's already been deployed.
142
143
 
144
+ - `category`
145
+
146
+ Links will be grouped by category (if any). Items without a category field will be grouped together at the
147
+ top of the list; other items will be separated by category headers.
148
+
143
149
 
144
150
  ## Update Links with Decap CMS
145
151
 
@@ -0,0 +1,39 @@
1
+
2
+ {% assign link_list = include.link_list %}
3
+ {% assign collection_title = include.title | default: "" %}
4
+
5
+
6
+ {% if collection_title != "" %}
7
+ <h2 class="section-header">{{ collection_title }}</h2>
8
+ {% endif %}
9
+
10
+ <ul class="links">
11
+ {% assign current_date = site.time | date: "%Y-%m-%d" %}
12
+
13
+ {% assign valid_links = '' | split: '' %}
14
+
15
+ {% for link in link_list %}
16
+ {% if link.expires and link.expires != nil and link.expires != '' %}
17
+ {% assign exp_date = link.expires | date: "%Y-%m-%d" %}
18
+ {% if exp_date > current_date %}
19
+ {% assign valid_links = valid_links | push: link %}
20
+ {% endif %}
21
+ {% else %}
22
+ {% assign valid_links = valid_links | push: link %}
23
+ {% endif %}
24
+ {% endfor %}
25
+
26
+ {% assign priorities = valid_links | sort: "priority" | group_by: 'priority' %}
27
+
28
+ {% for priority in priorities %}
29
+ {% assign sorted_links = priority.items | sort: 'title' %}
30
+
31
+ {% for link in sorted_links %}
32
+ <li class="link" data-priority="{{ link.priority }}">
33
+ <a href="{{ link.link }}">
34
+ <img src="{{ link.image | default: "/assets/link-default.svg" }}" class="link-logo" alt="{{ link.title }}"> </a>
35
+ <a class="link-desc" href="{{ link.link }}">{{ link.title }}</a>
36
+ </li>
37
+ {% endfor %}
38
+ {% endfor %}
39
+ </ul>
data/_layouts/links.html CHANGED
@@ -132,38 +132,18 @@ layout: default
132
132
  <h1 class="page-heading">{{ page.title }}</h1>
133
133
  {%- endif -%}
134
134
 
135
- <ul class="links">
136
-
137
-
138
- {% assign current_date = site.time | date: "%Y-%m-%d" %}
139
-
140
- {% assign valid_links = '' | split: '' %}
141
-
142
- {% for link in site.links %}
143
- {% if link.expires and link.expires != nil %}
144
- {% assign exp_date = link.expires | date: "%Y-%m-%d" %}
145
- {% if exp_date > current_date %}
146
- {% assign valid_links = valid_links | push: link %}
147
- {% endif %}
148
- {% else %}
149
- {% assign valid_links = valid_links | push: link %}
150
- {% endif %}
151
- {% endfor %}
152
-
153
- {% assign priorities = valid_links | sort: "priority" | group_by: 'priority' %}
154
-
155
- {% for priority in priorities %}
156
- {% assign sorted_links = priority.items | sort: 'title' %}
135
+ {%- assign uncategorized_links = site.links | where_exp: "link", "link.category == nil" -%}
136
+ {%- if uncategorized_links.size > 0 -%}
137
+ {% include link-category.html link_list=uncategorized_links %}
138
+ {%- endif -%}
157
139
 
158
- {% for link in sorted_links %}
159
- <li class="link" data-priority="{{ link.priority }}">
160
- <a href="{{ link.link }}">
161
- <img src="{{ link.image | default: "/assets/link-default.svg" }}" class="link-logo" alt="{{ link.title }}"> </a>
162
- <a class="link-desc" href="{{ link.link }}">{{ link.title }}</a>
163
- </li>
164
- {% endfor %}
165
- {% endfor %}
166
- </ul>
140
+ {%- assign categories = site.links | map: "category" | uniq | where_exp: "category", "category != nil" -%}
141
+ {%- for category in categories -%}
142
+ {%- assign categorized_links = site.links | where: "category", category -%}
143
+ {%- if categorized_links.size > 0 -%}
144
+ {% include link-category.html link_list=categorized_links title=category %}
145
+ {%- endif -%}
146
+ {%- endfor -%}
167
147
 
168
148
  {{ content }}
169
149
  </div>
data/_sass/linky.scss CHANGED
@@ -108,7 +108,7 @@ li.link {
108
108
  min-width: 150px;
109
109
  max-width: 600px;
110
110
  background-color: var(--button-background);
111
- padding: 0.5em;
111
+ padding: 0.5em 2.5em 0.5em 0.5em;
112
112
  border-radius: 1em;
113
113
  cursor: pointer;
114
114
  text-align: center;
@@ -165,3 +165,14 @@ h1 {
165
165
  margin: 0 auto;
166
166
  text-align: center;
167
167
  }
168
+
169
+ .section-header {
170
+ margin: 0 20px;
171
+ font-weight: normal;
172
+ text-align: center;
173
+ font-size: 125%;
174
+ }
175
+
176
+ .link:first-child {
177
+ margin-top: 0.5rem;
178
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-linky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Roub
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-22 00:00:00.000000000 Z
11
+ date: 2025-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -72,6 +72,7 @@ files:
72
72
  - _includes/head.html
73
73
  - _includes/header.html
74
74
  - _includes/instagram-logo.svg
75
+ - _includes/link-category.html
75
76
  - _includes/mastodon-logo.svg
76
77
  - _includes/phone-logo.svg
77
78
  - _includes/pinterest-logo.svg
@@ -108,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
109
  - !ruby/object:Gem::Version
109
110
  version: '0'
110
111
  requirements: []
111
- rubygems_version: 3.4.19
112
+ rubygems_version: 3.5.17
112
113
  signing_key:
113
114
  specification_version: 4
114
115
  summary: Linktree-ish theme for Jekyll, compatible with Decap CMS