Skip to content

Commit

Permalink
merged changes upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
hyphaltip committed Dec 18, 2024
2 parents e07118a + 2849c60 commit 7253568
Show file tree
Hide file tree
Showing 38 changed files with 247 additions and 113 deletions.
22 changes: 17 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
uses: crazy-max/ghaction-dump-context@v2

- name: Checkout branch contents
uses: actions/checkout@v4
Expand All @@ -32,7 +32,11 @@ jobs:

- name: Install Ruby packages
if: github.event.action != 'closed'
<<<<<<< HEAD
uses: ruby/[email protected]
=======
uses: ruby/setup-ruby@v1
>>>>>>> upstream/main
with:
ruby-version: "3.1"
bundler-cache: true
Expand All @@ -42,14 +46,22 @@ jobs:
id: pages
uses: actions/configure-pages@v4

# for debugging
- if: runner.debug == '1'
- uses: jwalton/gh-find-current-pr@master
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/[email protected]
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/build-site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,18 @@ 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

- name: Install Ruby packages
<<<<<<< HEAD
uses: ruby/[email protected]
=======
uses: ruby/setup-ruby@v1
>>>>>>> upstream/main
with:
ruby-version: "3.1"
bundler-cache: true
Expand All @@ -36,8 +40,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/[email protected]
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
printf "\nDESCRIPTION=${description}" >> $GITHUB_ENV
- name: Personalize readme for user
run: |
Expand Down
File renamed without changes.
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
26 changes: 21 additions & 5 deletions .github/workflows/update-citations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,47 @@ 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: Commit cache
if: failure()
uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: "**/.cache/**"
commit_message: "Commit cache"

- name: Check if citations changed
if: github.event.action != 'closed'
id: changed
uses: tj-actions/verify-changed-files@v18
with:
Expand All @@ -65,6 +77,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 +86,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 (don't merge) and reopen it.
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
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ _site
vendor
debug.log
__pycache__
.cache
!cache.db
.DS_STORE
.env*
package.json
Expand Down
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

Reference: common-changelog.org

## 1.3.1 - 2024-11-11

### Changed

- Update and improve workflows for building site and citations
- Escape user inputs better in rare edge cases

## 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 +59,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.1
date-released: 2024-11-11
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.
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 }}"
{% 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" | regex_strip }}"
>
{% 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 | uri_escape }}"
{% endif %}
aria-label="{{ include.title | default: "card link" }}"
aria-label="{{ include.title | default: "card link" | regex_strip }}"
class="card-image"
>
<img
src="{{ include.image | relative_url }}"
alt="{{ include.title | default: "card image" }}"
src="{{ include.image | relative_url | uri_escape }}"
alt="{{ include.title | default: "card image" | regex_strip }}"
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 | uri_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 | uri_escape }}"
{% endif %}
class="citation-image"
aria-label="{{ citation.title | default: "citation link" }}"
aria-label="{{ citation.title | default: "citation link" | regex_strip }}"
>
<img
src="{{ citation.image | relative_url }}"
alt="{{ citation.title | default: "citation image" }}"
src="{{ citation.image | relative_url | uri_escape }}"
alt="{{ citation.title | default: "citation image" | regex_strip }}"
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
Loading

0 comments on commit 7253568

Please sign in to comment.