Skip to content

Commit

Permalink
Merge branch 'al-folio-main'
Browse files Browse the repository at this point in the history
  • Loading branch information
george-gca committed Dec 12, 2024
2 parents 97ee5ea + 3cdb9e4 commit 4421ce1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
4 changes: 2 additions & 2 deletions _includes/scripts/search.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
{%- when "email" -%}
{%- assign social_id = "social-email" -%}
{%- assign social_title = "{{ site.data[site.active_lang].strings.search.email }}" -%}
{%- assign social_url = "mailto:{{ site.email | encode_email }}" -%}
{%- assign social_url = "mailto:{{ social[1] | encode_email }}" -%}
{%- when "facebook_id" -%}
{%- assign social_id = "social-facebook" -%}
{%- assign social_title = "Facebook" -%}
Expand Down Expand Up @@ -261,7 +261,7 @@
{%- when "mastodon_username" -%}
{%- assign social_id = "social-mastodon" -%}
{%- assign social_title = "Mastodon" -%}
{%- assign social_url = "https://{{ site.mastodon_username }}" -%}
{%- assign social_url = "https://{{ social[1] }}" -%}
{%- when "medium_username" -%}
{%- assign social_id = "social-medium" -%}
{%- assign social_title = "Medium" -%}
Expand Down
6 changes: 3 additions & 3 deletions _includes/social.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% when 'discord_id' %}
<a href="https://discord.com/users/{{ social[1] }}" title="Discord"><i class="fa-brands fa-discord"></i></a>
{% when 'email' %}
<a href="mailto:{{ site.email | encode_email }}" title="email"><i class="fa-solid fa-envelope"></i></a>
<a href="mailto:{{ social[1] | encode_email }}" title="email"><i class="fa-solid fa-envelope"></i></a>
{% when 'facebook_id' %}
<a href="https://facebook.com/{{ social[1] }}" title="Facebook"><i class="fa-brands fa-facebook"></i></a>
{% when 'flickr_id' %}
Expand Down Expand Up @@ -39,7 +39,7 @@
{% when 'linkedin_username' %}
<a href="https://www.linkedin.com/in/{{ social[1] }}" title="LinkedIn"><i class="fa-brands fa-linkedin"></i></a>
{% when 'mastodon_username' %}
<a rel="me" href="https://{{ site.mastodon_username }}" title="Mastodon"><i class="fa-brands fa-mastodon"></i></a>
<a rel="me" href="https://{{ social[1] }}" title="Mastodon"><i class="fa-brands fa-mastodon"></i></a>
{% when 'medium_username' %}
<a href="https://medium.com/@{{ social[1] }}" title="Medium"><i class="fa-brands fa-medium"></i></a>
{% when 'orcid_id' %}
Expand Down Expand Up @@ -75,7 +75,7 @@
{% when 'wechat_qr' %}
<a id="WeChatBtn" title="WeChat"><i class="fa-brands fa-weixin"></i></a>
<div id="WeChatMod" class="wechat-modal">
<img src="{{ site.wechat_qr | prepend: 'assets/img/' | relative_url }}" alt="WeChat QR" id="WeChatQR">
<img src="{{ social[1] | prepend: 'assets/img/' | relative_url }}" alt="WeChat QR" id="WeChatQR">
</div>
{% include scripts/wechatModal.liquid %}
{% when 'whatsapp_number' %}
Expand Down
6 changes: 3 additions & 3 deletions _layouts/bib.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,13 @@
{% endif %}
{% if site.enable_publication_badges.google_scholar and entry_has_google_scholar_badge %}
<a
href="https://scholar.google.com/citations?view_op=view_citation&hl=en&user={{ site.scholar_userid }}&citation_for_view={{ site.scholar_userid }}:{{ entry.google_scholar_id }}"
href="https://scholar.google.com/citations?view_op=view_citation&hl=en&user={{ site.data.socials.scholar_userid }}&citation_for_view={{ site.data.socials.scholar_userid }}:{{ entry.google_scholar_id }}"
aria-label="Google Scholar link"
role="button"
>
<img
src="https://img.shields.io/badge/scholar-{% google_scholar_citations site.scholar_userid entry.google_scholar_id %}-4285F4?logo=googlescholar&labelColor=beige"
alt="{% google_scholar_citations site.scholar_userid entry.google_scholar_id %} Google Scholar citations"
src="https://img.shields.io/badge/scholar-{% google_scholar_citations site.data.socials.scholar_userid entry.google_scholar_id %}-4285F4?logo=googlescholar&labelColor=beige"
alt="{% google_scholar_citations site.data.socials.scholar_userid entry.google_scholar_id %} Google Scholar citations"
>
</a>
{% endif %}
Expand Down
11 changes: 9 additions & 2 deletions _plugins/google-scholar-citations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ def initialize(tag_name, params, tokens)
splitted = params.split(" ").map(&:strip)
@scholar_id = splitted[0]
@article_id = splitted[1]

if @scholar_id.nil? || @scholar_id.empty?
puts "Invalid scholar_id provided"
end

if @article_id.nil? || @article_id.empty?
puts "Invalid article_id provided"
end
end

def render(context)
Expand Down Expand Up @@ -65,10 +73,9 @@ def render(context)
citation_count = "N/A"

# Print the error message including the exception class and message
puts "Error fetching citation count for #{article_id}: #{e.class} - #{e.message}"
puts "Error fetching citation count for #{article_id} in #{article_url}: #{e.class} - #{e.message}"
end


GoogleScholarCitationsTag::Citations[article_id] = citation_count
return "#{citation_count}"
end
Expand Down

0 comments on commit 4421ce1

Please sign in to comment.