Skip to content
Snippets Groups Projects
Unverified Commit 01bca0d9 authored by Arnaud Levy's avatar Arnaud Levy Committed by GitHub
Browse files

Google Scholar (#2452)

* Google Scholar

* Fix

* Fix

* Memoize

* Better

* Lighter
parent 7933f6a7
No related branches found
No related tags found
No related merge requests found
......@@ -69,6 +69,17 @@ class Research::Journal::Paper::Localization < ApplicationRecord
contents_dependencies
end
# TODO manage real authors (through people)
def authors_l10n_array
return [] if authors_list.blank?
@authors_l10n_array ||= authors_list.gsub(' & ', ',')
.gsub(' and ', ',')
.gsub(' et ', ',')
.split(',')
.collect(&:strip)
.compact_blank
end
def journal_l10n
paper.journal.localization_for(language)
end
......
......@@ -9,6 +9,25 @@ language = @l10n.language
l10n: @l10n,
full_width: false,
toc_offcanvas: false %>
metadata:
- name: "citation_title"
content: "<%= prepare_text_for_static @l10n.title %>"
<% @l10n.authors_l10n_array.each do |author| %>
- name: "citation_author"
content: "<%= prepare_text_for_static author %>"
<% end %>
- name: "citation_publication_date"
content: "<%= @l10n.published_at.strftime("%Y/%m/%d") %>"
- name: "citation_journal_title"
content: "<%= prepare_text_for_static paper.journal.to_s_in(language) %>"
<% if @l10n.pdf.attached? %>
- name: "citation_pdf_url"
content: "<%= @l10n.pdf.blob_id %>"
<% end %>
<% if @l10n.volume_l10n %>
- name: "citation_volume"
content: "<%= prepare_text_for_static @l10n.volume_l10n.to_s %>"
<% end %>
<% if paper.kind %>
paper_kind: "<%= prepare_text_for_static paper.kind %>"
<% end %>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment