jekyll-is-announcer 0.8.1 → 0.8.3
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/README.md +2 -2
- data/assets/announcer.js +21 -5
- data/bin/jekyll-is-announcer +1 -2
- data/lib/jekyll-is/marker.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bc0013160324ede5cb466edbee194721083c8b13180a80073ee2d60d62fc0286
|
|
4
|
+
data.tar.gz: 00f52fe4c30bf5549d8ba5bd3b7e61648302f71c29be121464db3b78a205f389
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fe76bcb12491f6953f99f3f8540cb08a82887f108aa7a6ee56145aa335e3904e6da373e66ce66f31468ee6297ff56af6da12c7fe1876aa15967b3aa8e9de693d
|
|
7
|
+
data.tar.gz: 70d97e3ecf7c6a3aa5e6afe178d6302a41bbbba24f72cf510dc0f404f654eab40e0d88ffbf5f0b3967f899f6b3e55c2da2a3abae442662b214ff40d638e6051a
|
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# jekyll-is-announcer
|
|
5
5
|
|
|
6
6
|
[](LICENSE)
|
|
7
|
-
[](https://badge.fury.io/rb/jekyll-is-announcer)
|
|
8
8
|
[](https://github.com/jekyll-is/jekyll-is-announcer/actions/workflows/ruby.yml)
|
|
9
9
|

|
|
10
10
|
|
|
@@ -87,7 +87,7 @@ rake spec
|
|
|
87
87
|
|
|
88
88
|
## License
|
|
89
89
|
|
|
90
|
-
This project is licensed under the GPL-3.0-or-later License.
|
|
90
|
+
This project is licensed under the [GPL-3.0-or-later License](LICENSE).
|
|
91
91
|
|
|
92
92
|
## Links
|
|
93
93
|
|
data/assets/announcer.js
CHANGED
|
@@ -16,11 +16,27 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
16
16
|
console.log({key: key})
|
|
17
17
|
if (!key || !(key in data)) return;
|
|
18
18
|
|
|
19
|
-
const link = elem.querySelector('a');
|
|
20
|
-
if (link) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
19
|
+
// const link = elem.querySelector('a');
|
|
20
|
+
// if (link) {
|
|
21
|
+
// link.href = data[key];
|
|
22
|
+
// elem.style.display = '';
|
|
23
|
+
// }
|
|
24
|
+
const match = data[key].match(/t\.me\/(.+)/);
|
|
25
|
+
console.log({match:match})
|
|
26
|
+
const discussion = match ? match[1] : null; // "shikhalev_blog/66"
|
|
27
|
+
console.log({discussion:discussion});
|
|
28
|
+
|
|
29
|
+
const script = document.createElement('script');
|
|
30
|
+
script.async = true;
|
|
31
|
+
script.src = 'https://telegram.org/js/telegram-widget.js?22';
|
|
32
|
+
script.setAttribute('data-telegram-discussion', discussion);
|
|
33
|
+
script.setAttribute('data-comments-limit', '5');
|
|
34
|
+
script.setAttribute('data-width', '100%');
|
|
35
|
+
script.setAttribute('data-dark', '0');
|
|
36
|
+
script.setAttribute('data-color', '#3e5662');
|
|
37
|
+
elem.appendChild(script);
|
|
38
|
+
elem.style.display = '';
|
|
39
|
+
console.log({Telegram:Telegram});
|
|
24
40
|
});
|
|
25
41
|
})
|
|
26
42
|
.catch(error => {
|
data/bin/jekyll-is-announcer
CHANGED
|
@@ -62,8 +62,7 @@ module AnnouncerBin
|
|
|
62
62
|
|
|
63
63
|
def telegram_message post
|
|
64
64
|
[
|
|
65
|
-
"*[#{telegram_escape(post['title'])}](#{post['url']})*",
|
|
66
|
-
"#{telegram_escape(post['date'])}",
|
|
65
|
+
"*[#{telegram_escape(post['title'])}](#{post['url']})* #{telegram_escape('|')} _#{telegram_escape(post['date'])}_",
|
|
67
66
|
"",
|
|
68
67
|
telegram_escape(post['description']),
|
|
69
68
|
"",
|
data/lib/jekyll-is/marker.rb
CHANGED
|
@@ -23,7 +23,7 @@ module JekyllIS
|
|
|
23
23
|
caption = @params[:caption] || @params[:title]
|
|
24
24
|
page = context.registers[:page]
|
|
25
25
|
key = page['path']
|
|
26
|
-
result = "<div markdown='span' class='announcer-block announcer-channel-#{channel}' style='display:none;' data-key='#{key}' data-channel='#{channel}'
|
|
26
|
+
result = "<div markdown='span' class='announcer-block announcer-channel-#{channel}' style='display:none;' data-key='#{key}' data-channel='#{channel}'></div>"
|
|
27
27
|
result += "\n<script src='/js/announcer.js'></script>" if once?(key)
|
|
28
28
|
result
|
|
29
29
|
end
|