sutty-liquid 0.11.9 → 0.11.11

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: 826036049df482d444af15363115c28ce7579d4b7b27a36e49920d0f0a16c847
4
- data.tar.gz: 5833fd35d35edd7a8a52e01d1dd2359711850ab18364ff2fdfc3d91572221125
3
+ metadata.gz: 5ca43cd75c57125b94b8d71af53757b6306d08796b9f87af9b66157b41905da2
4
+ data.tar.gz: f2a046fe29dfceec6a1dddaad71e786a7d4d4927d6a5d0a6c1895fba375d21aa
5
5
  SHA512:
6
- metadata.gz: 2a914998a6bb48bb42a68454243e4bddd2ee770fd83a6d74237355818eeb77c206fc01493aca6fb4e05b01577737674ccf0c753487aeeafdd9af29e8d6293c87
7
- data.tar.gz: f1377c21ae1ba9cfdec71a99ba29e092e8b753cc0a7536b087cdf33adffaa0533dc03b7f5c52a38e5db355c27cab93fe8155533daec43c4fe20c9d19945713e9
6
+ metadata.gz: 20ddf226b830c0e9e35ad65f48d3a93a77f17d8d545b377f424e982ee337d12bd9408f85e39faec7e450d59605a9a591726dcfe09df086632e394684256e120b
7
+ data.tar.gz: 754358ed50d27d60584b22ebddfeaa4e1d3d36762c8b244f2a69bdae2b209af77ef8894cdf7d789019ffa0b650305bf7f24d280812deca313ed6ab3423cf2d7f
@@ -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
@@ -9,6 +9,10 @@ module Jekyll
9
9
  #
10
10
  # Optionally give it an schema to filter out keys.
11
11
  #
12
+ # You can add an array of keys to remove from the schema on
13
+ # _config.yml, so if you're using a post to get an schema from,
14
+ # some values don't end up on the SASS/SCSS file.
15
+ #
12
16
  # @param :yaml [Hash,Jekyll::Drops::DocumentDrop]
13
17
  # @param :schema [Hash]
14
18
  # @return [String]
@@ -21,7 +25,15 @@ module Jekyll
21
25
  return yaml
22
26
  end
23
27
 
24
- yaml.slice(*schema.keys).map do |key, value|
28
+ site = @context.registers[:site]
29
+ keys = schema.keys
30
+ reject_keys = site.config.dig('liquid', 'yaml_to_scss', 'reject_keys')
31
+
32
+ if reject_keys.is_a?(Array) && !reject_keys.empty?
33
+ keys = keys - reject_keys
34
+ end
35
+
36
+ yaml.slice(*keys).map do |key, value|
25
37
  next if value.nil?
26
38
 
27
39
  escape = schema[key].is_a?(Hash) && %w[image file].include?(schema.dig(key, 'type'))
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.9
4
+ version: 0.11.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - f
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-05 00:00:00.000000000 Z
11
+ date: 2023-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fast_blank