domain-jekyll 1.4.0 → 1.5.0

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: 31fbda55af66cceab7014912b13d31b8d942b75a635a51f8f252a0fbd1fdb57f
4
- data.tar.gz: cb252246f7739f542f0a94b5be2db88112962c1859c21574cb1638a94f2df778
3
+ metadata.gz: 95557ad49d54a59a5e034afcc54144db8317728b7ec10afb362ea663f56bcec6
4
+ data.tar.gz: a8b289c9d3d3077370e5ee20dacb2c2acbb22dc11a172a6fa807d604c77d10b5
5
5
  SHA512:
6
- metadata.gz: 1392731abdae484cf42cb11b9615cab43bfede0d3b02c7f8ac3c4a5f42388efc8d12c69a84d48894c92196c28fa445e3d0b286481fb523a7264a2cee5cba4a2a
7
- data.tar.gz: deb886f7592ec7c68018bb092647e674631c37dfb77ddd237b478c47f4230d71d89a7cbbfc0780eb40dd9e7b4637778ddff1613974ec746b6042091514ae8492
6
+ metadata.gz: 91381810e3bc62595470fd4e60beab14bf2905402168790d1b9aec39f2402066d47700afb8352035c407f12c15e062abbe311c9f390a2b63e48839a55a6e3249
7
+ data.tar.gz: 8ef33580868e50dd8cd686af97b47d032e9fd10b434b3f183d972ad1579f384682a7712bf74d0748df48bf4d3715a6eeeb42454ddc8fb6411350a9ed99bd4214
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## [1.5.0](https://github.com/lumunix/domain/releases/tag/1.5.0)
2
+ - Added PostPreviews for Tags and Posts
3
+ - Icon Updates
1
4
  ## [1.4.0](https://github.com/lumunix/domain/releases/tag/1.4.0)
2
5
  - Added card based sections for the tags and posts pages
3
6
  - Fixed margins on small screen sizes
data/README.md CHANGED
@@ -8,9 +8,9 @@
8
8
  # [Domain](https://lumunix.github.io/Domain/)
9
9
  Jekyll Knowledge Base / Blog Theme that provides wiki style linking, full text search and automatically generated post organization pages.
10
10
 
11
- ![Project-Banner](/readme/project-banner.png)
11
+ ![Project-Banner](./readme/project-banner.png)
12
12
 
13
- ![Showcase](/readme/showcase.png)
13
+ ![Showcase](./readme/showcase.png)
14
14
 
15
15
 
16
16
  ## Installation
@@ -1,62 +1,72 @@
1
1
  <header>
2
- <div class="main-site-subheader menu disable-select">
3
- <a class="menu-item" href="{{site.baseurl}}/">
4
- <svg class="menu-item-icon" xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 25 25" fill="none" stroke="#000000" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
5
- <path d="M20 9v11a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9"/>
6
- <path d="M9 22V12h6v10M2 10.6L12 2l10 8.6"/>
7
- </svg>
2
+ <div class="main-site-subheader menu disable-select">
3
+ <a class="menu-item" href="{{site.baseurl}}/">
4
+ <svg class="menu-item-icon" xmlns="http://www.w3.org/2000/svg" width="18" height="20" viewBox="0 0 25 25"
5
+ fill="none" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
6
+ <path d="M20 9v11a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9"/>
7
+ <path d="M9 22V12h6v10M2 10.6L12 2l10 8.6"/>
8
+ </svg>
8
9
  <p class="menu-item-text">Home</p>
9
- </a>
10
- <a class="menu-item" href="{{site.baseurl}}/about">
11
- <svg class="menu-item-icon" width="18" height="19" viewBox="0 0 25 25" fill="none"
12
- xmlns="http://www.w3.org/2000/svg">
13
- <path
14
- d="M20.9777 21.6138V19.6138C20.9777 18.553 20.5563 17.5356 19.8061 16.7854C19.056 16.0353 18.0386 15.6138 16.9777 15.6138H8.97768C7.91682 15.6138 6.8994 16.0353 6.14926 16.7854C5.39911 17.5356 4.97768 18.553 4.97768 19.6138V21.6138"
15
- stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
16
- <path
17
- d="M12.9777 11.6138C15.1868 11.6138 16.9777 9.82298 16.9777 7.61385C16.9777 5.40471 15.1868 3.61385 12.9777 3.61385C10.7685 3.61385 8.97768 5.40471 8.97768 7.61385C8.97768 9.82298 10.7685 11.6138 12.9777 11.6138Z"
18
- stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
19
- </svg>
20
- <p class="menu-item-text">About</p>
21
- </a>
22
- <a class="menu-item" href="{{site.baseurl}}/posts">
23
- <svg class="menu-item-icon" xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 24 25" fill="none"
24
- stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
25
- <rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
26
- <line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line>
27
- <line x1="3" y1="10" x2="21" y2="10"></line>
10
+ </a>
11
+ <a class="menu-item" href="{{site.baseurl}}/about">
12
+ <svg class="menu-item-icon" width="18" height="20" viewBox="0 0 25 25" fill="none"
13
+ xmlns="http://www.w3.org/2000/svg">
14
+ <path
15
+ d="M20.9777 21.6138V19.6138C20.9777 18.553 20.5563 17.5356 19.8061 16.7854C19.056 16.0353 18.0386 15.6138 16.9777 15.6138H8.97768C7.91682 15.6138 6.8994 16.0353 6.14926 16.7854C5.39911 17.5356 4.97768 18.553 4.97768 19.6138V21.6138"
16
+ stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
17
+ <path
18
+ d="M12.9777 11.6138C15.1868 11.6138 16.9777 9.82298 16.9777 7.61385C16.9777 5.40471 15.1868 3.61385 12.9777 3.61385C10.7685 3.61385 8.97768 5.40471 8.97768 7.61385C8.97768 9.82298 10.7685 11.6138 12.9777 11.6138Z"
19
+ stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
20
+ </svg>
21
+ <p class="menu-item-text">About</p>
22
+ </a>
23
+ <a class="menu-item" href="{{site.baseurl}}/posts">
24
+ <svg class="menu-item-icon" xmlns="http://www.w3.org/2000/svg" width="18" height="20" viewBox="0 0 25 25"
25
+ fill="none"
26
+ stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
27
+ <rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
28
+ <line x1="16" y1="2" x2="16" y2="6"></line>
29
+ <line x1="8" y1="2" x2="8" y2="6"></line>
30
+ <line x1="3" y1="10" x2="21" y2="10"></line>
28
31
  </svg>
29
32
  <p class="menu-item-text">Posts</p>
30
- </a>
31
- <a class="menu-item" href="{{site.baseurl}}/tutorials">
32
- <svg class="menu-item-icon" xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 24 24">
33
- <path d="M4 17.162l-2 .838v-12.972l12-5.028v2.507l-10 4.19v10.465zm16-8.156v8.635l-8 3.352v-8.635l8-3.352zm2-3.006l-12 5.028v12.972l12-5.028v-12.972zm-14 3.697l10-4.19v-2.507l-12 5.028v12.972l2-.838v-10.465z"
34
- stroke-width="0" stroke-linecap="round" stroke-linejoin="round"/>
33
+ </a>
34
+ <a class="menu-item" href="{{site.baseurl}}/tutorials">
35
+
36
+ <svg class="menu-item-icon" width="18" height="20" viewBox="0 0 25 25" fill="none"
37
+ xmlns="http://www.w3.org/2000/svg">
38
+ <g id="SVGRepo_bgCarrier" stroke-width="0"></g>
39
+ <g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
40
+ <g id="SVGRepo_iconCarrier">
41
+ <path d="M12 10.4V20M12 10.4C12 8.15979 12 7.03969 11.564 6.18404C11.1805 5.43139 10.5686 4.81947 9.81596 4.43597C8.96031 4 7.84021 4 5.6 4H4.6C4.03995 4 3.75992 4 3.54601 4.10899C3.35785 4.20487 3.20487 4.35785 3.10899 4.54601C3 4.75992 3 5.03995 3 5.6V16.4C3 16.9601 3 17.2401 3.10899 17.454C3.20487 17.6422 3.35785 17.7951 3.54601 17.891C3.75992 18 4.03995 18 4.6 18H7.54668C8.08687 18 8.35696 18 8.61814 18.0466C8.84995 18.0879 9.0761 18.1563 9.29191 18.2506C9.53504 18.3567 9.75977 18.5065 10.2092 18.8062L12 20M12 10.4C12 8.15979 12 7.03969 12.436 6.18404C12.8195 5.43139 13.4314 4.81947 14.184 4.43597C15.0397 4 16.1598 4 18.4 4H19.4C19.9601 4 20.2401 4 20.454 4.10899C20.6422 4.20487 20.7951 4.35785 20.891 4.54601C21 4.75992 21 5.03995 21 5.6V16.4C21 16.9601 21 17.2401 20.891 17.454C20.7951 17.6422 20.6422 17.7951 20.454 17.891C20.2401 18 19.9601 18 19.4 18H16.4533C15.9131 18 15.643 18 15.3819 18.0466C15.15 18.0879 14.9239 18.1563 14.7081 18.2506C14.465 18.3567 14.2402 18.5065 13.7908 18.8062L12 20"
42
+ stroke-width="3" stroke-linecap="round" stroke-linejoin="round"></path>
43
+ </g>
35
44
  </svg>
36
45
  <p class="menu-item-text">Tutorials</p>
37
- </a>
38
- <a class="menu-item" href="{{site.baseurl}}/tags">
39
- <svg class="menu-item-icon" width="18" height="19" viewBox="0 0 24 25" fill="none"
40
- xmlns="http://www.w3.org/2000/svg">
41
- <path d="M4 9.5H20" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" />
42
- <path d="M4 15.5H20" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" />
43
- <path d="M10 3.5L8 21.5" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" />
44
- <path d="M16 3.5L14 21.5" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" />
45
- </svg>
46
- <p class="menu-item-text">Tags</p>
47
- </a>
48
- <a class="menu-item" href="{{site.baseurl}}/feed.xml">
49
- <svg class="menu-item-icon" width="18" height="19" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
50
- <path d="M4 11.5C6.38695 11.5 8.67613 12.4482 10.364 14.136C12.0518 15.8239 13 18.1131 13 20.5"
51
- stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
52
- <path d="M4 4.5C8.24346 4.5 12.3131 6.18571 15.3137 9.18629C18.3143 12.1869 20 16.2565 20 20.5"
53
- stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
54
- <path
55
- d="M5 20.5C5.55228 20.5 6 20.0523 6 19.5C6 18.9477 5.55228 18.5 5 18.5C4.44772 18.5 4 18.9477 4 19.5C4 20.0523 4.44772 20.5 5 20.5Z"
56
- stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
57
- </svg>
58
- <p class="menu-item-text">RSS</p>
59
- </a>
46
+ </a>
47
+ <a class="menu-item" href="{{site.baseurl}}/tags">
48
+ <svg class="menu-item-icon" width="18" height="20" viewBox="0 0 25 25" fill="none"
49
+ xmlns="http://www.w3.org/2000/svg">
50
+ <path d="M4 9.5H20" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
51
+ <path d="M4 15.5H20" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
52
+ <path d="M10 3.5L8 21.5" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
53
+ <path d="M16 3.5L14 21.5" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
54
+ </svg>
55
+ <p class="menu-item-text">Tags</p>
56
+ </a>
57
+ <a class="menu-item" href="{{site.baseurl}}/feed.xml">
58
+ <svg class="menu-item-icon" width="18" height="20" viewBox="0 0 25 25" fill="none"
59
+ xmlns="http://www.w3.org/2000/svg">
60
+ <path d="M4 11.5C6.38695 11.5 8.67613 12.4482 10.364 14.136C12.0518 15.8239 13 18.1131 13 20.5"
61
+ stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
62
+ <path d="M4 4.5C8.24346 4.5 12.3131 6.18571 15.3137 9.18629C18.3143 12.1869 20 16.2565 20 20.5"
63
+ stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
64
+ <path
65
+ d="M5 20.5C5.55228 20.5 6 20.0523 6 19.5C6 18.9477 5.55228 18.5 5 18.5C4.44772 18.5 4 18.9477 4 19.5C4 20.0523 4.44772 20.5 5 20.5Z"
66
+ stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
67
+ </svg>
68
+ <p class="menu-item-text">RSS</p>
69
+ </a>
60
70
  <!-- TODO figure out a way to introuce dark and light mode toggle
61
71
  <a class="menu-item" href="{{page.url}}" onclick="modeSwitcher()" style="cursor: pointer;">
62
72
 
@@ -72,18 +82,21 @@
72
82
  </a>
73
83
  <script src="/assets/js/Light-Dark.js"></script>
74
84
  -->
75
- </div>
76
- {%- if site.preferences.search.enabled -%}
85
+ </div>
86
+ {%- if site.preferences.search.enabled -%}
77
87
  <div class="searchbar search-container">
78
- <svg class="search-icon" width="19" height="19" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
79
- <path d="M11.5 19.5C15.9183 19.5 19.5 15.9183 19.5 11.5C19.5 7.08172 15.9183 3.5 11.5 3.5C7.08172 3.5 3.5 7.08172 3.5 11.5C3.5 15.9183 7.08172 19.5 11.5 19.5Z" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
80
- <path d="M21.5 21.5L17.15 17.15" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
88
+ <svg class="search-icon" width="20" height="20" viewBox="0 0 25 25" fill="none"
89
+ xmlns="http://www.w3.org/2000/svg">
90
+ <path d="M11.5 19.5C15.9183 19.5 19.5 15.9183 19.5 11.5C19.5 7.08172 15.9183 3.5 11.5 3.5C7.08172 3.5 3.5 7.08172 3.5 11.5C3.5 15.9183 7.08172 19.5 11.5 19.5Z"
91
+ stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
92
+ <path d="M21.5 21.5L17.15 17.15" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
81
93
  </svg>
82
94
  <label for="search-input"></label>
83
- <input type="text" id="search-input" jsondata="{{site.baseurl}}/assets/js/SearchData.json" autocomplete="off" placeholder="Search {{site.heading}}..."/>
95
+ <input type="text" id="search-input" jsondata="{{site.baseurl}}/assets/js/SearchData.json" autocomplete="off"
96
+ placeholder="Search {{site.heading}}..."/>
84
97
  <div id="search-results" class="search-results"></div>
85
98
  </div>
86
99
  <script type="text/javascript" src="{{site.baseurl}}/assets/vendor/lunr/lunr.min.js"></script>
87
100
  <script src="{{site.baseurl}}/assets/js/Search.js"></script>
88
- {%- endif -%}
101
+ {%- endif -%}
89
102
  </header>
@@ -0,0 +1,19 @@
1
+ <article class="post feed-title-excerpt-block disable-select" data-url="{{site.baseurl}}{{post.url}}">
2
+ {% if post.thumbnail %}
3
+ <a class="post-thumbnail" style="background-image: url({{"" | prepend: site.baseurl | append :
4
+ post.thumbnail}})" href="{{post.url | prepend: site.baseurl}}"></a>
5
+ {% else %}
6
+ {% endif %}
7
+ <div class="post-content">
8
+ <h2 class="post-title"><a href="{{post.url | prepend: site.baseurl}}">{{post.title}}</a></h2>
9
+ {% case site.preferences.postpreview.text %}
10
+ {% when "content" %}
11
+ <p>{{ post.content | strip_html | truncatewords: 60 }}</p>
12
+ {% else %}
13
+ <p>{{ post.description | strip_html | truncatewords: 60 }}</p>
14
+ {% endcase %}
15
+ <span class="post-date">{{post.date | date: '%Y, %b %d'}}&nbsp;&nbsp;&nbsp;—&nbsp;</span>
16
+ <span class="post-words">{% capture words %}{{ post.content | number_of_words }}{% endcapture %}{% unless words contains "-" %}{{ words | plus: 250 | divided_by: 250 | append: " minute read" }}{% endunless %}</span>
17
+
18
+ </div>
19
+ </article>
data/_layouts/Home.html CHANGED
@@ -2,28 +2,16 @@
2
2
  layout: Page
3
3
  ---
4
4
  <div id="post-wrapper">
5
- {% for post in paginator.posts %}
6
- <article class="post feed-title-excerpt-block disable-select" data-url="{{site.baseurl}}{{post.url}}">
7
- {% if post.thumbnail %}
8
- <a class="post-thumbnail" style="background-image: url({{"" | prepend: site.baseurl | append : post.thumbnail}})" href="{{post.url | prepend: site.baseurl}}"></a>
9
- {% else %}
10
- {% endif %}
11
- <div class="post-content">
12
- <h2 class="post-title"><a href="{{post.url | prepend: site.baseurl}}">{{post.title}}</a></h2>
13
- <p>{{ post.content | strip_html | truncatewords: 60 }}</p>
14
- <span class="post-date">{{post.date | date: '%Y, %b %d'}}&nbsp;&nbsp;&nbsp;—&nbsp;</span>
15
- <span class="post-words">{% capture words %}{{ post.content | number_of_words }}{% endcapture %}{% unless words contains "-" %}{{ words | plus: 250 | divided_by: 250 | append: " minute read" }}{% endunless %}</span>
16
-
17
- </div>
18
- </article>
19
- {% endfor %}
5
+ {% for post in paginator.posts %}
6
+ {% include PostPreview.html %}
7
+ {% endfor %}
20
8
  </div>
21
9
 
22
10
  {% case site.preferences.pagination.system %}
23
- {% when "infinitescroll" %}
24
- {% include InfiniteScroll.html %}
25
- {% when "pagination" %}
26
- {% include Pagination.html %}
27
- {% else %}
28
- {% include InfiniteScroll.html %}
11
+ {% when "infinitescroll" %}
12
+ {% include InfiniteScroll.html %}
13
+ {% when "pagination" %}
14
+ {% include Pagination.html %}
15
+ {% else %}
16
+ {% include InfiniteScroll.html %}
29
17
  {% endcase %}
data/_layouts/Posts.html CHANGED
@@ -9,21 +9,7 @@ layout: Page
9
9
  {% for day in postsByDay %}
10
10
  <h2 id="{{ day.name }}">{{ day.name }}</h2>
11
11
  {% for post in day.items %}
12
- <article class="post feed-title-excerpt-block disable-select"
13
- data-url="{{site.baseurl}}{{post.url}}">
14
- {% if post.thumbnail %}
15
- <a class="post-thumbnail" style="background-image: url({{"" | prepend: site.baseurl | append :
16
- post.thumbnail}})" href="{{post.url | prepend: site.baseurl}}"></a>
17
- {% else %}
18
- {% endif %}
19
- <div class="post-content">
20
- <h2 class="post-title"><a href="{{post.url | prepend: site.baseurl}}">{{post.title}}</a></h2>
21
- <p>{{ post.content | strip_html | truncatewords: 60 }}</p>
22
- <span class="post-date">{{post.date | date: '%Y, %b %d'}}&nbsp;&nbsp;&nbsp;—&nbsp;</span>
23
- <span class="post-words">{% capture words %}{{ post.content | number_of_words }}{% endcapture %}{% unless words contains "-" %}{{ words | plus: 250 | divided_by: 250 | append: " minute read" }}{% endunless %}</span>
24
-
25
- </div>
26
- </article>
12
+ {% include PostPreview.html %}
27
13
  {% endfor %}
28
14
  {% endfor %}
29
15
 
data/_layouts/Tags.html CHANGED
@@ -19,23 +19,7 @@ layout: Page
19
19
  <h2 id="{{ this_word | cgi_escape }}">{{ this_word }}</h2>
20
20
  <!-- lists all posts corresponding to specific tag...-->
21
21
  {% for post in site.tags[this_word] %}{% if post.title != null %}
22
-
23
- <article class="post feed-title-excerpt-block disable-select"
24
- data-url="{{site.baseurl}}{{post.url}}">
25
- {% if post.thumbnail %}
26
- <a class="post-thumbnail" style="background-image: url({{"" | prepend: site.baseurl | append :
27
- post.thumbnail}})" href="{{post.url | prepend: site.baseurl}}"></a>
28
- {% else %}
29
- {% endif %}
30
- <div class="post-content">
31
- <h2 class="post-title"><a href="{{post.url | prepend: site.baseurl}}">{{post.title}}</a></h2>
32
- <p>{{ post.content | strip_html | truncatewords: 60 }}</p>
33
- <span class="post-date">{{post.date | date: '%Y, %b %d'}}&nbsp;&nbsp;&nbsp;—&nbsp;</span>
34
- <span class="post-words">{% capture words %}{{ post.content | number_of_words }}{% endcapture %}{% unless words contains "-" %}{{ words | plus: 250 | divided_by: 250 | append: " minute read" }}{% endunless %}</span>
35
-
36
- </div>
37
- </article>
38
-
22
+ {% include PostPreview.html %}
39
23
  {% endif %}{% endfor %}
40
24
  {% endfor %}
41
25
  </main>
@@ -19,18 +19,7 @@ layout: Page
19
19
  {% for tag in site.tags %}
20
20
  {%- if tag[0] == page.tutorial_tag -%}
21
21
  {% for post in tag[1] %}
22
- <article class="post feed-title-excerpt-block disable-select" data-url="{{site.baseurl}}{{post.url}}">
23
- {% if post.thumbnail %}
24
- <a class="post-thumbnail" style="background-image: url({{"" | prepend: site.baseurl | append : post.thumbnail}})" href="{{post.url | prepend: site.baseurl}}"></a>
25
- {% else %}
26
- {% endif %}
27
- <div class="post-content">
28
- <h2 class="post-title"><a href="{{post.url | prepend: site.baseurl}}">{{post.title}}</a></h2>
29
- <p>{{ post.content | strip_html | truncatewords: 60 }}</p>
30
- <span class="post-date">{{post.date | date: '%Y, %b %d'}}&nbsp;&nbsp;&nbsp;—&nbsp;</span>
31
- <span class="post-words">{% capture words %}{{ post.content | number_of_words }}{% endcapture %}{% unless words contains "-" %}{{ words | plus: 250 | divided_by: 250 | append: " minute read" }}{% endunless %}</span>
32
- </div>
33
- </article>
22
+ {% include PostPreview.html %}
34
23
  {% endfor %}
35
24
  {%- endif -%}
36
25
  {% endfor %}
@@ -2,19 +2,7 @@
2
2
  layout: Page
3
3
  ---
4
4
  <div id="post-wrapper">
5
- {% for tutorial in site.tutorials %}
6
- <article class="post feed-title-excerpt-block disable-select" data-url="{{site.baseurl}}{{tutorial.url}}">
7
- {% if tutorial.thumbnail %}
8
- <a class="post-thumbnail" style="background-image: url({{"" | prepend: site.baseurl | append : tutorial.thumbnail}})" href="{{tutorial.url | prepend: site.baseurl}}"></a>
9
- {% else %}
10
- {% endif %}
11
- <div class="post-content">
12
- <h2 class="post-title"><a href="{{tutorial.url | prepend: site.baseurl}}">{{tutorial.title}}</a></h2>
13
- <p>{{ tutorial.content | strip_html | truncatewords: 60 }}</p>
14
- <span class="post-date">{{tutorial.date | date: '%Y, %b %d'}}&nbsp;&nbsp;&nbsp;—&nbsp;</span>
15
- <span class="post-words">{% capture words %}{{ tutorial.content | number_of_words }}{% endcapture %}{% unless words contains "-" %}{{ words | plus: 250 | divided_by: 250 | append: " minute read" }}{% endunless %}</span>
16
-
17
- </div>
18
- </article>
5
+ {% for post in site.tutorials %}
6
+ {% include PostPreview.html %}
19
7
  {% endfor %}
20
8
  </div>
data/assets/js/Search.js CHANGED
@@ -82,6 +82,7 @@
82
82
  var index = lunr(function(){
83
83
  this.ref('id');
84
84
  this.field('title', {boost: 200});
85
+ this.field('description', {boost: 100});
85
86
  this.field('content', {boost: 2});
86
87
  this.field('url');
87
88
  this.metadataWhitelist = ['position']
@@ -90,6 +91,7 @@
90
91
  this.add({
91
92
  id: i,
92
93
  title: docs[i].title,
94
+ description: docs[i].description,
93
95
  content: docs[i].content,
94
96
  url: docs[i].url
95
97
  });
@@ -234,6 +236,7 @@
234
236
 
235
237
  var metadata = result.matchData.metadata;
236
238
  var titlePositions = [];
239
+ var descriptionPositions = [];
237
240
  var contentPositions = [];
238
241
  for (var j in metadata) {
239
242
  var meta = metadata[j];
@@ -243,7 +246,53 @@
243
246
  titlePositions.push(positions[k]);
244
247
  }
245
248
  }
249
+ if (meta.description) {
250
+ var positions = meta.description.position;
251
+ for(var k in positions) {
252
+ var position = positions[k];
253
+ var previewStart = position[0];
254
+ var previewEnd = position[0] + position[1];
255
+ var ellipsesBefore = true;
256
+ var ellipsesAfter = true;
257
+ for (var k = 0; k < 3; k++) {
258
+ var nextSpace = doc.description.lastIndexOf(' ', previewStart - 2);
259
+ var nextDot = doc.description.lastIndexOf('. ', previewStart - 2);
260
+ if ((nextDot >= 0) && (nextDot > nextSpace)) {
261
+ previewStart = nextDot + 1;
262
+ ellipsesBefore = false;
263
+ break;
264
+ }
265
+ if (nextSpace < 0) {
266
+ previewStart = 0;
267
+ ellipsesBefore = false;
268
+ break;
269
+ }
270
+ previewStart = nextSpace + 1;
271
+ }
272
+
273
+ for (var k = 0; k < 3; k++) {
274
+ var nextSpace = doc.description.indexOf(' ', previewEnd + 1);
275
+ var nextDot = doc.description.indexOf('. ', previewEnd + 1);
276
+ if ((nextDot >= 0) && (nextDot < nextSpace)) {
277
+ previewEnd = nextDot;
278
+ ellipsesAfter = false;
279
+ break;
280
+ }
281
+ if (nextSpace < 0) {
282
+ previewEnd = doc.description.length;
283
+ ellipsesAfter = false;
284
+ break;
285
+ }
286
+ previewEnd = nextSpace;
287
+ }
246
288
 
289
+ descriptionPositions.push({
290
+ highlight: position,
291
+ previewStart: previewStart, previewEnd: previewEnd,
292
+ ellipsesBefore: ellipsesBefore, ellipsesAfter: ellipsesAfter
293
+ });
294
+ }
295
+ }
247
296
  if (meta.content) {
248
297
  var positions = meta.content.position;
249
298
  for(var k in positions) {
@@ -297,7 +346,52 @@
297
346
  resultDocOrSection.innerHTML = '';
298
347
  addHighlightedText(resultDocOrSection, doc.title, 0, doc.title.length, titlePositions);
299
348
  }
349
+ if (descriptionPositions.length > 0) {
350
+ descriptionPositions.sort(function(p1, p2){ return p1.highlight[0] - p2.highlight[0] });
351
+ var descriptionPosition = descriptionPositions[0];
352
+ var previewPosition = {
353
+ highlight: [descriptionPosition.highlight],
354
+ previewStart: descriptionPosition.previewStart, previewEnd: descriptionPosition.previewEnd,
355
+ ellipsesBefore: descriptionPosition.ellipsesBefore, ellipsesAfter: descriptionPosition.ellipsesAfter
356
+ };
357
+ var previewPositions = [previewPosition];
358
+ for (var j = 1; j < descriptionPositions.length; j++) {
359
+ descriptionPosition = descriptionPositions[j];
360
+ if (previewPosition.previewEnd < descriptionPosition.previewStart) {
361
+ previewPosition = {
362
+ highlight: [descriptionPosition.highlight],
363
+ previewStart: descriptionPosition.previewStart, previewEnd: descriptionPosition.previewEnd,
364
+ ellipsesBefore: descriptionPosition.ellipsesBefore, ellipsesAfter: descriptionPosition.ellipsesAfter
365
+ }
366
+ previewPositions.push(previewPosition);
367
+ } else {
368
+ previewPosition.highlight.push(descriptionPosition.highlight);
369
+ previewPosition.previewEnd = descriptionPosition.previewEnd;
370
+ previewPosition.ellipsesAfter = descriptionPosition.ellipsesAfter;
371
+ }
372
+ }
300
373
 
374
+ var resultPreviews = document.createElement('div');
375
+ resultPreviews.classList.add('search-result-previews');
376
+ resultLink.appendChild(resultPreviews);
377
+
378
+ var description = doc.description;
379
+
380
+ for (var j = 0; j < Math.min(previewPositions.length, 2); j++) {
381
+ var position = previewPositions[j];
382
+ var resultPreview = document.createElement('div');
383
+ resultPreview.classList.add('search-result-preview');
384
+ resultPreviews.appendChild(resultPreview);
385
+
386
+ if (position.ellipsesBefore) {
387
+ resultPreview.appendChild(document.createTextNode('... '));
388
+ }
389
+ addHighlightedText(resultPreview, description, position.previewStart, position.previewEnd, position.highlight);
390
+ if (position.ellipsesAfter) {
391
+ resultPreview.appendChild(document.createTextNode(' ...'));
392
+ }
393
+ }
394
+ }
301
395
  if (contentPositions.length > 0) {
302
396
  contentPositions.sort(function(p1, p2){ return p1.highlight[0] - p2.highlight[0] });
303
397
  var contentPosition = contentPositions[0];
@@ -9,6 +9,7 @@ permalink: /assets/js/SearchData.json
9
9
  "{{ i }}": {
10
10
  "doc": {{ post.title | strip_html | escape | jsonify }},
11
11
  "title": {{ post.title | strip_html | escape | jsonify }},
12
+ "description": {{ post.description | strip_html | escape | jsonify }},
12
13
  "content": {{ post.content | replace: '</h', ' . </h' | replace: '<hr', ' . <hr' | replace: '</p', ' . </p' | replace: '<ul', ' . <ul' | replace: '</ul', ' . </ul' | replace: '<ol', ' . <ol' | replace: '</ol', ' . </ol' | replace: '</tr', ' . </tr' | replace: '<li', ' | <li' | replace: '</li', ' | </li' | replace: '</td', ' | </td' | replace: '<td', ' | <td' | replace: '</th', ' | </th' | replace: '<th', ' | <th' | strip_html | remove: 'Table of contents' | normalize_whitespace | replace: '. . .', '.' | replace: '. .', '.' | replace: '| |', '|' | append: ' ' | strip_html | strip_newline | strip | escape | jsonify }},
13
14
  "url": "{{ site.baseurl }}{{ post.url }}"
14
15
  }{%- unless forloop.last -%},{%- endunless -%}{%- assign i = i | plus: 1 -%}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: domain-jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lumunix
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-03 00:00:00.000000000 Z
11
+ date: 2024-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: webrick
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 2.2.24
117
+ version: 2.3.25
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 2.2.24
124
+ version: 2.3.25
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rake
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -161,6 +161,7 @@ files:
161
161
  - _includes/InfiniteScroll.html
162
162
  - _includes/LinkLibrary.md
163
163
  - _includes/Pagination.html
164
+ - _includes/PostPreview.html
164
165
  - _includes/PreviousNext.html
165
166
  - _includes/Related.html
166
167
  - _includes/TwitterEmbed.html