sutty-liquid 0.11.8 → 0.11.10

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: 005f13997c80e7efd7531e01b6b9930170a44257f66d84341eac89a4fcd45a80
4
- data.tar.gz: fda89eabf3827a20dffb15d6810584518d34ce3220240d1aebe261b7b0d8e1da
3
+ metadata.gz: fba1853523b93af55680f644925766c5c9cfd854f6996bbdd00fafb70e862e23
4
+ data.tar.gz: 4ec3a5e3dc511986af1d16164cf0721757d7e27eb6ca53e68355e6f6c5ab64a4
5
5
  SHA512:
6
- metadata.gz: 8914beb3a0d74b05eb457667a0494fab11536402dccdc43d0144ca1bf0cef237c7847a34260544bb841c2f058119bb1d946a6b49b1c36c0e1699ededd98af5e5
7
- data.tar.gz: 5c14dcf202998dd5c5374d32831e856b815f6a126c06e9a6ebdfb493e79fade16ec1d8a5c9e945ddf28d8c057e96eb414896e37b2ff961bd66775cb7fa2ce6bc
6
+ metadata.gz: f0ef54e2c33877298ed41a0407a548db72e88a11a741b3e864349db5bd207b4c516a8b036000a94a7e5f39b8280c8ed5289f564eb26391604664e11330a4a8ad
7
+ data.tar.gz: b50a357164919a2cff26993e4bdcc6d1e416a2ef3d6c2e1c638b03b1473dcfc388dd4dec5b19424d615a62797b99deff077e799670291e552c05e0defaa13a1a
@@ -4,9 +4,11 @@ module Jekyll
4
4
  module Filters
5
5
  module SocialNetwork
6
6
  MASTODON = %r{\A/@\w+\z}.freeze
7
+ NON_MASTODON = %w[youtube.com tiktok.com]
7
8
  SUBDOMAINS = /\A(www|chat)\./.freeze
8
9
  DOMAIN_MAP = {
9
- 't.me' => 'telegram'
10
+ 't.me' => 'telegram',
11
+ 'youtu.be' => 'youtube'
10
12
  }.freeze
11
13
 
12
14
  # Takes a URL and returns a Hash of attributes, useful when you
@@ -29,10 +31,10 @@ module Jekyll
29
31
  require 'uri'
30
32
 
31
33
  uri = URI url
32
- host = uri.host.sub SUBDOMAINS, ''
34
+ host = uri.host = uri.host.sub SUBDOMAINS, ''
33
35
 
34
36
  name = DOMAIN_MAP[host]
35
- name ||= MASTODON =~ uri.path ? 'mastodon' : host.split('.', 2).first
37
+ name ||= mastodon?(uri) ? 'mastodon' : host.split('.', 2).first
36
38
  rescue ArgumentError, URI::InvalidURIError => e
37
39
  Jekyll.logger.warn(e.message) if Jekyll.respond_to?(:logger)
38
40
  ensure
@@ -42,6 +44,15 @@ module Jekyll
42
44
 
43
45
  { 'host' => host, 'name' => name, 'url' => url }.to_liquid
44
46
  end
47
+
48
+ private
49
+
50
+ # Other social networks use @username on the URL too
51
+ def mastodon?(uri)
52
+ return false if NON_MASTODON.include? uri.host
53
+
54
+ MASTODON =~ uri.path
55
+ end
45
56
  end
46
57
  end
47
58
  end
@@ -33,6 +33,8 @@ module Jekyll
33
33
  escape ? v.dump : v
34
34
  end
35
35
 
36
+ next if values.empty?
37
+
36
38
  "$#{key}: (#{values.join(',')},);"
37
39
  when Hash
38
40
  values =
@@ -43,7 +45,9 @@ module Jekyll
43
45
  v = v.dump if escape
44
46
 
45
47
  "\"#{key_to_scss k}\": #{v}"
46
- end
48
+ end.compact
49
+
50
+ next if values.empty?
47
51
 
48
52
  "$#{key}: (#{values.join(',')},);"
49
53
  else
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sutty-liquid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.8
4
+ version: 0.11.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - f
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-25 00:00:00.000000000 Z
11
+ date: 2023-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fast_blank