Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
init committed Nov 18, 2024
1 parent fddabe8 commit 80f141c
Show file tree
Hide file tree
Showing 2 changed files with 149 additions and 103 deletions.
250 changes: 148 additions & 102 deletions _layouts/bib.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
---
<!-- _layouts/bib.html -->

<div class="row">
<div class="col-sm-2 {% if entry.preview %}preview{% else %}abbr{% endif %}">
{%- if entry.preview -%}
Expand All @@ -22,110 +23,113 @@
{%- endif -%}
</div>

<!-- Entry bib key -->
<div id="{{entry.key}}" class="col-sm-8">
{% if entry.type == "thesis" -%}
{{reference}}
{%- else %}
<!-- Title -->
<div class="title">{{entry.title}}</div>
<!-- Author -->
<div class="author">
{% assign author_array_size = entry.author_array | size %}

{% assign author_array_limit = author_array_size %}
{%- if site.max_author_limit and author_array_size > site.max_author_limit %}
{% assign author_array_limit = site.max_author_limit %}
{% endif %}

{%- for author in entry.author_array limit: author_array_limit -%}
{%- assign author_is_self = false -%}
{%- assign author_last_name = author.last | remove: "¶" | remove: "&" | remove: "*" | remove: "†" | remove: "^" -%}
{%- if site.scholar.last_name contains author_last_name -%}
{%- if site.scholar.first_name contains author.first -%}
{%- assign author_is_self = true -%}
{%- endif -%}
{%- endif -%}
{%- assign coauthor_url = nil -%}
{%- if site.data.coauthors[author_last_name] -%}
{%- for coauthor in site.data.coauthors[author_last_name] -%}
{%- if coauthor.firstname contains author.first -%}
{%- assign coauthor_url = coauthor.url -%}
{%- break -%}
{%- endif -%}
{%- endfor -%}
<!-- Entry bib key -->
<div id="{{entry.key}}" class="{% if site.enable_publication_thumbnails %}col-sm-8{% else %}col-sm-10{% endif %}">
<!-- Title -->
<div class="title">{{entry.title}}</div>
<!-- Author -->
<div class="author">
{% assign author_array_size = entry.author_array | size %}

{% assign author_array_limit = author_array_size %}
{%- if site.max_author_limit and author_array_size > site.max_author_limit %}
{% assign author_array_limit = site.max_author_limit %}
{% endif %}

{%- for author in entry.author_array limit: author_array_limit -%}
{%- assign author_is_self = false -%}
{%- assign author_last_name = author.last | remove: "¶" | remove: "&" | remove: "*" | remove: "†" | remove: "^" -%}
{%- if site.scholar.last_name contains author_last_name -%}
{%- if site.scholar.first_name contains author.first -%}
{%- assign author_is_self = true -%}
{%- endif -%}

{%- if forloop.length > 1 -%}
{%- if forloop.first == false -%},&nbsp;{%- endif -%}
{%- if forloop.last and author_array_limit == author_array_size -%}and&nbsp;{%- endif -%}
{%- endif -%}
{%- if author_is_self -%}
<em>{{author.first}} {{author.last}}</em>
{%- else -%}
{%- if coauthor_url -%}
<a href="{{coauthor_url}}">{{author.first}} {{author.last}}</a>
{%- else -%}
{{author.first}} {{author.last}}
{%- endif -%}
{%- assign coauthor_url = nil -%}
{%- if site.data.coauthors[author_last_name] -%}
{%- for coauthor in site.data.coauthors[author_last_name] -%}
{%- if coauthor.firstname contains author.first -%}
{%- assign coauthor_url = coauthor.url -%}
{%- break -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- assign more_authors = author_array_size | minus: author_array_limit -%}

{%- assign more_authors_hide = more_authors | append: " more author" -%}
{%- if more_authors > 0 -%}
{%- if more_authors > 1 -%}
{%- assign more_authors_hide = more_authors_hide | append: "s" -%}
{%- endif -%}
{%- assign more_authors_show = '' -%}
{%- for author in entry.author_array offset: author_array_limit -%}
{%- assign more_authors_show = more_authors_show | append: author.first | append: " " | append: author.last -%}
{%- unless forloop.last -%}
{%- assign more_authors_show = more_authors_show | append: ", " -%}
{%- endunless -%}
{%- endfor -%}
, and
<span
class="more-authors"
title="click to view {{more_authors_hide}}"
onclick="
var element = $(this);
element.attr('title', '');
var more_authors_text = element.text() == '{{more_authors_hide}}' ? '{{more_authors_show}}' : '{{more_authors_hide}}';
var cursorPosition = 0;
var textAdder = setInterval(function(){
element.text(more_authors_text.substring(0, cursorPosition + 1));
if (++cursorPosition == more_authors_text.length){
clearInterval(textAdder);
}
}, '{{site.more_authors_animation_delay}}');
"
>{{more_authors_hide}}</span>
{%- endif -%}

</div>

<!-- Journal/Book title and date -->
{% assign proceedings = "inproceedings, incollection" | split: ','%}
{% if entry.type == "article" -%}
{%- capture entrytype -%}<em>{{entry.journal}}</em>{%- endcapture -%}
{%- elsif proceedings contains entry.type -%}
{%- capture entrytype -%}<em>In {{entry.booktitle}}</em> {%- endcapture -%}
{%- else -%}
{%- capture entrytype -%}{%- endcapture -%}

{%- if forloop.length > 1 -%}
{%- if forloop.first == false -%},&nbsp;{%- endif -%}
{%- if forloop.last and author_array_limit == author_array_size -%}and&nbsp;{%- endif -%}
{%- endif -%}
{%- if entry.month -%}
{%- capture entrymonth -%}{{ " " }}{{ entry.month | capitalize }}{%- endcapture -%}
{%- if author_is_self -%}
<em>{{author.first}} {{author.last}}</em>
{%- else -%}
{%- if coauthor_url -%}
<a href="{{coauthor_url}}">{{author.first}} {{author.last}}</a>
{%- else -%}
{{author.first}} {{author.last}}
{%- endif -%}
{%- endif -%}
{%- if entry.year -%}
{%- capture entryyear -%}{{ " " }}{{entry.year}}{%- endcapture -%}
{%- endfor -%}
{%- assign more_authors = author_array_size | minus: author_array_limit -%}

{%- assign more_authors_hide = more_authors | append: " more author" -%}
{%- if more_authors > 0 -%}
{%- if more_authors > 1 -%}
{%- assign more_authors_hide = more_authors_hide | append: "s" -%}
{%- endif -%}
{%- capture periodical -%}{{ entrytype }}{{ entrymonth }}{{ entryyear }}{%- endcapture -%}
<div class="periodical">
{{ periodical | strip }}
</div>
{%- endif %}

{%- assign more_authors_show = '' -%}
{%- for author in entry.author_array offset: author_array_limit -%}
{%- assign more_authors_show = more_authors_show | append: author.first | append: " " | append: author.last -%}
{%- unless forloop.last -%}
{%- assign more_authors_show = more_authors_show | append: ", " -%}
{%- endunless -%}
{%- endfor -%}
, and
<span
class="more-authors"
title="click to view {{more_authors_hide}}"
onclick="
var element = $(this);
element.attr('title', '');
var more_authors_text = element.text() == '{{more_authors_hide}}' ? '{{more_authors_show}}' : '{{more_authors_hide}}';
var cursorPosition = 0;
var textAdder = setInterval(function(){
element.text(more_authors_text.substring(0, cursorPosition + 1));
if (++cursorPosition == more_authors_text.length){
clearInterval(textAdder);
}
}, '{{site.more_authors_animation_delay}}');
"
>{{more_authors_hide}}</span>
{%- endif -%}

</div>

<!-- Journal/Book title and date -->
{% assign proceedings = "inproceedings,incollection" | split: ','%}
{% assign thesis = "thesis,mastersthesis,phdthesis" | split: ','%}
{% if entry.type == "article" -%}
{%- capture entrytype -%}<em>{{entry.journal}}</em>{%- endcapture -%}
{%- elsif proceedings contains entry.type -%}
{%- capture entrytype -%}<em>In {{entry.booktitle}}</em> {%- endcapture -%}
{%- elsif thesis contains entry.type -%}
{%- capture entrytype -%}<em>{{entry.school}}</em> {%- endcapture -%}
{%- else -%}
{%- capture entrytype -%}{%- endcapture -%}
{%- endif -%}
{%- if entry.month -%}
{%- capture entrymonth -%}{{ " " }}{{ entry.month | capitalize }}{%- endcapture -%}
{%- endif -%}
{%- if entry.year -%}
{%- capture entryyear -%}{{ " " }}{{entry.year}}{%- endcapture -%}
{%- endif -%}
{% assign entrytype_text = entrytype | strip_html | strip %}
{%- capture periodical -%}{{ entrytype }}{%- if entrytype_text != "" and entryyear != "" -%}, {%- endif -%}{{ entrymonth }}{{ entryyear }}{%- endcapture -%}
<div class="periodical">
{{ periodical | strip }}
</div>
<div class="periodical">
{{ entry.note | strip }}
</div>

<!-- Links/Buttons -->
<div class="links">
{%- if entry.abstract %}
Expand Down Expand Up @@ -154,6 +158,9 @@
<a href="{{ entry.supp | prepend: '/assets/pdf/' | relative_url }}" class="btn btn-sm z-depth-0" role="button">Supp</a>
{%- endif %}
{%- endif %}
{%- if entry.video %}
<a class="abstract btn btn-sm z-depth-0" role="button">Video</a>
{%- endif %}
{%- if entry.blog %}
<a href="{{ entry.blog }}" class="btn btn-sm z-depth-0" role="button">Blog</a>
{%- endif %}
Expand All @@ -177,23 +184,62 @@
{%- if entry.website %}
<a href="{{ entry.website }}" class="btn btn-sm z-depth-0" role="button">Website</a>
{%- endif %}
{%- if entry.altmetric %}
<script type="text/javascript" src="https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js"></script><div data-altmetric-id="{{ entry.altmetric }}" class="altmetric-embed" data-hide-no-mentions="true" data-hide-less-than="15" data-badge-popover="right" data-badge-type="2" style="display:inline"></div>
{%- endif %}
</div>

{% if site.enable_publication_badges %}
{% assign entry_has_altmetric_badge = entry.altmetric or entry.doi or entry.eprint or entry.pmid or entry.isbn %}
{% assign entry_has_dimensions_badge = entry.dimensions or entry.doi or entry.pmid %}
{% if entry_has_altmetric_badge or entry_has_dimensions_badge %}
<div class="badges">
{%- if site.enable_publication_badges.altmetric and entry_has_altmetric_badge %}
<span class="altmetric-embed" data-hide-no-mentions="true" data-hide-less-than="15" data-badge-type="2" data-badge-popover="right"
{% if entry.eprint %}
data-arxiv-id="{{ entry.eprint }}"
{% elsif entry.doi %}
data-doi="{{ entry.doi }}"
{% elsif entry.altmetric %}
data-altmetric-id="{{ entry.altmetric }}"
{% elsif entry.pmid %}
data-pmid="{{ entry.pmid }}"
{% elsif entry.isbn %}
data-isbn="{{ entry.isbn }}"
{% endif %}
></span>
{%- endif %}
{%- if site.enable_publication_badges.dimensions and entry_has_dimensions_badge %}
<span class="__dimensions_badge_embed__"
{% if entry.doi %}
data-doi="{{ entry.doi }}"
{% else if entry.pmid %}
data-pmid="{{ entry.pmid }}"
{% else %}
data-id="{{ entry.dimensions }}"
{% endif %}
data-hide-zero-citations="true" data-style="small_rectangle" data-legend="hover-right" style="margin-bottom: 3px;"></span>
{%- endif %}
</div>
{%- endif %}
{%- endif %}

{% if entry.abstract -%}
<!-- Hidden abstract block -->
<div class="abstract hidden">
<p>{{ entry.abstract }}</p>
</div>
{%- endif -%}

{% if entry.bibtex_show -%}
<!-- Hidden bibtex block -->
<div class="bibtex hidden">
{% highlight bibtex %}{{ entry.bibtex | hideCustomBibtex }}{% endhighlight %}
</div>
{%- endif %}

{% if entry.video -%}
<!-- Hidden video block -->
<div class="abstract hidden">
<div style="text-align: center;">{% include video.html path=entry.video class="img-fluid rounded z-depth-1" controls=true %}</div>
</div>
{%- endif -%}

</div>
</div>
2 changes: 1 addition & 1 deletion _pages/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ profile:

news: true # includes a list of news items
social: false # includes social icons at the bottom of the
selected_papers: true
selected_papers: true # includes a list of papers marked as "selected={true}"

---

Expand Down

0 comments on commit 80f141c

Please sign in to comment.