Skip to content
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

v1.3.0 #274

Merged
merged 18 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions .github/workflows/build-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
runs-on: ubuntu-latest

steps:
# for debugging
- uses: crazy-max/ghaction-dump-context@v2
- name: Debug dump
vincerubinetti marked this conversation as resolved.
Show resolved Hide resolved
uses: crazy-max/ghaction-dump-context@v2

- name: Checkout branch contents
uses: actions/checkout@v4
Expand All @@ -42,14 +42,22 @@ jobs:
id: pages
uses: actions/configure-pages@v4

# for debugging
- if: runner.debug == '1'
- uses: jwalton/gh-find-current-pr@master
vincerubinetti marked this conversation as resolved.
Show resolved Hide resolved
if: github.event.action != 'closed'
id: pr
with:
state: all

- name: SSH debug
if: runner.debug == '1'
uses: mxschmitt/action-tmate@v3

- name: Build preview version of site
if: github.event.action != 'closed'
run: |
JEKYLL_ENV=production bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path || '' }}/${{ env.PREVIEWS_FOLDER }}/pr-${{ github.event.number }}"
JEKYLL_ENV=production bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path || '' }}/${{ env.PREVIEWS_FOLDER }}/pr-${{ env.pr }}"
env:
pr: ${{ steps.pr.outputs.pr }}

- name: Commit preview to Pages branch
uses: rossjrw/pr-preview-action@v1.4.7
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
runs-on: ubuntu-latest

steps:
# for debugging
- uses: crazy-max/ghaction-dump-context@v2
- name: Debug dump
uses: crazy-max/ghaction-dump-context@v2

- name: Checkout branch contents
uses: actions/checkout@v4
Expand All @@ -36,8 +36,8 @@ jobs:
id: pages
uses: actions/configure-pages@v4

# for debugging
- if: runner.debug == '1'
- name: SSH debug
if: runner.debug == '1'
uses: mxschmitt/action-tmate@v3

- name: Set root url
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/first-time-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
runs-on: ubuntu-latest

steps:
# for debugging
- uses: crazy-max/ghaction-dump-context@v2
- name: Debug dump
uses: crazy-max/ghaction-dump-context@v2

- name: Create Pages branch
uses: peterjgrainger/action-create-branch@v3.0.0
Expand All @@ -28,8 +28,8 @@ jobs:
with:
ref: gh-pages

# for debugging
- if: runner.debug == '1'
- name: SSH debug
if: runner.debug == '1'
uses: mxschmitt/action-tmate@v3

# clean slate, as if starting from orphan branch
Expand Down Expand Up @@ -70,8 +70,8 @@ jobs:
run: |
user="${{ github.repository_owner }}"
description="An engaging 1-3 sentence description of your lab."
printf "USER=${user}" >> $GITHUB_ENV
printf "DESCRIPTION=${description}" >> $GITHUB_ENV
printf "\nUSER=${user}" >> $GITHUB_ENV
vincerubinetti marked this conversation as resolved.
Show resolved Hide resolved
printf "\nDESCRIPTION=${description}" >> $GITHUB_ENV

- name: Personalize readme for user
run: |
Expand Down
File renamed without changes.
5 changes: 0 additions & 5 deletions .github/workflows/on-schedule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,3 @@ jobs:
uses: ./.github/workflows/update-citations.yaml
with:
open-pr: true

build-preview:
needs: update-citations
if: needs.update-citations.outputs.changed == 'true'
uses: ./.github/workflows/build-preview.yaml
19 changes: 14 additions & 5 deletions .github/workflows/update-citations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,40 @@ jobs:
timeout-minutes: 15

steps:
# for debugging
- uses: crazy-max/ghaction-dump-context@v2
- name: Debug dump
uses: crazy-max/ghaction-dump-context@v2

- name: Checkout branch contents
if: github.event.action != 'closed'
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}

- name: Setup Python
if: github.event.action != 'closed'
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
cache-dependency-path: "**/requirements.txt"

- name: Install Python packages
if: github.event.action != 'closed'
run: |
python -m pip install --upgrade --requirement ./_cite/requirements.txt

# for debugging
- if: runner.debug == '1'
- name: SSH debug
if: runner.debug == '1'
uses: mxschmitt/action-tmate@v3

- name: Build updated citations
if: github.event.action != 'closed'
run: python _cite/cite.py
timeout-minutes: 15

- name: Check if citations changed
if: github.event.action != 'closed'
id: changed
uses: tj-actions/verify-changed-files@v18
with:
Expand All @@ -65,6 +70,7 @@ jobs:

- name: Commit updated citations to branch
if: |
github.event.action != 'closed' &&
steps.changed.outputs.files_changed == 'true' &&
inputs.open-pr != true
uses: stefanzweifel/git-auto-commit-action@v5
Expand All @@ -73,12 +79,15 @@ jobs:

- name: Open pull request with updated citations
if: |
github.event.action != 'closed' &&
steps.changed.outputs.files_changed == 'true' &&
inputs.open-pr == true
uses: peter-evans/create-pull-request@v6
with:
branch: citation-update
title: Periodic citation update
body: |
To see a live preview of this PR, close (not merge) and reopen it.
vincerubinetti marked this conversation as resolved.
Show resolved Hide resolved
vincerubinetti marked this conversation as resolved.
Show resolved Hide resolved

outputs:
changed: ${{ steps.changed.outputs.files_changed }}
changed: ${{ steps.changed.outputs.files_changed || false }}
8 changes: 4 additions & 4 deletions .github/workflows/update-url.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
runs-on: ubuntu-latest

steps:
# for debugging
- uses: crazy-max/ghaction-dump-context@v2
- name: Debug dump
uses: crazy-max/ghaction-dump-context@v2

- name: Get Pages url
id: pages
Expand All @@ -29,8 +29,8 @@ jobs:
- name: Checkout branch contents
uses: actions/checkout@v4

# for debugging
- if: runner.debug == '1'
- name: SSH debug
if: runner.debug == '1'
uses: mxschmitt/action-tmate@v3

# update link to site in readme
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/versioning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
# for debugging
- uses: crazy-max/ghaction-dump-context@v2
- name: Debug dump
uses: crazy-max/ghaction-dump-context@v2
- if: runner.debug == '1'
uses: mxschmitt/action-tmate@v3

Expand Down Expand Up @@ -85,17 +85,17 @@ jobs:
github.event_name == 'push'
runs-on: ubuntu-latest
steps:
# for debugging
- uses: crazy-max/ghaction-dump-context@v2
- name: Debug dump
uses: crazy-max/ghaction-dump-context@v2

- name: Checkout branch contents
uses: actions/checkout@v4

- name: Install packages
run: npm install yaml semver

# for debugging
- if: runner.debug == '1'
- name: SSH debug
if: runner.debug == '1'
uses: mxschmitt/action-tmate@v3

- name: Get version and body
Expand Down
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

Reference: common-changelog.org

## 1.3.0 - 2024-08-16

### Changed

- List component `filters` parameter changed to `filter` and now takes any Ruby expression instead of the existing custom syntax.
Example: `filters="publisher: bioRxiv, date: ^2020"` becomes `filter="publisher == 'bioRxiv' and date =~ /^2020/"`.
See docs for more info.
- Fix rare bug where data (e.g. a paper title) containing certain characters (e.g. a double quote) can mess up HTML rendering.
- Fix "first time setup" workflow bug.
- Tweak GitHub Actions debugging/logging.

### Added

- Styling for `<details>` HTML element.

## 1.2.2 - 2024-06-05

### Added
Expand Down Expand Up @@ -37,7 +52,7 @@ Reference: common-changelog.org

- Add `image` param to support blog post thumbnails.
- Add `html-proofer` plugin that checks for broken images/links/etc.
- Add `remove` flag to remove a source from a metasource.
- Add `remove` flag to remove a source from a metasource.

## 1.1.6 - 2023-10-06

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.2.2
date-released: 2024-06-05
version: 1.3.0
date-released: 2024-08-16
url: "https://github.com/greenelab/lab-website-template"
authors:
- family-names: "Rubinetti"
Expand Down
4 changes: 2 additions & 2 deletions _includes/button.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
class="button"
href="{{ button.link | replace: "$LINK", button.link | relative_url }}"
{% if button.tooltip %}
data-tooltip="{{ button.tooltip }}"
data-tooltip="{{ button.tooltip | xml_escape }}"
vincerubinetti marked this conversation as resolved.
Show resolved Hide resolved
{% endif %}
data-style="{{ include.style }}"
{% if include.flip %}
data-flip
{% endif %}
aria-label="{{ button.tooltip | default: button.icon | default: "button" }}"
aria-label="{{ button.tooltip | default: button.icon | default: "button" | xml_escape }}"
>
{% include icon.html icon=button.icon %}
{% if button.text and button.text != "" %}
Expand Down
12 changes: 6 additions & 6 deletions _includes/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<div class="card" data-style="{{ include.style }}">
<a
{% if include.link %}
href="{{ include.link | relative_url }}"
href="{{ include.link | relative_url | xml_escape }}"
{% endif %}
aria-label="{{ include.title | default: "card link" }}"
aria-label="{{ include.title | default: "card link" | xml_escape }}"
class="card-image"
>
<img
src="{{ include.image | relative_url }}"
alt="{{ include.title | default: "card image" }}"
src="{{ include.image | relative_url | xml_escape }}"
alt="{{ include.title | default: "card image" | xml_escape }}"
loading="lazy"
{% include fallback.html %}
>
Expand All @@ -19,10 +19,10 @@
{% if include.title %}
<a
{% if include.link %}
href="{{ include.link | relative_url }}"
href="{{ include.link | relative_url | xml_escape }}"
{% endif %}
{% if include.tooltip %}
data-tooltip="{{ include.tooltip }}"
data-tooltip="{{ include.tooltip | xml_escape }}"
{% endif %}
class="card-title"
>
Expand Down
12 changes: 6 additions & 6 deletions _includes/citation.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
{% if include.style == "rich" %}
<a
{% if citation.link %}
href="{{ citation.link | relative_url }}"
href="{{ citation.link | relative_url | xml_escape }}"
{% endif %}
class="citation-image"
aria-label="{{ citation.title | default: "citation link" }}"
aria-label="{{ citation.title | default: "citation link" | xml_escape }}"
>
<img
src="{{ citation.image | relative_url }}"
alt="{{ citation.title | default: "citation image" }}"
src="{{ citation.image | relative_url | xml_escape }}"
alt="{{ citation.title | default: "citation image" | xml_escape }}"
loading="lazy"
{% include fallback.html %}
>
Expand All @@ -33,7 +33,7 @@

<a
{% if citation.link %}
href="{{ citation.link | relative_url }}"
href="{{ citation.link | relative_url | xml_escape }}"
{% endif %}
class="citation-title"
>
Expand All @@ -43,7 +43,7 @@
<div
class="citation-authors"
{% if citation.authors.size > 10 %}
data-tooltip="{{ citation.authors | join: ", " }} "
data-tooltip="{{ citation.authors | join: ", " | xml_escape }}"
{% endif %}
tabindex="0"
>
Expand Down
4 changes: 2 additions & 2 deletions _includes/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

{% for section in sections %}
{% assign dark = section | regex_scan: "dark: (.*);" | default: "" %}
{% assign background = section
{% assign image = section
| regex_scan: "background: (.*);"
| default: nil
%}
Expand All @@ -24,7 +24,7 @@
data-dark="{{ dark }}"
{% endif %}
{% if background %}
style="--image: url('{{ background | relative_url }}')"
style="--image: url('{{ image | relative_url | xml_escape }}')"
{% endif %}
>
{{ section }}
Expand Down
8 changes: 4 additions & 4 deletions _includes/feature.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
>
<a
{% if include.link %}
href="{{ include.link | relative_url }}"
href="{{ include.link | relative_url | xml_escape }}"
{% endif %}
class="feature-image"
aria-label="{{ include.title | default: "feature link" }}"
aria-label="{{ include.title | default: "feature link" | xml_escape }}"
>
<img
src="{{ include.image | relative_url }}"
src="{{ include.image | relative_url | xml_escape }}"
loading="lazy"
alt="{{ include.title | default: "feature image" }}"
alt="{{ include.title | default: "feature image" | xml_escape }}"
{% include fallback.html %}
>
</a>
Expand Down
Loading