jekyll-socials 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 7214937ca7dc52793da068f016befe8a77f969027eff6588e0a59d1f6f3370c2
4
+ data.tar.gz: 74fd2df5906cb0f5679305a6d06f72ca5b2e0951e8b40a276f80a1981222c673
5
+ SHA512:
6
+ metadata.gz: 516c792c30893992379496b3cbd03815679f473c716c832b83481e165e650191272c48e2477e639b719869b6e3463785bd791aed240e105ab852576331c4668d
7
+ data.tar.gz: 5ea8c99b50b4d3da232cefa363795cc46651a879330ed4ab5c3e9aff152f48adbc80f1763e1ec26b464a447737a84aa2a056e5af2e8a9af1c736dd4367d096f4
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Jekyll
4
+ module Socials
5
+ VERSION = "0.0.1"
6
+ end
7
+ end
@@ -0,0 +1,150 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Jekyll
4
+ class SocialLinksTag < Liquid::Tag
5
+ # https://jpswalsh.github.io/academicons/
6
+ ACADEMICONS = {
7
+ 'acm_id' => "<i class='ai ai-acm'></i>",
8
+ 'dblp_url' => "<i class='ai ai-dblp'></i>",
9
+ 'ieee_id' => "<i class='ai ai-ieee'></i>",
10
+ 'inspirehep_id' => "<i class='ai ai-inspire'></i>",
11
+ 'lattes_id' => "<i class='ai ai-lattes'></i>",
12
+ 'orcid_id' => "<i class='ai ai-orcid'></i>",
13
+ 'osf_id' => "<i class='ai ai-osf'></i>",
14
+ 'publons_id' => "<i class='ai ai-publons'></i>",
15
+ 'research_gate_profile' => "<i class='ai ai-researchgate'></i>",
16
+ 'scholar_userid' => "<i class='ai ai-google-scholar'></i>",
17
+ 'scopus_id' => "<i class='ai ai-scopus'></i>",
18
+ 'semanticscholar_id' => "<i class='ai ai-semantic-scholar'></i>",
19
+ }.freeze
20
+
21
+ # https://fontawesome.com/search
22
+ FONT_AWESOME = {
23
+ 'blogger_url' => "<i class='fa-brands fa-blogger-b'></i>",
24
+ 'bluesky_url' => "<i class='fa-brands fa-bluesky'></i>",
25
+ 'discord_id' => "<i class='fa-brands fa-discord'></i>",
26
+ 'email' => "<i class='fa-solid fa-envelope'></i>",
27
+ 'facebook_id' => "<i class='fa-brands fa-facebook'></i>",
28
+ 'flickr_id' => "<i class='fa-brands fa-flickr'></i>",
29
+ 'github_username' => "<i class='fa-brands fa-github'></i>",
30
+ 'gitlab_username' => "<i class='fa-brands fa-gitlab'></i>",
31
+ 'instagram_id' => "<i class='fa-brands fa-instagram'></i>",
32
+ 'kaggle_id' => "<i class='fa-brands fa-kaggle'></i>",
33
+ 'keybase_username' => "<i class='fa-brands fa-keybase'></i>",
34
+ 'lastfm_id' => "<i class='fa-brands fa-lastfm'></i>",
35
+ 'linkedin_username' => "<i class='fa-brands fa-linkedin'></i>",
36
+ 'mastodon_username' => "<i class='fa-brands fa-mastodon'></i>",
37
+ 'medium_username' => "<i class='fa-brands fa-medium'></i>",
38
+ 'pinterest_id' => "<i class='fa-brands fa-pinterest'></i>",
39
+ 'quora_username' => "<i class='fa-brands fa-quora'></i>",
40
+ 'rss_icon' => "<i class='fa-solid fa-square-rss'></i>",
41
+ 'spotify_id' => "<i class='fa-brands fa-spotify'></i>",
42
+ 'stackoverflow_id' => "<i class='fa-brands fa-stack-overflow'></i>",
43
+ 'strava_userid' => "<i class='fa-brands fa-strava'></i>",
44
+ 'telegram_username' => "<i class='fa-brands fa-telegram'></i>",
45
+ 'unsplash_id' => "<i class='fa-brands fa-unsplash'></i>",
46
+ 'wechat_username' => "<i class='fa-brands fa-weixin'></i>",
47
+ 'whatsapp_number' => "<i class='fa-brands fa-whatsapp'></i>",
48
+ 'wikidata_id' => "<i class='fa-solid fa-barcode'></i>",
49
+ 'wikipedia_id' => "<i class='fa-brands fa-wikipedia-w'></i>",
50
+ 'work_url' => "<i class='fa-solid fa-briefcase'></i>",
51
+ 'x_username' => "<i class='fa-brands fa-x-twitter'></i>",
52
+ 'youtube_id' => "<i class='fa-brands fa-youtube'></i>",
53
+ 'zotero_username' => "<i class='fa-brands fa-zotero'></i>"
54
+ }.freeze
55
+
56
+ # https://louisfacun.github.io/scholar-icons/
57
+ SCHOLAR_ICONS = {
58
+ 'leetcode_id' => "<i class='si si-leetcode'></i>"
59
+ }.freeze
60
+
61
+ SOCIAL_ICONS = ACADEMICONS.merge(FONT_AWESOME).merge(SCHOLAR_ICONS)
62
+
63
+ SOCIAL_URLS = {
64
+ 'acm_id' => "https://dl.acm.org/profile/%s/",
65
+ 'blogger_url' => "%s",
66
+ 'bluesky_url' => "%s",
67
+ 'dblp_url' => "%s",
68
+ 'discord_id' => "https://discord.com/users/%s",
69
+ 'email' => "mailto:%s",
70
+ 'facebook_id' => "https://facebook.com/%s",
71
+ 'flickr_id' => "https://www.flickr.com/%s",
72
+ 'github_username' => "https://github.com/%s",
73
+ 'gitlab_username' => "https://gitlab.com/%s",
74
+ 'ieee_id' => "https://ieeexplore.ieee.org/author/%s/",
75
+ 'inspirehep_id' => "https://inspirehep.net/authors/%s",
76
+ 'instagram_id' => "https://instagram.com/%s",
77
+ 'kaggle_id' => "https://www.kaggle.com/%s",
78
+ 'keybase_username' => "https://keybase.io/%s",
79
+ 'lastfm_id' => "https://www.last.fm/user/%s",
80
+ 'lattes_id' => "http://lattes.cnpq.br/%s",
81
+ 'leetcode_id' => "https://leetcode.com/u/%s/",
82
+ 'linkedin_username' => "https://www.linkedin.com/in/%s",
83
+ 'mastodon_username' => "https://%s",
84
+ 'medium_username' => "https://medium.com/@%s",
85
+ 'orcid_id' => "https://orcid.org/%s",
86
+ 'osf_id' => "https://osf.io/%s/",
87
+ 'pinterest_id' => "https://www.pinterest.com/%s",
88
+ 'publons_id' => "https://publons.com/a/%s/",
89
+ 'quora_username' => "https://www.quora.com/profile/%s",
90
+ 'research_gate_profile' => "https://www.researchgate.net/profile/%s/",
91
+ 'rss_icon' => "%s",
92
+ 'scholar_userid' => "https://scholar.google.com/citations?user=%s",
93
+ 'scopus_id' => "https://www.scopus.com/authid/detail.uri?authorId=%s",
94
+ 'semanticscholar_id' => "https://www.semanticscholar.org/author/%s",
95
+ 'spotify_id' => "https://open.spotify.com/user/%s",
96
+ 'stackoverflow_id' => "https://stackoverflow.com/users/%s",
97
+ 'strava_userid' => "https://www.strava.com/athletes/%s",
98
+ 'telegram_username' => "https://telegram.me/%s",
99
+ 'unsplash_id' => "https://unsplash.com/@%s",
100
+ 'wechat_username' => "weixin://dl/chat?%s",
101
+ 'whatsapp_number' => "https://wa.me/%s",
102
+ 'wikidata_id' => "https://www.wikidata.org/wiki/%s",
103
+ 'wikipedia_id' => "https://wikipedia.org/wiki/User:%s",
104
+ 'work_url' => "%s",
105
+ 'x_username' => "https://twitter.com/%s",
106
+ 'youtube_id' => "https://youtube.com/@%s",
107
+ 'zotero_username' => "https://www.zotero.org/%s"
108
+ }.freeze
109
+
110
+ def initialize(tag_name, text, tokens)
111
+ super
112
+ # @text = text.strip
113
+ end
114
+
115
+ def render(context)
116
+ # get socials information from _data/socials.yml
117
+ socials = context.registers[:site].data['socials'] || []
118
+ socials.map do |social|
119
+ icon = SOCIAL_ICONS[social[0]]
120
+ url_template = SOCIAL_URLS[social[0]]
121
+ if icon && url_template
122
+ if social[0] == 'rss_icon'
123
+ url = url_template % context.registers[:site].baseurl + '/feed.xml'
124
+ else
125
+ url = url_template % social[1]
126
+ end
127
+ "<a href='#{url}' title='#{social[0].gsub('_', ' ').capitalize}'>#{icon}</a>"
128
+ else
129
+ file_ext = social[1]['logo'].split('.').last
130
+ if file_ext == 'svg'
131
+ if social[1]['logo'].include?('://')
132
+ img_code = "<svg><image xlink:href='#{social[1]['logo']}' /></svg>"
133
+ else
134
+ img_code = "<svg><image xlink:href='#{social[1]['logo'] | relative_url}' /></svg>"
135
+ end
136
+ else
137
+ if social[1]['logo'].include?('://')
138
+ img_code = "<img src='#{social[1]['logo']}' alt='#{social[1]['title']}'>"
139
+ else
140
+ img_code = "<img src='#{social[1]['logo'] | relative_url}' alt='#{social[1]['title']}'>"
141
+ end
142
+ end
143
+ "<a href='#{social[1]['url']}' title='#{social[1]['title']}'>#{img_code}</a>"
144
+ end
145
+ end.join(" ")
146
+ end
147
+ end
148
+ end
149
+
150
+ Liquid::Template.register_tag('social_links', Jekyll::SocialLinksTag)
metadata ADDED
@@ -0,0 +1,65 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-socials
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - George Corrêa de Araújo
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 2025-01-23 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: jekyll
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '3.6'
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: '5.0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: '3.6'
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: '5.0'
32
+ description: Add beautiful social links to your Jekyll site using Academicons, FontAwesome,
33
+ and Social Icons.
34
+ executables: []
35
+ extensions: []
36
+ extra_rdoc_files: []
37
+ files:
38
+ - lib/jekyll-socials.rb
39
+ - lib/jekyll-socials/version.rb
40
+ homepage: https://george-gca.github.io/jekyll-socials/
41
+ licenses:
42
+ - MIT
43
+ metadata:
44
+ source_code_uri: https://github.com/george-gca/jekyll-socials
45
+ bug_tracker_uri: https://github.com/george-gca/jekyll-socials/issues
46
+ changelog_uri: https://github.com/george-gca/jekyll-socials/releases
47
+ homepage_uri: https://george-gca.github.io/jekyll-socials/
48
+ rdoc_options: []
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 2.3.0
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ requirements: []
62
+ rubygems_version: 3.6.3
63
+ specification_version: 4
64
+ summary: Add beautiful social links to your Jekyll site.
65
+ test_files: []