Skip to content

Commit

Permalink
v1.1.3 (#185)
Browse files Browse the repository at this point in the history
Closes #181 and #180 
Closes #179 

- fix typo in first-time-setup.yaml
- fix versioning workflow tag/release
- tweak some cite.py and _plugins comments
- add commented out `continue` for if user wants to discard sources that
have ids that can't be cited by Manubot, per #186 discussion
- clean Manubot title/authors/publisher/etc output. trim whitespace and
filter.
- fix citation, portrait, and float css

The tagging/releasing step is now reverted to [how I had it in
v1.1.0](https://github.com/greenelab/lab-website-template/pull/166/files#diff-67cc7f4d3d06063e6239e59de699c4a2c768ba544777ded6aa22ab45aa0ad24a),
just using `ncipollo/release-action` for both the tag and the release,
and removing `mathieudutour/github-tag-action`. Idk why I keep going
back and forth. I guess the last time I tried using just `ncipollo` it
didn't work? But it seems to be working now (links ephemeral):

https://github.com/vincerubinetti/lwt-test/pull/2
https://github.com/vincerubinetti/lwt-test/releases/tag/v1.1.4

---------

Co-authored-by: vincerubinetti <vincerubinetti@users.noreply.github.com>
  • Loading branch information
vincerubinetti and vincerubinetti authored Apr 20, 2023
1 parent 5259ec4 commit a0f0e26
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/first-time-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
.github/pull_request_template.md \
- name: Rename files
run: \
run: |
mv .github/user_pull_request_template.md .github/pull_request_template.md
- name: Set vars for personalization
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/versioning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,10 @@ jobs:
return { version, body };
- name: Create tag
id: tag
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ fromJson(steps.version.outputs.result).version }}

- name: Create GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ fromJson(steps.version.outputs.result).version }}
name: ${{ fromJson(steps.version.outputs.result).version }}
commit: ${{ github.ref }}
tag: v${{ fromJson(steps.version.outputs.result).version }}
name: v${{ fromJson(steps.version.outputs.result).version }}
body: ${{ fromJson(steps.version.outputs.result).body }}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

Reference: common-changelog.org

## 1.1.3 - 2023-04-20

### Changed

- Fix first-time-setup mv bug.
- Fix citation, float, and portrait component CSS.
- Filter and trim citation info fields.

## 1.1.2 - 2023-04-11

### Changed
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# citation metadata for the template itself

title: "Lab Website Template"
version: 1.1.2
date-released: 2023-04-11
version: 1.1.3
date-released: 2023-04-20
url: "https://github.com/greenelab/lab-website-template"
authors:
- family-names: "Rubinetti"
Expand Down
Binary file modified _cite/.cache/cache.db
Binary file not shown.
8 changes: 5 additions & 3 deletions _cite/cite.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,17 @@
# run Manubot and set citation
citation = cite_with_manubot(_id)

# if Manubot cannot cite source
except Exception as e:
# if manually-entered source, throw error on cite failure
# if regular source (id entered by user), throw error
if source.get("plugin") == "sources.py":
log(e, 3, "ERROR")
error = True
# otherwise, just warn
# (Manubot might not know how to cite every type of source from orcid, e.g.)
# otherwise, if from metasource (id retrieved from some third-party API), just warn
else:
log(e, 3, "WARNING")
# discard source
# continue

# preserve fields from input source, overriding existing fields
citation.update(source)
Expand Down
19 changes: 10 additions & 9 deletions _cite/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,19 +174,20 @@ def cite_with_manubot(_id):
citation["id"] = _id

# title
citation["title"] = manubot.get("title", "")
citation["title"] = manubot.get("title", "").strip()

# authors
citation["authors"] = []
for author in manubot.get("author", []):
given = author.get("given", "")
family = author.get("family", "")
citation["authors"].append(given + " " + family)
given = author.get("given", "").strip()
family = author.get("family", "").strip()
if given or family:
citation["authors"].append(" ".join([given, family]))

# publisher
container = manubot.get("container-title", "")
collection = manubot.get("collection-title", "")
publisher = manubot.get("publisher", "")
container = manubot.get("container-title", "").strip()
collection = manubot.get("collection-title", "").strip()
publisher = manubot.get("publisher", "").strip()
citation["publisher"] = container or publisher or collection or ""

# extract date part
Expand All @@ -199,7 +200,7 @@ def date_part(citation, index):
# date
year = date_part(manubot, 0)
if year:
# fallbacks for no month or day
# fallbacks for month and day
month = date_part(manubot, 1) or "1"
day = date_part(manubot, 2) or "1"
citation["date"] = format_date(f"{year}-{month}-{day}")
Expand All @@ -208,7 +209,7 @@ def date_part(citation, index):
citation["date"] = ""

# link
citation["link"] = manubot.get("URL", "")
citation["link"] = manubot.get("URL", "").strip()

# return citation data
return citation
20 changes: 20 additions & 0 deletions _data/citations.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# DO NOT EDIT, GENERATED AUTOMATICALLY

- id: doi:10.1093/nar/gkad289
title: 'MyGeneset.info: an interactive and programmatic platform for community-curated
and user-created collections of genes'
authors:
- Ricardo Avila
- Vincent Rubinetti
- Xinghua Zhou
- Dongbo Hu
- Zhongchao Qian
- Marco Alvarado Cano
- Everaldo Rodolpho
- Ginger Tsueng
- Casey Greene
- Chunlei Wu
publisher: Nucleic Acids Research
date: '2023-04-18'
link: https://doi.org/gr5hb5
orcid: 0000-0002-4655-3773
plugin: orcid.py
file: orcid.yaml
- id: doi:10.1101/2023.01.05.522941
title: Hetnet connectivity search provides rapid insights into how two biomedical
entities are related
Expand Down
2 changes: 1 addition & 1 deletion _plugins/array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Jekyll
module ArrayFilters
# filter out empty entries from array
# filter out empty and trim entries in array
def array_filter(array)
return array
.map{|x| x.is_a?(String) ? x.strip() : x}
Expand Down
2 changes: 2 additions & 0 deletions _styles/citation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ $wrap: 800px;
display: inline-flex;
flex-wrap: wrap;
gap: 15px;
max-width: 100%;
height: min-content;
padding: 20px;
padding-left: 30px;
text-align: left;
overflow-wrap: break-word;
z-index: 0;
}

Expand Down
1 change: 1 addition & 0 deletions _styles/float.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ $wrap: 600px;
float: unset !important;
clear: both !important;
margin: auto !important;
max-width: unset;
}
}
9 changes: 5 additions & 4 deletions _styles/portrait.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,17 @@

.portrait-role .icon {
position: absolute;
left: 8px;
top: 8px;
left: 0;
top: 0;
display: flex;
justify-content: center;
align-items: center;
width: 2em;
height: 2em;
width: 20%;
aspect-ratio: 1 / 1;
border-radius: 999px;
background: var(--background);
box-shadow: var(--shadow);
transform: translate(14%, 14%);
}

.portrait[data-style="small"] .portrait-role .icon {
Expand Down

0 comments on commit a0f0e26

Please sign in to comment.