Skip to content

Commit

Permalink
Merge pull request #60 from UCLH-Foundry/status-indicator
Browse files Browse the repository at this point in the history
Jekyllify at build time / status indicator
  • Loading branch information
tcouch authored Jan 29, 2024
2 parents d792428 + cb7cd95 commit b051d25
Show file tree
Hide file tree
Showing 22 changed files with 340 additions and 212 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/jekyll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,30 @@ concurrency:
cancel-in-progress: false

jobs:
# Generate Jekyll front-matter
jekyllify:
runs-on: ubuntu-latest
steps:
- name: Checkout code repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Python dependencies
run: pip install -r requirements.txt
- name: Run jekyllify script
run: python ./_utils/jekyllify.py
- name: Export Jekyllified _projects
uses: actions/upload-artifact@v4
with:
name: jekyllified-projects
path: ./_projects
retention-days: 1
# Build job
build:
runs-on: ubuntu-latest
needs: jekyllify
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -42,6 +63,11 @@ jobs:
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Import Jekyllified _projects
uses: actions/download-artifact@v4
with:
name: jekyllified-projects
path: ./_projects
- name: Build with Jekyll
# Outputs to the './_site' directory by default
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/jekyllify.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Jekyllify projects
on:
on:
workflow_dispatch:

jobs:
Expand All @@ -12,6 +12,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Python dependencies
run: pip install -r requirements.txt
- name: Run jekyllify script
run: python ./_utils/jekyllify.py
- name: Commit changes
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/project_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install requirements
run: pip install -r requirements.txt
- name: Run Check projects script
run: python ./_utils/check_projects.py # Should raise error if misconfigured
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ _site
.jekyll-cache
.jekyll-metadata
vendor
*.pyc
28 changes: 18 additions & 10 deletions _includes/project_card.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
<div class="col">
<div class="card mb-3 project-card" style="height: 18rem">
<div class="card-header">
<h5>{{project.title}}</h5>
<div class="row justify-content-between">
<div class="col-9">
<h5>{{project.title}}</h5>
</div>
<div class="col-3">
<p><span class="badge rounded-pill {{project.status}}">{{project.status}}</span></p>
</div>
</div>

<small class="text-muted">
{%- if project.authors -%} {%- for author in project.authors -%}
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
<span class="p-author h-card" itemprop="name"
>{{ author }}</span
></span
>
{%- if forloop.last == false -%}, {%- endif -%} {%- endfor -%} {%- endif
-%}
<small class="text-muted authors">
{%- if project.authors -%}
{% capture authors %}
{%- for author in project.authors -%}
{{ author }}
{%- if forloop.last == false -%},{%- endif -%}
{%- endfor -%}
{% endcapture %}
{{authors | replace: ",", ", " | truncate:40}}<span class="tooltiptext">{{authors | replace: ",", ", "}}</span>
{%- endif -%}
</small>
</div>

Expand Down
2 changes: 1 addition & 1 deletion _layouts/project.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<article class="post h-entry" itemscope itemtype="http://schema.org/BlogPosting">

<header class="post-header">
<h1 class="post-title p-name" itemprop="name headline">{{ page.title | escape }}</h1>
<h1 class="post-title p-name" itemprop="name headline">{{ page.title | escape }} <span class="badge rounded-pill {{page.status}}">{{page.status}}</span></h1>
<p class="post-meta">
{%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%}
<time class="dt-published" datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">
Expand Down
3 changes: 2 additions & 1 deletion _projects/cheese_therapy/index.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
layout: project
title: Cheese Therapy
status: completed
authors:
- Anne Onamus
- Professor Plum
tabs:
- {
name: laaitepn,
name: nfdczlns,
type: html,
source: _data.html,
label: Data
Expand Down
1 change: 1 addition & 0 deletions _projects/cheese_therapy/status.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
completed
4 changes: 2 additions & 2 deletions _projects/fainting_goats/index.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
layout: project
title: Fainting Goats
status: ongoing
authors:
- Professor Plum
- Doctor Foster
tabs:
- {
name: tetqfbgs,
name: mswpiksq,
type: html,
source: _03_data.html,
label: Data
Expand All @@ -16,4 +17,3 @@ tabs:
The myotonic goat or Tennessee fainting goat is an American breed of goat. It is characterised by myotonia congenita, a hereditary condition that may cause it to stiffen or fall over when excited or startled. It may also be known as the fainting goat, falling goat, stiff-legged goat or nervous goat, or as the Tennessee wooden-leg goat. Four goats of this type were brought to Tennessee in the 1880s.

Myotonic goats tend to be less preferred for sustainable meat production.

5 changes: 3 additions & 2 deletions _projects/mega_project_1/index.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
---
layout: project
title: CT-Guided Flu Surgery
status: ongoing
authors:
- Anne Onamus
- Sue Donnymous
tabs:
- {
name: ekyhlyxx,
name: cewrmnjb,
type: html,
source: _quarto_example.html,
label: Quarto Example
}
- {
name: helqsiwe,
name: brfgsjgq,
type: html,
source: _09_data.html,
label: Data
Expand Down
7 changes: 4 additions & 3 deletions _projects/scurvy_time/index.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
---
layout: project
title: Scurvy Time
status: ongoing
authors:
- Test Testerson
- Trial Runner
tabs:
- {
name: vphbybwh,
name: dmomqdnd,
type: md,
source: _analysis.md,
label: Analysis
}
- {
name: npuufhpv,
name: zdoffrva,
type: md,
source: _gdpr.md,
label: Gdpr
}
- {
name: kqfokysy,
name: meurbgjb,
type: html,
source: _data.html,
label: Data
Expand Down
21 changes: 0 additions & 21 deletions _projects/testing_times/index.md
Original file line number Diff line number Diff line change
@@ -1,22 +1 @@
---
layout: project
title: Testing Times
authors:
- Gabriel Garcia Marquez
- John Steinbeck
tabs:
- {
name: xhvqnaie,
type: md,
source: _01_extra.md,
label: Extra
}
- {
name: hrlnufqz,
type: html,
source: _02_data.html,
label: Data
}
---

This is a test. Please ignore. Happy Christmas!
6 changes: 6 additions & 0 deletions _projects/testing_times/metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
title: Botox riot
status: ongoing
authors:
- John Steinbeck
- Gabriel Garcia Marquez
- Bertrand Russell
3 changes: 2 additions & 1 deletion _projects/uclh_mock_data/index.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
layout: project
title: Uclh Mock Data
status: completed
authors:
- Amusing Automaton
- Frenetic Archmage
- Combustible Squeleton
tabs:
- {
name: nvzjwkrj,
name: esbjvaax,
type: html,
source: _01_data.html,
label: Data
Expand Down
1 change: 1 addition & 0 deletions _projects/uclh_mock_data/status.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
completed
63 changes: 55 additions & 8 deletions _sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,22 @@ a {
padding-left: 3rem !important;
padding-right: 5rem !important;

a:hover {
color: var(--accent-colour);
}

.navbar-brand {
color: #fff;
font: 800 2rem Arial, Helvetica, sans-serif;
}
.navbar-brand:hover{
color: #fff;
}
.nav-item,
.nav-link {
color: #fff;
}
a:hover {
color: var(--accent-colour);
}

.search-icon {
color: white;
}
Expand All @@ -100,13 +105,13 @@ a {
background-color: var(--secondary);
}
.btn-outline-primary {
color: var(--primary);
border-color: var(--primary);
color: var(--accent-colour);
border-color: var(--accent-colour);
background-color: var(--secondary);
&:hover {
color: var(--secondary);
border-color: var(--primary);
background-color: var(--primary);
color: #fff;
border-color: var(--secondary);
background-color: var(--accent-colour);
}
}
}
Expand Down Expand Up @@ -149,3 +154,45 @@ a {
fill: var(--primary);
}
}

.badge {
font-size: 0.5em;
&.ongoing{
background-color: var(--accent-colour);
}
&.completed{
background-color: var(--primary);
}
}

.project-card .badge {
font-size: 0.75em;
}

.authors .tooltiptext {
visibility: hidden;
width: 300px;
background-color: #555;
color: #fff;
text-align: center;
padding: 5px 0;
border-radius: 6px;

/* Position the tooltip text */
position: absolute;
z-index: 1;
top: 35px;
left: 70px;
// bottom: 2em;
// left: 50%;
margin-left: -60px;

/* Fade in tooltip */
opacity: 0;
transition: opacity 0.3s;
}

.authors:hover .tooltiptext {
visibility: visible;
opacity: 1;
}
Loading

0 comments on commit b051d25

Please sign in to comment.