jekyll-theme-amethyst 2.0.0 → 2.1.0
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 +4 -4
- data/_includes/author-text.html +6 -0
- data/_includes/opengraph.html +6 -1
- data/_includes/search.html +22 -0
- data/_includes/sidebar.html +2 -0
- data/_layouts/post.html +6 -1
- data/_layouts/posts-tag.html +1 -1
- data/_layouts/posts-year.html +1 -1
- data/_layouts/posts.html +1 -1
- data/_sass/typesense-minibar.css +6 -8
- data/assets/typesense-minibar.js +9 -6
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fac70f56f1769603d1d784c69d33c9fa40b9a200ef8eee0a8d126eb5c8178b1
|
4
|
+
data.tar.gz: a59c9b8182e67c571ac5ef59488eef8dec691bec4f802ee966876cd1a0d33770
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd6693f94f8f0c67f85dce79533fc0ac9b6fcc95d96e2cb3ec06afb60745e42c1b1f270c0fb27b6dd0361b6278383346a3e69f2f1a98cf2d94c81ed9bf0baeca
|
7
|
+
data.tar.gz: 31ac837f404e4c5d2592b9c0034038f02db666c7c9de294002a8aaf73ba89b1e11d13adfc1554c558e55a1c5d7837c055ea2e88a11ea79a4575c5cce87749bc1
|
data/_includes/opengraph.html
CHANGED
@@ -45,11 +45,16 @@
|
|
45
45
|
{% endif %}
|
46
46
|
<meta name="twitter:card" content="summary_large_image">
|
47
47
|
|
48
|
-
|
49
48
|
{% if layout.amethyst.pagetype == "navigation" %}
|
50
49
|
<meta name="robots" content="{{ page.amethyst.robots | default: layout.amethyst.robots | default: 'noindex,follow' }}">
|
51
50
|
<meta name="docsearch:amethyst_pagetype_navigation" content="1">
|
52
51
|
{% endif %}
|
53
52
|
|
53
|
+
{% if page.layout == "post" and page.date and page.author %}
|
54
|
+
<meta property="og:type" content="article">
|
55
|
+
<meta property="article:published_time" content="{{ page.date | date_to_xmlschema }}">
|
56
|
+
<meta name="author" content="{% include author-text.html author=page.author %}">
|
57
|
+
{% endif %}
|
58
|
+
|
54
59
|
{% endcapture -%}
|
55
60
|
{{ opengraph | strip_newlines }}
|
data/_includes/search.html
CHANGED
@@ -4,3 +4,25 @@
|
|
4
4
|
<input type="hidden" name="sites" value="{{ site.url | remove_first: 'http://' | remove_first: 'https://' }}">
|
5
5
|
</form>
|
6
6
|
</typesense-minibar>
|
7
|
+
{%- if jekyll.environment == "development" %}
|
8
|
+
<script type="module">
|
9
|
+
/* global Response, URL */
|
10
|
+
// Override URLs in search results to be relative to localhost,
|
11
|
+
// by replacing "https://production.example/path" with "/path",
|
12
|
+
// in any responses that look like they are from Typesense.
|
13
|
+
const parent = Response.prototype.json;
|
14
|
+
Response.prototype.json = function () {
|
15
|
+
return parent.call(this).then(function (obj) {
|
16
|
+
if (obj && obj.grouped_hits) {
|
17
|
+
for (const group of obj.grouped_hits) {
|
18
|
+
for (const hit of group.hits) {
|
19
|
+
const url = new URL(hit.document.url);
|
20
|
+
hit.document.url = url.pathname + url.hash;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
return obj;
|
25
|
+
});
|
26
|
+
};
|
27
|
+
</script>
|
28
|
+
{%- endif %}
|
data/_includes/sidebar.html
CHANGED
@@ -65,6 +65,8 @@ Block data:
|
|
65
65
|
{%- assign block_contents = site.posts | slice: 0, 5 -%}
|
66
66
|
{%- elsif block_type == "archive" -%}
|
67
67
|
{%- assign block_contents = site.pages | where: "layout", "posts-year" | sort_natural: 'date' | reverse -%}
|
68
|
+
{%- assign group_page = site.pages | where: "layout", "posts-archive" | first -%}
|
69
|
+
{%- assign block_url = block.url | default: group_page.url -%}
|
68
70
|
{%- elsif block_type == "tags" -%}
|
69
71
|
{%- assign block_contents = site.pages | where: "layout", "posts-tag" | sort_natural: 'title' -%}
|
70
72
|
{%- elsif block_type == "link" -%}
|
data/_layouts/post.html
CHANGED
@@ -8,7 +8,12 @@ layout: wrapper
|
|
8
8
|
<header>
|
9
9
|
<h1>{{ page.title | escape }}</h1>
|
10
10
|
{%- assign date_format = site.amethyst.date_format | default: "%e %B %Y" -%}
|
11
|
-
<p class="post-meta byline">Posted on <a href="{{ page.url | relative_url }}" rel="bookmark"><time itemprop="pubdate" datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: date_format }}</time></a>{% if page.author %} by <span class="vcard"><span class="fn n" rel="author">
|
11
|
+
<p class="post-meta byline">Posted on <a href="{{ page.url | relative_url }}" rel="bookmark"><time itemprop="pubdate" datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: date_format }}</time></a>{% if page.author %} by <span class="vcard"><span class="fn n" rel="author">
|
12
|
+
{%- assign author_page = site.pages | where: "layout", "posts-author" | where: "author", page.author | first -%}
|
13
|
+
{%- if author_page -%}
|
14
|
+
<a href="{{ author_page.url | relative_url }}">{{ author_page.title | escape }}</a>
|
15
|
+
{%- else -%}{{ page.author | escape }}
|
16
|
+
{%- endif -%}</span></span>{% endif %}</p>
|
12
17
|
</header>
|
13
18
|
{{ content }}
|
14
19
|
</article>
|
data/_layouts/posts-tag.html
CHANGED
@@ -12,7 +12,7 @@ amethyst:
|
|
12
12
|
{%- for post in posts -%}
|
13
13
|
<div class="post-row">
|
14
14
|
<h2><a href="{{ post.url | relative_url }}">{{ post.title | escape }}</a></h2>
|
15
|
-
<p class="post-meta">Posted on <time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: date_format }}</time>{% if post.author %} by {
|
15
|
+
<p class="post-meta">Posted on <time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: date_format }}</time>{% if post.author %} by {% include author-text.html author=post.author %}{% endif %}</p>
|
16
16
|
<div class="post">
|
17
17
|
{{- post.excerpt -}}
|
18
18
|
{%- if post.excerpt != post.content %}
|
data/_layouts/posts-year.html
CHANGED
@@ -12,7 +12,7 @@ amethyst:
|
|
12
12
|
{%- for post in posts -%}
|
13
13
|
<div class="post-row">
|
14
14
|
<h2><a href="{{ post.url | relative_url }}">{{ post.title | escape }}</a></h2>
|
15
|
-
<p class="post-meta">Posted on <time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: date_format }}</time>{% if post.author %} by {
|
15
|
+
<p class="post-meta">Posted on <time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: date_format }}</time>{% if post.author %} by {% include author-text.html author=post.author %}{% endif %}</p>
|
16
16
|
<div class="post">
|
17
17
|
{{- post.excerpt -}}
|
18
18
|
{%- if post.excerpt != post.content %}
|
data/_layouts/posts.html
CHANGED
@@ -13,7 +13,7 @@ amethyst:
|
|
13
13
|
{% for post in posts -%}
|
14
14
|
<div class="post-row">
|
15
15
|
<h2><a href="{{ post.url | relative_url }}">{{ post.title | escape }}</a></h2>
|
16
|
-
<p class="post-meta">Posted on <time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: date_format }}</time>{% if post.author %} by {
|
16
|
+
<p class="post-meta">Posted on <time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: date_format }}</time>{% if post.author %} by {% include author-text.html author=post.author %}{% endif %}</p>
|
17
17
|
<div class="post">
|
18
18
|
{{- post.excerpt -}}
|
19
19
|
{%- if post.excerpt != post.content %}
|
data/_sass/typesense-minibar.css
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! https://github.com/jquery/typesense-minibar 1.3.
|
1
|
+
/*! https://github.com/jquery/typesense-minibar 1.3.4 */
|
2
2
|
.tsmb-form,
|
3
3
|
typesense-minibar {
|
4
4
|
--tsmb-size-edge: 1px;
|
@@ -24,6 +24,8 @@ typesense-minibar {
|
|
24
24
|
--tsmb-color-primary30: #390f39;
|
25
25
|
--tsmb-color-primary50: #9c3493;
|
26
26
|
--tsmb-color-primary90: #fbdbfb;
|
27
|
+
|
28
|
+
max-width: 100%;
|
27
29
|
}
|
28
30
|
|
29
31
|
.tsmb-form,
|
@@ -88,7 +90,7 @@ typesense-minibar form::before {
|
|
88
90
|
content: '';
|
89
91
|
background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='654 -372 1664 1664' width='20' height='20'><path d='M1806,332c0-123.3-43.8-228.8-131.5-316.5C1586.8-72.2,1481.3-116,1358-116s-228.8,43.8-316.5,131.5 C953.8,103.2,910,208.7,910,332s43.8,228.8,131.5,316.5C1129.2,736.2,1234.7,780,1358,780s228.8-43.8,316.5-131.5 C1762.2,560.8,1806,455.3,1806,332z M2318,1164c0,34.7-12.7,64.7-38,90s-55.3,38-90,38c-36,0-66-12.7-90-38l-343-342 c-119.3,82.7-252.3,124-399,124c-95.3,0-186.5-18.5-273.5-55.5s-162-87-225-150s-113-138-150-225S654,427.3,654,332 s18.5-186.5,55.5-273.5s87-162,150-225s138-113,225-150S1262.7-372,1358-372s186.5,18.5,273.5,55.5s162,87,225,150s113,138,150,225 S2062,236.7,2062,332c0,146.7-41.3,279.7-124,399l343,343C2305.7,1098.7,2318,1128.7,2318,1164z'/></svg>") 0 50% / contain no-repeat;
|
90
92
|
position: absolute;
|
91
|
-
top: calc(var(--tsmb-size-
|
93
|
+
top: calc(var(--tsmb-size-edge) + var(--tsmb-size-sm));
|
92
94
|
left: var(--tsmb-size-sm);
|
93
95
|
width: var(--tsmb-size-base);
|
94
96
|
height: var(--tsmb-size-input);
|
@@ -104,7 +106,7 @@ typesense-minibar form::before {
|
|
104
106
|
.tsmb-icon-close {
|
105
107
|
box-sizing: border-box;
|
106
108
|
position: absolute;
|
107
|
-
top: calc(
|
109
|
+
top: calc(var(--tsmb-size-edge) + var(--tsmb-size-sm) + (var(--tsmb-size-input)/2) - (var(--tsmb-size-base)/2));
|
108
110
|
right: var(--tsmb-size-base);
|
109
111
|
width: var(--tsmb-size-base);
|
110
112
|
height: var(--tsmb-size-base);
|
@@ -115,11 +117,7 @@ typesense-minibar form::before {
|
|
115
117
|
cursor: pointer;
|
116
118
|
}
|
117
119
|
|
118
|
-
.tsmb-form--open .tsmb-icon-close {
|
119
|
-
display: block !important;
|
120
|
-
}
|
121
|
-
|
122
|
-
.tsmb-form--slash::after {
|
120
|
+
form:not(.tsmb-form--open) .tsmb-icon-close {
|
123
121
|
display: none;
|
124
122
|
}
|
125
123
|
|
data/assets/typesense-minibar.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! https://github.com/jquery/typesense-minibar 1.3.
|
1
|
+
/*! https://github.com/jquery/typesense-minibar 1.3.4 */
|
2
2
|
globalThis.tsminibar = function tsminibar (form, dataset = form.dataset) {
|
3
3
|
const cache = new Map();
|
4
4
|
const state = { query: '', cursor: -1, open: false, hits: [] };
|
@@ -41,7 +41,6 @@ globalThis.tsminibar = function tsminibar (form, dataset = form.dataset) {
|
|
41
41
|
const query = state.query = input.value;
|
42
42
|
if (!query) {
|
43
43
|
state.hits = [];
|
44
|
-
state.cursor = -1;
|
45
44
|
return close();
|
46
45
|
}
|
47
46
|
const hits = await search(query);
|
@@ -62,7 +61,10 @@ globalThis.tsminibar = function tsminibar (form, dataset = form.dataset) {
|
|
62
61
|
if (!e.altKey && !e.ctrlKey && !e.metaKey && !e.shiftKey) {
|
63
62
|
if (e.code === 'ArrowDown') moveCursor(1);
|
64
63
|
if (e.code === 'ArrowUp') moveCursor(-1);
|
65
|
-
if (e.code === 'Escape')
|
64
|
+
if (e.code === 'Escape') {
|
65
|
+
close();
|
66
|
+
input.blur();
|
67
|
+
}
|
66
68
|
if (e.code === 'Enter') {
|
67
69
|
const url = state.hits[state.cursor]?.url;
|
68
70
|
if (url) location.href = url;
|
@@ -72,11 +74,12 @@ globalThis.tsminibar = function tsminibar (form, dataset = form.dataset) {
|
|
72
74
|
form.addEventListener('submit', function (e) {
|
73
75
|
e.preventDefault();
|
74
76
|
});
|
75
|
-
form.insertAdjacentHTML('beforeend', '<svg viewBox="0 0 12 12" width="20" height="20" aria-hidden="true" class="tsmb-icon-close"
|
77
|
+
form.insertAdjacentHTML('beforeend', '<svg viewBox="0 0 12 12" width="20" height="20" aria-hidden="true" tabindex="-1" class="tsmb-icon-close"><path d="M9 3L3 9M3 3L9 9"/></svg>');
|
76
78
|
form.querySelector('.tsmb-icon-close').addEventListener('click', function () {
|
77
79
|
input.value = '';
|
78
|
-
|
80
|
+
state.hits = [];
|
79
81
|
close();
|
82
|
+
input.focus();
|
80
83
|
});
|
81
84
|
connect();
|
82
85
|
|
@@ -117,7 +120,7 @@ globalThis.tsminibar = function tsminibar (form, dataset = form.dataset) {
|
|
117
120
|
let hits = cache.get(query);
|
118
121
|
if (hits) {
|
119
122
|
cache.delete(query);
|
120
|
-
cache.set(query, hits);
|
123
|
+
cache.set(query, hits);
|
121
124
|
return hits;
|
122
125
|
}
|
123
126
|
searchParams.set('q', query);
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-theme-amethyst
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Timo Tijhof
|
@@ -108,6 +108,7 @@ extensions: []
|
|
108
108
|
extra_rdoc_files: []
|
109
109
|
files:
|
110
110
|
- LICENSE.txt
|
111
|
+
- _includes/author-text.html
|
111
112
|
- _includes/opengraph.html
|
112
113
|
- _includes/search.html
|
113
114
|
- _includes/sidebar.html
|