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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90842b8c25e6e779765d4f355554c7c2ca77a1155126a8c1a2b548aa97ccc4a4
4
- data.tar.gz: ab63f574b2b54c7830dfb1c93d1bf224691892a182ff5f2dbde2a9313d0d329a
3
+ metadata.gz: bc0013160324ede5cb466edbee194721083c8b13180a80073ee2d60d62fc0286
4
+ data.tar.gz: 00f52fe4c30bf5549d8ba5bd3b7e61648302f71c29be121464db3b78a205f389
5
5
  SHA512:
6
- metadata.gz: a2badc9ec752b5fb1b39b84e795f4a60099f072c800df358d28817949423f09fecc20690d9d365cc83c58f9e87fe6e9decc2de4c114a9566b88cf3c6d1b09a77
7
- data.tar.gz: 48675c074d4386a1d8ef7aec90ad610114a8702e167d012b780ef2062fa0c6aa782515b59b20a04fd5d8e30372dbebe0e5b20be718088a027f3f8b0ff8e5a87d
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
  [![GitHub License](https://img.shields.io/github/license/jekyll-is/jekyll-is-announcer)](LICENSE)
7
- [![Gem Version](https://badge.fury.io/rb/jekyll-is-announcer.svg?icon=si%3Arubygems&d=2)](https://badge.fury.io/rb/jekyll-is-announcer)
7
+ [![Gem Version](https://badge.fury.io/rb/jekyll-is-announcer.svg?icon=si%3Arubygems&d=3)](https://badge.fury.io/rb/jekyll-is-announcer)
8
8
  [![Ruby](https://github.com/jekyll-is/jekyll-is-announcer/actions/workflows/ruby.yml/badge.svg)](https://github.com/jekyll-is/jekyll-is-announcer/actions/workflows/ruby.yml)
9
9
  ![Coverage](coverage-badge.svg)
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
- link.href = data[key];
22
- elem.style.display = '';
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 => {
@@ -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
  "",
@@ -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}'><a href='#' target='_blank' title='#{title}'>#{caption}</a></div>"
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-is-announcer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Shikhalev