Skip to content

Commit

Permalink
V1.2.1 (#247)
Browse files Browse the repository at this point in the history
- fix bug where literal yaml date object doesn't get parsed correctly
- fixes addition of site.url by gh-actions workflow

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.
  • Loading branch information
vincerubinetti authored Apr 1, 2024
1 parent 48f2dde commit fcfb29f
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 15 deletions.
4 changes: 1 addition & 3 deletions .docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#! /bin/bash

# print folder contents for debugging
echo "Contents:"
echo ""
printf "\n\nContents:\n\n"
ls
echo ""

# run cite process
python3 _cite/cite.py
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

- name: Set root url
run: |
echo "\n\nurl: ${{ steps.pages.outputs.origin }}" >> _config.yaml
printf "\n\nurl: ${{ steps.pages.outputs.origin }}" >> _config.yaml
- name: Build live version of site
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/first-time-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: touch .nojekyll

- name: Make placeholder homepage
run: echo "Placeholder homepage" > index.html
run: printf "Placeholder homepage" > index.html

- name: Commit changes to Pages branch
uses: stefanzweifel/git-auto-commit-action@v5
Expand Down Expand Up @@ -70,12 +70,12 @@ jobs:
run: |
user="${{ github.repository_owner }}"
description="An engaging 1-3 sentence description of your lab."
echo "USER=${user}" >> $GITHUB_ENV
echo "DESCRIPTION=${description}" >> $GITHUB_ENV
printf "USER=${user}" >> $GITHUB_ENV
printf "DESCRIPTION=${description}" >> $GITHUB_ENV
- name: Personalize readme for user
run: |
echo "
printf "
# ${{ env.USER }}'s Website
Visit **[website url](#)** 🚀
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Reference: common-changelog.org

## 1.2.1 - 2024-04-01

### Changed

- Minor bug fixes in cite process and sitemap generation.

## 1.2.0 - 2024-03-08

### 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.2.0
date-released: 2024-03-08
version: 1.2.1
date-released: 2024-04-01
url: "https://github.com/greenelab/lab-website-template"
authors:
- family-names: "Rubinetti"
Expand Down
12 changes: 7 additions & 5 deletions _cite/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import yaml
from yaml.loader import SafeLoader
from pathlib import Path
from datetime import datetime
from datetime import date, datetime
from rich import print
from diskcache import Cache

Expand Down Expand Up @@ -88,15 +88,17 @@ def list_of_dicts(data):
return isinstance(data, list) and all(isinstance(entry, dict) for entry in data)


def format_date(date):
def format_date(_date):
"""
format date as YYYY-MM-DD, or no date if malformed
"""

if isinstance(date, int):
return datetime.fromtimestamp(date // 1000.0).strftime("%Y-%m-%d")
if isinstance(_date, int):
return datetime.fromtimestamp(_date // 1000.0).strftime("%Y-%m-%d")
if isinstance(_date, (date, datetime)):
return _date.strftime("%Y-%m-%d")
try:
return datetime.strptime(date, "%Y-%m-%d").strftime("%Y-%m-%d")
return datetime.strptime(_date, "%Y-%m-%d").strftime("%Y-%m-%d")
except Exception:
return ""

Expand Down

0 comments on commit fcfb29f

Please sign in to comment.