jekyll-hackclub 1.5.3 → 1.5.4

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: 5d49c6c3dffd7091a3d90afa44de41199e91f21f2d31fac0c6597b671e11bb56
4
- data.tar.gz: a4d165bb7ba68d396b591ae8cb1e56720bd14530030daa74bfc53e34494cb750
3
+ metadata.gz: c35199cb176d936872986c6dbb7b46e65cb6b11f21250f759099b143cb8bb378
4
+ data.tar.gz: bdd6a99a115b5b9b6c1c0e45c6e97477abac61476e73c61513fd590945cab7b4
5
5
  SHA512:
6
- metadata.gz: 77ce124b786ace36b4e62ae916d53ba318c6c1511f9516a3774e26f9e914e47696d8cb0096eb3f0cd90740223b91303c974f16b9e992ad2f854653501471b588
7
- data.tar.gz: 71a709072086f7c47fd02d4f3f83085ac64ac4de354a1964f771680a898b51dc38c0a35d046f23ba17ad3a38fc7565651a75e9caff34183441536d59c547df6e
6
+ metadata.gz: 96e1e7198747743df95612dec2bd2c944dd82d62bb7ce8d05886515d49c217cd362d9b55f522707d9a9269011d607b39e3a95ad3b883fa4dbf39c51723304c09
7
+ data.tar.gz: 79da52c88ea5cb8b3f299b513ec44a74cc4bbe667b522523a464acbbb3e72b88c695786b3da402256277de2916435f814d3ee22a9f4c1342e6d7ab59589a91c2
data/lib/server-bridge.rb CHANGED
@@ -49,10 +49,14 @@ module HackclubRequest
49
49
  return {}, nil
50
50
  end
51
51
 
52
- def self.get_emoji(id)
52
+ def self.get_emoji_url(id)
53
53
  return "#{host}/emoji/#{id.strip}"
54
54
  end
55
55
 
56
+ def self.get_pfp_url(id, quality)
57
+ return "#{host}/profile.picture/#{id.strip}?q=#{quality}"
58
+ end
59
+
56
60
  def self.raw_file(fileid)
57
61
  data, res = make_request("/files.info/#{fileid}")
58
62
  res&.is_a?(Net::HTTPSuccess) ? data : {}
data/lib/tags/emoji.rb CHANGED
@@ -6,7 +6,7 @@ module Jekyll
6
6
  def initialize(tagName, content, tokens)
7
7
  super
8
8
  @id = content.gsub(/\A:+|:+\z/, '').strip
9
- @img_url = HackclubRequest.get_emoji(@id)
9
+ @img_url = HackclubRequest.get_emoji_url(@id)
10
10
  end
11
11
 
12
12
  def render(context)
@@ -10,15 +10,14 @@ module Jekyll
10
10
  data = HackclubRequest.raw_user(id)
11
11
  @resolution = Regexp.last_match(2) || "original"
12
12
 
13
- @img_url = data.dig("user", "profile", "image_"+@resolution)
14
- @name = data.dig("user", "name")
13
+ @img_url = HackclubRequest.get_pfp_url(id, @resolution)
15
14
  else
16
15
  raise ArgumentError, "Invalid profilepic tag format: #{content}"
17
16
  end
18
17
  end
19
18
 
20
19
  def render(context)
21
- %Q{<img src="#{@img_url}" title="#{@name}'s profile picture" alt="#{@name}'s profile picture" class="hackclub-pfp res-#{@resolution}">}
20
+ %Q{<img src="#{@img_url}" title="Slack profile picture" alt="Slack profile picture" class="hackclub-pfp res-#{@resolution}">}
22
21
  end
23
22
  end
24
23
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-hackclub
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.3
4
+ version: 1.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - MathiasDPX