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.2.1 #247

Merged
merged 5 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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