Skip to content

Commit

Permalink
V1.2.0 (#244)
Browse files Browse the repository at this point in the history
- add discussion templates. be more aggressive requiring fields.
- update to latest version of all github actions (checking for breaking
changes)
- add debug step to each workflow to allow ssh access in
- fix site.location vs page.url bug (see issue)
- add html-proofer plugin to check for broken images and links, disabled
by default because it adds a lot of time to hot-reload, but set
explicitly as false in config so users can easily flip it on
- update bundler version and re-bundle gems
- add "remove" option for cite-process that allows a user to remove a
source from a metasource. e.g., an ORCID returns a source that the user
doesn't want on their site, so in their sources.yaml they put the id and
remove: true.
- by default, ignore sources that manubot can't cite if they're from
metasources (see changelog)
- add markdownify to more component params
- fix bug in citation (and other) components where when lookup is blank,
first entry in list is always chosen
- make use of newly widely available CSS container queries
- remove compilation-time wrapping of tables because it breaks nested
tables, and is not (practically) possible to support them in the same
way. replace with run-time js plugin for wrapping.
- upgrade font awesome and improve loading mechanism
- fix header title/subtitle CSS bug reported by @Maruuka 
- add "image" param to post excerpt component, so blog posts can have
thumbnails
- fix bug that prevents manual passing of tags to tag component
- add heading 5/6 styles/support
- tweak dark mode plugin
- various style tweaks

New template version checklist:

- [x] I have updated CITATION and CHANGELOG as appropriate.
- [x] I have updated lab-website-template-docs as appropriate.
- [x] I have checked the testbed as appropriate.
- [x] I have tested changed workflows on a freshly generated and forked
repo.
  • Loading branch information
vincerubinetti committed Mar 8, 2024
1 parent 93122f8 commit 48f2dde
Show file tree
Hide file tree
Showing 58 changed files with 709 additions and 305 deletions.
35 changes: 35 additions & 0 deletions .github/DISCUSSION_TEMPLATE/general.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
body:
- type: checkboxes
attributes:
label: Checks
options:
- label: I have searched **[the docs](https://greene-lab.gitbook.io/lab-website-template-docs)**, [existing issues](https://github.com/greenelab/lab-website-template/issues), and [existing discussions](https://github.com/greenelab/lab-website-template/discussions) for answers first.
required: true

- type: input
id: repo
attributes:
label: Link to your website repo
description: "In almost all cases, **we cannot help you if you don't provide this**."
placeholder: ex. https://github.com/greenelab/greenelab.com
validations:
required: true

- type: input
id: version
attributes:
label: Version of Lab Website Template you are using
description: See your `CITATION.cff` file.
placeholder: ex. 1.0.0
validations:
required: true

- type: textarea
id: description
attributes:
label: Description
description: |
Describe your issue in as much detail as possible. For example: What happened? What did you expect to happen? How can we reproduce the problem? What browser are you seeing the problem in?
placeholder: Description
validations:
required: true
35 changes: 35 additions & 0 deletions .github/DISCUSSION_TEMPLATE/q-a.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
body:
- type: checkboxes
attributes:
label: Checks
options:
- label: I have searched **[the docs](https://greene-lab.gitbook.io/lab-website-template-docs)**, [existing issues](https://github.com/greenelab/lab-website-template/issues), and [existing discussions](https://github.com/greenelab/lab-website-template/discussions) for answers first.
required: true

- type: input
id: repo
attributes:
label: Link to your website repo
description: "In almost all cases, **we cannot help you if you don't provide this**."
placeholder: ex. https://github.com/greenelab/greenelab.com
validations:
required: true

- type: input
id: version
attributes:
label: Version of Lab Website Template you are using
description: See your `CITATION.cff` file.
placeholder: ex. 1.0.0
validations:
required: true

- type: textarea
id: description
attributes:
label: Description
description: |
Describe your issue in as much detail as possible. For example: What happened? What did you expect to happen? How can we reproduce the problem? What browser are you seeing the problem in?
placeholder: Description
validations:
required: true
6 changes: 5 additions & 1 deletion .github/ISSUE_TEMPLATE/issue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@ body:
id: repo
attributes:
label: Link to your website repo
description: "**Strongly recommended** so we can help troubleshoot your issue."
description: "In almost all cases, **we cannot help you if you don't provide this**."
placeholder: ex. https://github.com/greenelab/greenelab.com
validations:
required: true

- type: input
id: version
attributes:
label: Version of Lab Website Template you are using
description: See your `CITATION.cff` file.
placeholder: ex. 1.0.0
validations:
required: true

- type: textarea
id: description
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/build-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,37 @@ jobs:

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

- name: Checkout branch contents
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}

- name: Install Ruby packages
if: github.event.action != 'closed'
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@v1.172.0
with:
ruby-version: "3.0"
ruby-version: "3.1"
bundler-cache: true

- name: Get Pages url
if: github.event.action != 'closed'
id: pages
uses: actions/configure-pages@v2
with:
enablement: false
uses: actions/configure-pages@v4

# for debugging
- 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 }}"
- name: Commit preview to Pages branch
uses: rossjrw/pr-preview-action@v1
uses: rossjrw/pr-preview-action@v1.4.7
with:
source-dir: _site
umbrella-dir: ${{ env.PREVIEWS_FOLDER }}
23 changes: 14 additions & 9 deletions .github/workflows/build-site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,35 @@ jobs:

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

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

- name: Install Ruby packages
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@v1.172.0
with:
ruby-version: "3.0"
ruby-version: "3.1"
bundler-cache: true

- name: Get Pages url
id: pages
uses: actions/configure-pages@v2
with:
enablement: false
uses: actions/configure-pages@v4

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

- name: Set root url
run: |
echo "\n\nurl: ${{ steps.pages.outputs.origin }}" >> _config.yaml
- name: Build live version of site
run: |
JEKYLL_ENV=production bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path || '' }}"
- name: Commit live site to Pages branch
uses: JamesIves/github-pages-deploy-action@v4
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
folder: _site
clean-exclude: ${{ env.PREVIEWS_FOLDER }}
Expand Down
26 changes: 15 additions & 11 deletions .github/workflows/first-time-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,24 @@ jobs:

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

- name: Create Pages branch
uses: peterjgrainger/action-create-branch@v2.4.0
uses: peterjgrainger/action-create-branch@v3.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: "gh-pages"

- name: Checkout Pages branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: gh-pages

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

# clean slate, as if starting from orphan branch
- name: Clear Pages branch
run: rm -rf * .github .docker .gitignore
Expand All @@ -41,26 +44,27 @@ jobs:
run: echo "Placeholder homepage" > index.html

- name: Commit changes to Pages branch
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: gh-pages
commit_message: "Clear branch"

- name: Checkout main branch
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Remove files user doesn't need
run: |
rm -rf \
CHANGELOG.md \
testbed.md \
.github/ISSUE_TEMPLATE \
.github/DISCUSSION_TEMPLATE \
.github/workflows/versioning.yaml \
.github/pull_request_template.md \
- name: Rename files
run: |
mv .github/user_pull_request_template.md .github/pull_request_template.md
mv -f .github/user_pull_request_template.md .github/pull_request_template.md
- name: Set vars for personalization
run: |
Expand All @@ -80,7 +84,7 @@ jobs:
" > README.md
- name: Personalize Jekyll config for user
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
const { readFileSync, writeFileSync } = require("fs");
Expand All @@ -97,7 +101,7 @@ jobs:
writeFileSync(file, contents);
- name: Personalize homepage for user
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
const { readFileSync, writeFileSync } = require("fs");
Expand All @@ -109,6 +113,6 @@ jobs:
writeFileSync(file, contents);
- name: Commit changed files
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Setup repo"
17 changes: 10 additions & 7 deletions .github/workflows/update-citations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,16 @@ jobs:

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

- name: Checkout branch contents
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
Expand All @@ -49,13 +48,17 @@ jobs:
run: |
python -m pip install --upgrade --requirement ./_cite/requirements.txt
# for debugging
- if: runner.debug == '1'
uses: mxschmitt/action-tmate@v3

- name: Build updated citations
run: python _cite/cite.py
timeout-minutes: 15

- name: Check if citations changed
id: changed
uses: tj-actions/verify-changed-files@v13
uses: tj-actions/verify-changed-files@v18
with:
files: |
_data/citations.yaml
Expand All @@ -64,15 +67,15 @@ jobs:
if: |
steps.changed.outputs.files_changed == 'true' &&
inputs.open-pr != true
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update citations"

- name: Open pull request with updated citations
if: |
steps.changed.outputs.files_changed == 'true' &&
inputs.open-pr == true
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v6
with:
branch: citation-update
title: Periodic citation update
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/update-url.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,22 @@ jobs:

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

- name: Get Pages url
id: pages
uses: actions/configure-pages@v2
with:
enablement: false
uses: actions/configure-pages@v4

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

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

# update link to site in readme
- name: Update readme
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
const { readFileSync, writeFileSync } = require("fs");
Expand All @@ -53,14 +54,14 @@ jobs:
- name: Check if readme changed
id: changed
uses: tj-actions/verify-changed-files@v13
uses: tj-actions/verify-changed-files@v18
with:
files: |
README.md
- name: Commit changed files
if: steps.changed.outputs.files_changed == 'true'
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update url"

Expand Down
Loading

0 comments on commit 48f2dde

Please sign in to comment.