Skip to content

Commit c5101be

Browse files
authored
Fixed socials in search (#2895)
Signed-off-by: George Araújo <[email protected]>
1 parent 3cdb9e4 commit c5101be

File tree

1 file changed

+46
-46
lines changed

1 file changed

+46
-46
lines changed

_includes/scripts/search.liquid

+46-46
Original file line numberDiff line numberDiff line change
@@ -124,193 +124,193 @@
124124
{%- when "acm_id" -%}
125125
{%- assign social_id = "social-acm" -%}
126126
{%- assign social_title = "ACM DL" -%}
127-
{%- assign social_url = "https://dl.acm.org/profile/{{ social[1] }}/" -%}
127+
{%- capture social_url %}"https://dl.acm.org/profile/{{ social[1] }}/"{% endcapture -%}
128128
{%- when "blogger_url" -%}
129129
{%- assign social_id = "social-blogger" -%}
130130
{%- assign social_title = "Blogger" -%}
131-
{%- assign social_url = social[1] -%}
131+
{%- capture social_url %}"{{ social[1] }}"{% endcapture -%}
132132
{%- when "bluesky_url" -%}
133133
{%- assign social_id = "social-bluesky" -%}
134134
{%- assign social_title = "Bluesky" -%}
135-
{%- assign social_url = social[1] -%}
135+
{%- capture social_url %}"{{ social[1] }}"{% endcapture -%}
136136
{%- when "dblp_url" -%}
137137
{%- assign social_id = "social-dblp" -%}
138138
{%- assign social_title = "DBLP" -%}
139-
{%- assign social_url = social[1] -%}
139+
{%- capture social_url %}"{{ social[1] }}"{% endcapture -%}
140140
{%- when "discord_id" -%}
141141
{%- assign social_id = "social-discord" -%}
142142
{%- assign social_title = "Discord" -%}
143-
{%- assign social_url = "https://discord.com/users/{{ social[1] }}" -%}
143+
{%- capture social_url %}"https://discord.com/users/{{ social[1] }}"{% endcapture -%}
144144
{%- when "email" -%}
145145
{%- assign social_id = "social-email" -%}
146146
{%- assign social_title = "email" -%}
147-
{%- assign social_url = "mailto:{{ social[1] | encode_email }}" -%}
147+
{%- capture social_url %}"mailto:{{ social[1] | encode_email }}"{% endcapture -%}
148148
{%- when "facebook_id" -%}
149149
{%- assign social_id = "social-facebook" -%}
150150
{%- assign social_title = "Facebook" -%}
151-
{%- assign social_url = "https://facebook.com/{{ social[1] }}" -%}
151+
{%- capture social_url %}"https://facebook.com/{{ social[1] }}"{% endcapture -%}
152152
{%- when "flickr_id" -%}
153153
{%- assign social_id = "social-flickr" -%}
154154
{%- assign social_title = "Flickr" -%}
155-
{%- assign social_url = "https://www.flickr.com/{{ social[1] }}" -%}
155+
{%- capture social_url %}"https://www.flickr.com/{{ social[1] }}"{% endcapture -%}
156156
{%- when "github_username" -%}
157157
{%- assign social_id = "social-github" -%}
158158
{%- assign social_title = "GitHub" -%}
159-
{%- assign social_url = "
159+
{%- capture social_url %}"https://github.com/{{ social[1] }}"{% endcapture -%}
160160
{%- when "gitlab_username" -%}
161161
{%- assign social_id = "social-gitlab" -%}
162162
{%- assign social_title = "GitLab" -%}
163-
{%- assign social_url = "https://gitlab.com/{{ social[1] }}" -%}
163+
{%- capture social_url %}"https://gitlab.com/{{ social[1] }}"{% endcapture -%}
164164
{%- when "ieee_id" -%}
165165
{%- assign social_id = "social-ieee" -%}
166166
{%- assign social_title = "IEEE Xplore" -%}
167-
{%- assign social_url = "https://ieeexplore.ieee.org/author/{{ social[1] }}/" -%}
167+
{%- capture social_url %}"https://ieeexplore.ieee.org/author/{{ social[1] }}/"{% endcapture -%}
168168
{%- when "inspirehep_id" -%}
169169
{%- assign social_id = "social-inspire" -%}
170170
{%- assign social_title = "Inspire HEP" -%}
171-
{%- assign social_url = "https://inspirehep.net/authors/{{ social[1] }}" -%}
171+
{%- capture social_url %}"https://inspirehep.net/authors/{{ social[1] }}"{% endcapture -%}
172172
{%- when "instagram_id" -%}
173173
{%- assign social_id = "social-instagram" -%}
174174
{%- assign social_title = "Instagram" -%}
175-
{%- assign social_url = "https://instagram.com/{{ social[1] }}" -%}
175+
{%- capture social_url %}"https://instagram.com/{{ social[1] }}"{% endcapture -%}
176176
{%- when "kaggle_id" -%}
177177
{%- assign social_id = "social-kaggle" -%}
178178
{%- assign social_title = "Kaggle" -%}
179-
{%- assign social_url = "https://www.kaggle.com/{{ social[1] }}" -%}
179+
{%- capture social_url %}"https://www.kaggle.com/{{ social[1] }}"{% endcapture -%}
180180
{%- when "keybase_username" -%}
181181
{%- assign social_id = "social-keybase" -%}
182182
{%- assign social_title = "Keybase" -%}
183-
{%- assign social_url = "https://keybase.io/{{ social[1] }}" -%}
183+
{%- capture social_url %}"https://keybase.io/{{ social[1] }}"{% endcapture -%}
184184
{%- when "lastfm_id" -%}
185185
{%- assign social_id = "social-lastfm" -%}
186186
{%- assign social_title = "Last FM" -%}
187-
{%- assign social_url = "https://www.last.fm/user/{{ social[1] }}" -%}
187+
{%- capture social_url %}"https://www.last.fm/user/{{ social[1] }}"{% endcapture -%}
188188
{%- when "lattes_id" -%}
189189
{%- assign social_id = "social-lattes" -%}
190190
{%- assign social_title = "Lattes" -%}
191-
{%- assign social_url = "http://lattes.cnpq.br/{{ social[1] }}" -%}
191+
{%- capture social_url %}"http://lattes.cnpq.br/{{ social[1] }}"{% endcapture -%}
192192
{%- when "leetcode_id" -%}
193193
{%- assign social_id = "social-leetcode" -%}
194194
{%- assign social_title = "LeetCode" -%}
195-
{%- assign social_url = "https://leetcode.com/u/{{ social[1] }}/" -%}
195+
{%- capture social_url %}"https://leetcode.com/u/{{ social[1] }}/"{% endcapture -%}
196196
{%- when "linkedin_username" -%}
197197
{%- assign social_id = "social-linkedin" -%}
198198
{%- assign social_title = "LinkedIn" -%}
199-
{%- assign social_url = "https://www.linkedin.com/in/{{ social[1] }}" -%}
199+
{%- capture social_url %}"https://www.linkedin.com/in/{{ social[1] }}"{% endcapture -%}
200200
{%- when "mastodon_username" -%}
201201
{%- assign social_id = "social-mastodon" -%}
202202
{%- assign social_title = "Mastodon" -%}
203-
{%- assign social_url = "https://{{ social[1] }}" -%}
203+
{%- capture social_url %}"https://{{ social[1] }}"{% endcapture -%}
204204
{%- when "medium_username" -%}
205205
{%- assign social_id = "social-medium" -%}
206206
{%- assign social_title = "Medium" -%}
207-
{%- assign social_url = "https://medium.com/@{{ social[1] }}" -%}
207+
{%- capture social_url %}"https://medium.com/@{{ social[1] }}"{% endcapture -%}
208208
{%- when "orcid_id" -%}
209209
{%- assign social_id = "social-orcid" -%}
210210
{%- assign social_title = "ORCID" -%}
211-
{%- assign social_url = "https://orcid.org/{{ social[1] }}" -%}
211+
{%- capture social_url %}"https://orcid.org/{{ social[1] }}"{% endcapture -%}
212212
{%- when "osf_id" -%}
213213
{%- assign social_id = "social-osf" -%}
214214
{%- assign social_title = "Open Science Framework" -%}
215-
{%- assign social_url = "https://osf.io/{{ social[1] }}/" -%}
215+
{%- capture social_url %}"https://osf.io/{{ social[1] }}/"{% endcapture -%}
216216
{%- when "pinterest_id" -%}
217217
{%- assign social_id = "social-pinterest" -%}
218218
{%- assign social_title = "Pinterest" -%}
219-
{%- assign social_url = "https://www.pinterest.com/{{ social[1] }}" -%}
219+
{%- capture social_url %}"https://www.pinterest.com/{{ social[1] }}"{% endcapture -%}
220220
{%- when "publons_id" -%}
221221
{%- assign social_id = "social-publons" -%}
222222
{%- assign social_title = "Publons" -%}
223-
{%- assign social_url = "https://publons.com/a/{{ social[1] }}/" -%}
223+
{%- capture social_url %}"https://publons.com/a/{{ social[1] }}/"{% endcapture -%}
224224
{%- when "quora_username" -%}
225225
{%- assign social_id = "social-quora" -%}
226226
{%- assign social_title = "Quora" -%}
227-
{%- assign social_url = "https://www.quora.com/profile/{{ social[1] }}" -
227+
{%- capture social_url %}"https://www.quora.com/profile/{{ social[1] }}"{% endcapture -%}
228228
{%- when "research_gate_profile" -%}
229229
{%- assign social_id = "social-researchgate" -%}
230230
{%- assign social_title = "ResearchGate" -%}
231-
{%- assign social_url = "https://www.researchgate.net/profile/{{ social[1] }}/" -%}
231+
{%- capture social_url %}"https://www.researchgate.net/profile/{{ social[1] }}/"{% endcapture -%}
232232
{%- when "rss_icon" -%}
233233
{%- assign social_id = "social-rss" -%}
234234
{%- assign social_title = "RSS Feed" -%}
235-
{%- assign social_url = "{{ site.baseurl }}/feed.xml" -%}
235+
{%- capture social_url %}"{{ site.baseurl }}/feed.xml"{% endcapture -%}
236236
{%- when "scholar_userid" -%}
237237
{%- assign social_id = "social-scholar" -%}
238238
{%- assign social_title = "Google Scholar" -%}
239-
{%- assign social_url = "https://scholar.google.com/citations?user={{ social[1] }}" -%}
239+
{%- capture social_url %}"https://scholar.google.com/citations?user={{ social[1] }}"{% endcapture -%}
240240
{%- when "scopus_id" -%}
241241
{%- assign social_id = "social-scopus" -%}
242242
{%- assign social_title = "Scopus" -%}
243-
{%- assign social_url = "https://www.scopus.com/authid/detail.uri?authorId={{ social[1] }}" -%}
243+
{%- capture social_url %}"https://www.scopus.com/authid/detail.uri?authorId={{ social[1] }}"{% endcapture -%}
244244
{%- when "semanticscholar_id" -%}
245245
{%- assign social_id = "social-semanticscholar" -%}
246246
{%- assign social_title = "Semantic Scholar" -%}
247-
{%- assign social_url = "https://www.semanticscholar.org/author/{{ social[1] }}" -%}
247+
{%- capture social_url %}"https://www.semanticscholar.org/author/{{ social[1] }}"{% endcapture -%}
248248
{%- when "spotify_id" -%}
249249
{%- assign social_id = "social-spotify" -%}
250250
{%- assign social_title = "Spotify" -%}
251-
{%- assign social_url = "https://open.spotify.com/user/{{ social[1] }}" -%}
251+
{%- capture social_url %}"https://open.spotify.com/user/{{ social[1] }}"{% endcapture -%}
252252
{%- when "stackoverflow_id" -%}
253253
{%- assign social_id = "social-stackoverflow" -%}
254254
{%- assign social_title = "Stackoverflow" -%}
255-
{%- assign social_url = "https://stackoverflow.com/users/{{ social[1] }}" -%}
255+
{%- capture social_url %}"https://stackoverflow.com/users/{{ social[1] }}"{% endcapture -%}
256256
{%- when "strava_userid" -%}
257257
{%- assign social_id = "social-strava" -%}
258258
{%- assign social_title = "Strava" -%}
259-
{%- assign social_url = "https://www.strava.com/athletes/{{ social[1] }}" -%}
259+
{%- capture social_url %}"https://www.strava.com/athletes/{{ social[1] }}"{% endcapture -%}
260260
{%- when "telegram_username" -%}
261261
{%- assign social_id = "social-telegram" -%}
262262
{%- assign social_title = "telegram" -%}
263-
{%- assign social_url = "https://telegram.me/{{ social[1] }}" -%}
263+
{%- capture social_url %}"https://telegram.me/{{ social[1] }}"{% endcapture -%}
264264
{%- when "unsplash_id" -%}
265265
{%- assign social_id = "social-unsplash" -%}
266266
{%- assign social_title = "Unsplash" -%}
267-
{%- assign social_url = "https://unsplash.com/@{{ social[1] }}" -%}
267+
{%- capture social_url %}"https://unsplash.com/@{{ social[1] }}"{% endcapture -%}
268268
{%- comment -%}
269269
// check how to add wechat qr code
270270
{%- when "wechat_qr" -%}
271271
{%- assign social_id = "social-wechat" -%}
272272
{%- assign social_title = "WeChat" -%}
273-
{%- assign social_url = "https://wechat.com/{{ social[1] }}" -%}
273+
{%- capture social_url %}"https://wechat.com/{{ social[1] }}"{% endcapture -%}
274274
{%- endcomment -%}
275275
{%- when "whatsapp_number" -%}
276276
{%- assign social_id = "social-whatsapp" -%}
277277
{%- assign social_title = "whatsapp" -%}
278-
{%- assign social_url = "https://wa.me/{{ social[1] }}" -%}
278+
{%- capture social_url %}"https://wa.me/{{ social[1] }}"{% endcapture -%}
279279
{%- when "wikidata_id" -%}
280280
{%- assign social_id = "social-wikidata" -%}
281281
{%- assign social_title = "Wikidata" -%}
282-
{%- assign social_url = "https://www.wikidata.org/wiki/{{ social[1] }}" -%}
282+
{%- capture social_url %}"https://www.wikidata.org/wiki/{{ social[1] }}"{% endcapture -%}
283283
{%- when "wikipedia_id" -%}
284284
{%- assign social_id = "social-wikipedia" -%}
285285
{%- assign social_title = "Wikipedia" -%}
286-
{%- assign social_url = "https://wikipedia.org/wiki/User:{{ social[1] }}" -%}
286+
{%- capture social_url %}"https://wikipedia.org/wiki/User:{{ social[1] }}"{% endcapture -%}
287287
{%- when "work_url" -%}
288288
{%- assign social_id = "social-work" -%}
289289
{%- assign social_title = "Work" -%}
290-
{%- assign social_url = social[1] -%}
290+
{%- capture social_url %}"{{ social[1] }}"{% endcapture -%}
291291
{%- when "x_username" -%}
292292
{%- assign social_id = "social-x" -%}
293293
{%- assign social_title = "X" -%}
294-
{%- assign social_url = "https://twitter.com/{{ social[1] }}" -%}
294+
{%- capture social_url %}"https://twitter.com/{{ social[1] }}"{% endcapture -%}
295295
{%- when "youtube_id" -%}
296296
{%- assign social_id = "social-youtube" -%}
297297
{%- assign social_title = "YouTube" -%}
298-
{%- assign social_url = "https://youtube.com/@{{ social[1] }}" -%}
298+
{%- capture social_url %}"https://youtube.com/@{{ social[1] }}"{% endcapture -%}
299299
{%- when "zotero_username" -%}
300300
{%- assign social_id = "social-zotero" -%}
301301
{%- assign social_title = "Zotero" -%}
302-
{%- assign social_url = "https://www.zotero.org/{{ social[1] }}" -%}
302+
{%- capture social_url %}"https://www.zotero.org/{{ social[1] }}"{% endcapture -%}
303303
{%- else -%}
304304
{%- assign social_id = "social-" | append: social[0] -%}
305305
{%- assign social_title = social[0] | capitalize -%}
306-
{%- assign social_url = social[1].url -%}
306+
{%- capture social_url %}"{{ social[1].url }}"{% endcapture -%}
307307
{%- endcase -%}
308308
{
309309
id: '{{ social_id }}',
310310
title: '{{ social_title }}',
311311
section: 'Socials',
312312
handler: () => {
313-
window.open("{{ social_url }}", "_blank");
313+
window.open({{ social_url }}, "_blank");
314314
},
315315
},
316316
{%- endfor -%}

0 commit comments

Comments
 (0)