diff --git a/.github/workflows/build-preview.yaml b/.github/workflows/build-preview.yaml index 3ef0404422..c5469b8996 100644 --- a/.github/workflows/build-preview.yaml +++ b/.github/workflows/build-preview.yaml @@ -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 @@ -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 + 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 diff --git a/.github/workflows/build-site.yaml b/.github/workflows/build-site.yaml index 6194c83b5a..08a9426c4e 100644 --- a/.github/workflows/build-site.yaml +++ b/.github/workflows/build-site.yaml @@ -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 @@ -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 diff --git a/.github/workflows/first-time-setup.yaml b/.github/workflows/first-time-setup.yaml index 415e2842a0..eb0274a865 100644 --- a/.github/workflows/first-time-setup.yaml +++ b/.github/workflows/first-time-setup.yaml @@ -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 @@ -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 @@ -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: | diff --git a/.github/workflows/on-pull-request.yml b/.github/workflows/on-pull-request.yaml similarity index 100% rename from .github/workflows/on-pull-request.yml rename to .github/workflows/on-pull-request.yaml diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yaml similarity index 100% rename from .github/workflows/on-push.yml rename to .github/workflows/on-push.yaml diff --git a/.github/workflows/on-schedule.yaml b/.github/workflows/on-schedule.yaml index ad1fe95a7a..e1f8898b19 100644 --- a/.github/workflows/on-schedule.yaml +++ b/.github/workflows/on-schedule.yaml @@ -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 diff --git a/.github/workflows/update-citations.yaml b/.github/workflows/update-citations.yaml index f6ff6ec23a..a651b0f6dd 100644 --- a/.github/workflows/update-citations.yaml +++ b/.github/workflows/update-citations.yaml @@ -28,16 +28,18 @@ 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" @@ -45,18 +47,21 @@ jobs: 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: @@ -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 @@ -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 (don't merge) and reopen it. outputs: - changed: ${{ steps.changed.outputs.files_changed }} + changed: ${{ steps.changed.outputs.files_changed || false }} diff --git a/.github/workflows/update-url.yaml b/.github/workflows/update-url.yaml index b3573a547b..f42296d79c 100644 --- a/.github/workflows/update-url.yaml +++ b/.github/workflows/update-url.yaml @@ -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 @@ -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 diff --git a/.github/workflows/versioning.yaml b/.github/workflows/versioning.yaml index e148f366b7..bb537fde10 100644 --- a/.github/workflows/versioning.yaml +++ b/.github/workflows/versioning.yaml @@ -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 @@ -85,8 +85,8 @@ 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 @@ -94,8 +94,8 @@ jobs: - 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 35da88ea80..9688fabc3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 `
` HTML element. + ## 1.2.2 - 2024-06-05 ### Added @@ -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 diff --git a/CITATION.cff b/CITATION.cff index 2ded51e8d2..493aba6404 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -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" diff --git a/_includes/button.html b/_includes/button.html index 8d1730d739..47ed98bd2e 100644 --- a/_includes/button.html +++ b/_includes/button.html @@ -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" | xml_escape }}" > {% include icon.html icon=button.icon %} {% if button.text and button.text != "" %} diff --git a/_includes/card.html b/_includes/card.html index 600cc9714a..77614b1e12 100644 --- a/_includes/card.html +++ b/_includes/card.html @@ -2,14 +2,14 @@
{{ include.title | default: @@ -19,10 +19,10 @@ {% if include.title %} diff --git a/_includes/citation.html b/_includes/citation.html index 3eb8b2b46d..ce6130aa23 100644 --- a/_includes/citation.html +++ b/_includes/citation.html @@ -13,14 +13,14 @@ {% if include.style == "rich" %} {{ citation.title | default: @@ -33,7 +33,7 @@ @@ -43,7 +43,7 @@
10 %} - data-tooltip="{{ citation.authors | join: ", " }} " + data-tooltip="{{ citation.authors | join: ", " | xml_escape }}" {% endif %} tabindex="0" > diff --git a/_includes/content.html b/_includes/content.html index f9d01c896a..da84666f6a 100644 --- a/_includes/content.html +++ b/_includes/content.html @@ -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 %} @@ -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 }} diff --git a/_includes/feature.html b/_includes/feature.html index 27e33fae7a..ce7cee9530 100644 --- a/_includes/feature.html +++ b/_includes/feature.html @@ -6,15 +6,15 @@ > {{ include.title | default: diff --git a/_includes/figure.html b/_includes/figure.html index a426ff4382..25421ec33e 100644 --- a/_includes/figure.html +++ b/_includes/figure.html @@ -1,18 +1,18 @@
{{ include.caption | default: diff --git a/_includes/footer.html b/_includes/footer.html index 8230d53718..e5ff785431 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -3,7 +3,7 @@