-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: force create joss cross ref badge #524
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,14 +38,47 @@ <h3 class="card__title no_toc" itemprop="headline"> | |
{% if apackage.gh_meta.documentation %} | ||
<li><a href="{{ apackage.gh_meta.documentation }}" rel="permalink"><i class="fas fa-book-open"></i> View Docs</a></li> | ||
{% endif %} | ||
{% if apackage.citation-link %} | ||
<li><a href="{{ apackage.archive }}" rel="permalink"><i class="fas fa-bookmark fa-fw"></i> Cite</a></li> | ||
{% endif %} | ||
<li><a href="{{ apackage.issue_link }}"><i class="fa-solid fa-user-pen"></i> View Review</a></li> | ||
|
||
{% if apackage.archive and apackage.joss == nil %} | ||
{% assign raw_string = apackage.archive %} | ||
{% if raw_string contains "github.com" %} | ||
<!-- If github is in the link, it's a link to a tag --> | ||
<li> | ||
<a href="{{ raw_string }}" rel="permalink"> | ||
<i class="fas fa-bookmark fa-fw"></i> GitHub Tag: | ||
</a> | ||
</li> | ||
{% elsif raw_string contains "latest" %} | ||
<li>Missing tagged DOI</li> | ||
{% elsif raw_string contains "doi.org/" %} | ||
<!-- This isn't working when the badge is latest doi because it has zenodo.org not doi.org --> | ||
|
||
{% assign doi_url = raw_string | split: 'doi.org/' | last %} | ||
{% assign doi = doi_url | split: ')' | first %} | ||
<li> | ||
Cite: <a href="https://doi.org/{{ doi }}" rel="permalink"> | ||
<img src="https://zenodo.org/badge/DOI/{{ doi | uri_escape }}.svg" alt="DOI badge for {{ doi }}"> | ||
</a> | ||
</li> | ||
{% endif %} | ||
{% endif %} | ||
|
||
{% if apackage.joss %} | ||
<li><a href="{{ apackage.archive }}" rel="permalink"><i class="fas fa-bookmark fa-fw"></i> JOSS Approved</a></li> | ||
{% assign raw_string = apackage.joss %} | ||
{%- comment -%} | ||
Split to isolate the DOI URL from the markdown string | ||
{%- endcomment -%} | ||
{% assign doi_url = raw_string | split: 'doi.org/' | last %} | ||
{% assign doi_url = doi_url | split: ')' | first %} | ||
<li><i class="fa-solid fa-thumbs-up"></i> Cite: | ||
<a href="https://doi.org/{{ doi_url }}" target="_blank"> | ||
<img src="https://zenodo.org/badge/DOI/{{ doi_url | uri_escape }}.svg" alt="DOI badge for {{ doi }}"> | ||
</a> | ||
</li> | ||
{% endif %} | ||
{% if apackage.astropy %} | ||
True | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the line that currently isn't working for some reason. It could be that we need a better flag or it could be that it has to parse the list of communities associated with the package (which is likely the case). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this was actually fixed in #544 . we now capture astropy in a partners list which will scale better than a single bool |
||
<li><a href="communities/astropy.html"><i class="fa-solid fa-check-double"></i> <img src="http://img.shields.io/badge/Affiliated-Astropy-orange.svg?style=flat" alt="Astropy" /></a></li> | ||
{% endif %} | ||
{% if apackage.sunpy %} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This parses the string to determine what type or url it is. We could do this in pyosmeta to make life easier potentially. If it's a latest DOI, maybe we just use those words vs the archive. it's still a valid citation.
this also will fail if the DOI provided is off in some way (i haven't figured out why some are off but i'm assuming there could be typos etc).