From d2b095936366b769e6db667021d6c5b8f18208b7 Mon Sep 17 00:00:00 2001 From: tcouch Date: Fri, 15 Dec 2023 12:07:30 +0000 Subject: [PATCH 01/11] Update examples for new format --- _layouts/project.html | 3 +- .../{extra.html => 01_extra.html} | 0 _projects/_project_template/02_additional.md | 1 + _projects/_project_template/authors.txt | 2 ++ _projects/_project_template/index.md | 23 --------------- _projects/cheese_therapy/authors.txt | 2 ++ _projects/cheese_therapy/data.html | 1 + .../index.md} | 14 --------- _projects/fainting_goats/03_data.html | 1 + _projects/fainting_goats/authors.txt | 2 ++ .../index.md} | 14 --------- .../_quarto_example.html | 0 _projects/mega_project_1/authors.txt | 2 ++ .../index.md | 0 .../figure-html/fig-polar-output-1.png | Bin .../libs/bootstrap/bootstrap-icons.css | 0 .../libs/bootstrap/bootstrap-icons.woff | Bin .../libs/bootstrap/bootstrap.min.css | 0 .../libs/bootstrap/bootstrap.min.js | 0 .../libs/clipboard/clipboard.min.js | 0 .../libs/quarto-html/anchor.min.js | 0 .../libs/quarto-html/popper.min.js | 0 .../quarto-syntax-highlighting.css | 0 .../quarto_files/libs/quarto-html/quarto.js | 0 .../quarto_files/libs/quarto-html/tippy.css | 0 .../libs/quarto-html/tippy.umd.min.js | 0 .../_analysis.md | 0 .../_data.html | 0 .../_gdpr.md | 0 .../authors.txt | 2 +- .../index.md | 27 ------------------ 31 files changed, 13 insertions(+), 81 deletions(-) rename _projects/_project_template/{extra.html => 01_extra.html} (100%) create mode 100644 _projects/_project_template/02_additional.md create mode 100644 _projects/_project_template/authors.txt create mode 100644 _projects/cheese_therapy/authors.txt create mode 100644 _projects/cheese_therapy/data.html rename _projects/{example_project_d.md => cheese_therapy/index.md} (88%) create mode 100644 _projects/fainting_goats/03_data.html create mode 100644 _projects/fainting_goats/authors.txt rename _projects/{example_project_c.md => fainting_goats/index.md} (67%) rename _projects/{example_project_b => mega_project_1}/_quarto_example.html (100%) create mode 100644 _projects/mega_project_1/authors.txt rename _projects/{example_project_b => mega_project_1}/index.md (100%) rename _projects/{example_project_b => mega_project_1}/quarto_files/figure-html/fig-polar-output-1.png (100%) rename _projects/{example_project_b => mega_project_1}/quarto_files/libs/bootstrap/bootstrap-icons.css (100%) rename _projects/{example_project_b => mega_project_1}/quarto_files/libs/bootstrap/bootstrap-icons.woff (100%) rename _projects/{example_project_b => mega_project_1}/quarto_files/libs/bootstrap/bootstrap.min.css (100%) rename _projects/{example_project_b => mega_project_1}/quarto_files/libs/bootstrap/bootstrap.min.js (100%) rename _projects/{example_project_b => mega_project_1}/quarto_files/libs/clipboard/clipboard.min.js (100%) rename _projects/{example_project_b => mega_project_1}/quarto_files/libs/quarto-html/anchor.min.js (100%) rename _projects/{example_project_b => mega_project_1}/quarto_files/libs/quarto-html/popper.min.js (100%) rename _projects/{example_project_b => mega_project_1}/quarto_files/libs/quarto-html/quarto-syntax-highlighting.css (100%) rename _projects/{example_project_b => mega_project_1}/quarto_files/libs/quarto-html/quarto.js (100%) rename _projects/{example_project_b => mega_project_1}/quarto_files/libs/quarto-html/tippy.css (100%) rename _projects/{example_project_b => mega_project_1}/quarto_files/libs/quarto-html/tippy.umd.min.js (100%) rename _projects/{example_project_a => scurvy_time}/_analysis.md (100%) rename _projects/{example_project_a => scurvy_time}/_data.html (100%) rename _projects/{example_project_a => scurvy_time}/_gdpr.md (100%) rename _projects/{example_project_a => scurvy_time}/authors.txt (50%) rename _projects/{example_project_a => scurvy_time}/index.md (73%) diff --git a/_layouts/project.html b/_layouts/project.html index e05298b..56a2a22 100644 --- a/_layouts/project.html +++ b/_layouts/project.html @@ -19,9 +19,8 @@

{{ page.title | escape }} {%- endif -%} {%- if page.authors -%} • {% for author in page.authors %} - {% assign person = site.data.people[author] %} + {{ author }} {%- if forloop.last == false %}, {% endif -%} {% endfor %} {%- endif -%}

diff --git a/_projects/_project_template/extra.html b/_projects/_project_template/01_extra.html similarity index 100% rename from _projects/_project_template/extra.html rename to _projects/_project_template/01_extra.html diff --git a/_projects/_project_template/02_additional.md b/_projects/_project_template/02_additional.md new file mode 100644 index 0000000..511142e --- /dev/null +++ b/_projects/_project_template/02_additional.md @@ -0,0 +1 @@ +More content \ No newline at end of file diff --git a/_projects/_project_template/authors.txt b/_projects/_project_template/authors.txt new file mode 100644 index 0000000..b78542c --- /dev/null +++ b/_projects/_project_template/authors.txt @@ -0,0 +1,2 @@ +Alan Ahlberg +Janet Ahlberg \ No newline at end of file diff --git a/_projects/_project_template/index.md b/_projects/_project_template/index.md index e3166c6..50eb32b 100644 --- a/_projects/_project_template/index.md +++ b/_projects/_project_template/index.md @@ -1,24 +1 @@ ---- -title: # project title -tags: # space separated list -layout: project -# Add author data to _data/people and list here: -authors: -- author_1 -# Add additional tabs by linking to other sources -tabs: - - { - name: 'extra', # Two tabs cannot share the same name - type: 'html', # Optional: embed/html/markdown - source: 'extra.html', # filename or embed url - label: 'Extra tab' # Optional: label for tab, defaults to capitalised name - } - - { - name: 'data', - type: 'embed', - source: 'https://www.explainxkcd.com/wiki/images/d/d7/flawed_data.png', - label: 'Data and Code' # Optional: label for tab, defaults to capitalised name - } ---- - Write your project overview in markdown format here \ No newline at end of file diff --git a/_projects/cheese_therapy/authors.txt b/_projects/cheese_therapy/authors.txt new file mode 100644 index 0000000..0240cd3 --- /dev/null +++ b/_projects/cheese_therapy/authors.txt @@ -0,0 +1,2 @@ +Anne Onamus +Professor Plum \ No newline at end of file diff --git a/_projects/cheese_therapy/data.html b/_projects/cheese_therapy/data.html new file mode 100644 index 0000000..24d754e --- /dev/null +++ b/_projects/cheese_therapy/data.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/_projects/example_project_d.md b/_projects/cheese_therapy/index.md similarity index 88% rename from _projects/example_project_d.md rename to _projects/cheese_therapy/index.md index c88ef8d..e047f1f 100644 --- a/_projects/example_project_d.md +++ b/_projects/cheese_therapy/index.md @@ -1,17 +1,3 @@ ---- -title: Cheese therapy -tags: cheese -layout: project -authors: -- author_1 -tabs: - - { - name: 'appendix', - type: 'embed', - source: 'https://widgets.figshare.com/articles/18692549/embed?show_title=1' - } ---- - Stinking bishop manchego cheese triangles. Monterey jack when the cheese comes out everybody's happy goat cream cheese roquefort gouda cheese triangles cheeseburger. Melted cheese lancashire airedale macaroni cheese mozzarella babybel stilton port-salut. Camembert de normandie ricotta cheese triangles who moved my cheese mascarpone manchego roquefort cheese slices. Lancashire. Rubber cheese squirty cheese smelly cheese. Ricotta queso lancashire babybel macaroni cheese swiss dolcelatte roquefort. Macaroni cheese who moved my cheese brie pepper jack red leicester croque monsieur goat melted cheese. Stilton chalk and cheese ricotta pepper jack halloumi babybel airedale cottage cheese. Pepper jack melted cheese cheese slices cottage cheese. diff --git a/_projects/fainting_goats/03_data.html b/_projects/fainting_goats/03_data.html new file mode 100644 index 0000000..35d599a --- /dev/null +++ b/_projects/fainting_goats/03_data.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/_projects/fainting_goats/authors.txt b/_projects/fainting_goats/authors.txt new file mode 100644 index 0000000..44d7b25 --- /dev/null +++ b/_projects/fainting_goats/authors.txt @@ -0,0 +1,2 @@ +Professor Plum +Doctor Foster \ No newline at end of file diff --git a/_projects/example_project_c.md b/_projects/fainting_goats/index.md similarity index 67% rename from _projects/example_project_c.md rename to _projects/fainting_goats/index.md index b9678c5..ae5ee63 100644 --- a/_projects/example_project_c.md +++ b/_projects/fainting_goats/index.md @@ -1,17 +1,3 @@ ---- -title: Fainting goats -tags: goats fainting -layout: project -authors: -- author_1 -- author_3 -tabs: - - { - name: 'data', - type: 'embed', - source: 'https://widgets.figshare.com/articles/17025359/embed?show_title=1'} ---- - 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. diff --git a/_projects/example_project_b/_quarto_example.html b/_projects/mega_project_1/_quarto_example.html similarity index 100% rename from _projects/example_project_b/_quarto_example.html rename to _projects/mega_project_1/_quarto_example.html diff --git a/_projects/mega_project_1/authors.txt b/_projects/mega_project_1/authors.txt new file mode 100644 index 0000000..de29130 --- /dev/null +++ b/_projects/mega_project_1/authors.txt @@ -0,0 +1,2 @@ +Anne Onamus +Sue Donnymous \ No newline at end of file diff --git a/_projects/example_project_b/index.md b/_projects/mega_project_1/index.md similarity index 100% rename from _projects/example_project_b/index.md rename to _projects/mega_project_1/index.md diff --git a/_projects/example_project_b/quarto_files/figure-html/fig-polar-output-1.png b/_projects/mega_project_1/quarto_files/figure-html/fig-polar-output-1.png similarity index 100% rename from _projects/example_project_b/quarto_files/figure-html/fig-polar-output-1.png rename to _projects/mega_project_1/quarto_files/figure-html/fig-polar-output-1.png diff --git a/_projects/example_project_b/quarto_files/libs/bootstrap/bootstrap-icons.css b/_projects/mega_project_1/quarto_files/libs/bootstrap/bootstrap-icons.css similarity index 100% rename from _projects/example_project_b/quarto_files/libs/bootstrap/bootstrap-icons.css rename to _projects/mega_project_1/quarto_files/libs/bootstrap/bootstrap-icons.css diff --git a/_projects/example_project_b/quarto_files/libs/bootstrap/bootstrap-icons.woff b/_projects/mega_project_1/quarto_files/libs/bootstrap/bootstrap-icons.woff similarity index 100% rename from _projects/example_project_b/quarto_files/libs/bootstrap/bootstrap-icons.woff rename to _projects/mega_project_1/quarto_files/libs/bootstrap/bootstrap-icons.woff diff --git a/_projects/example_project_b/quarto_files/libs/bootstrap/bootstrap.min.css b/_projects/mega_project_1/quarto_files/libs/bootstrap/bootstrap.min.css similarity index 100% rename from _projects/example_project_b/quarto_files/libs/bootstrap/bootstrap.min.css rename to _projects/mega_project_1/quarto_files/libs/bootstrap/bootstrap.min.css diff --git a/_projects/example_project_b/quarto_files/libs/bootstrap/bootstrap.min.js b/_projects/mega_project_1/quarto_files/libs/bootstrap/bootstrap.min.js similarity index 100% rename from _projects/example_project_b/quarto_files/libs/bootstrap/bootstrap.min.js rename to _projects/mega_project_1/quarto_files/libs/bootstrap/bootstrap.min.js diff --git a/_projects/example_project_b/quarto_files/libs/clipboard/clipboard.min.js b/_projects/mega_project_1/quarto_files/libs/clipboard/clipboard.min.js similarity index 100% rename from _projects/example_project_b/quarto_files/libs/clipboard/clipboard.min.js rename to _projects/mega_project_1/quarto_files/libs/clipboard/clipboard.min.js diff --git a/_projects/example_project_b/quarto_files/libs/quarto-html/anchor.min.js b/_projects/mega_project_1/quarto_files/libs/quarto-html/anchor.min.js similarity index 100% rename from _projects/example_project_b/quarto_files/libs/quarto-html/anchor.min.js rename to _projects/mega_project_1/quarto_files/libs/quarto-html/anchor.min.js diff --git a/_projects/example_project_b/quarto_files/libs/quarto-html/popper.min.js b/_projects/mega_project_1/quarto_files/libs/quarto-html/popper.min.js similarity index 100% rename from _projects/example_project_b/quarto_files/libs/quarto-html/popper.min.js rename to _projects/mega_project_1/quarto_files/libs/quarto-html/popper.min.js diff --git a/_projects/example_project_b/quarto_files/libs/quarto-html/quarto-syntax-highlighting.css b/_projects/mega_project_1/quarto_files/libs/quarto-html/quarto-syntax-highlighting.css similarity index 100% rename from _projects/example_project_b/quarto_files/libs/quarto-html/quarto-syntax-highlighting.css rename to _projects/mega_project_1/quarto_files/libs/quarto-html/quarto-syntax-highlighting.css diff --git a/_projects/example_project_b/quarto_files/libs/quarto-html/quarto.js b/_projects/mega_project_1/quarto_files/libs/quarto-html/quarto.js similarity index 100% rename from _projects/example_project_b/quarto_files/libs/quarto-html/quarto.js rename to _projects/mega_project_1/quarto_files/libs/quarto-html/quarto.js diff --git a/_projects/example_project_b/quarto_files/libs/quarto-html/tippy.css b/_projects/mega_project_1/quarto_files/libs/quarto-html/tippy.css similarity index 100% rename from _projects/example_project_b/quarto_files/libs/quarto-html/tippy.css rename to _projects/mega_project_1/quarto_files/libs/quarto-html/tippy.css diff --git a/_projects/example_project_b/quarto_files/libs/quarto-html/tippy.umd.min.js b/_projects/mega_project_1/quarto_files/libs/quarto-html/tippy.umd.min.js similarity index 100% rename from _projects/example_project_b/quarto_files/libs/quarto-html/tippy.umd.min.js rename to _projects/mega_project_1/quarto_files/libs/quarto-html/tippy.umd.min.js diff --git a/_projects/example_project_a/_analysis.md b/_projects/scurvy_time/_analysis.md similarity index 100% rename from _projects/example_project_a/_analysis.md rename to _projects/scurvy_time/_analysis.md diff --git a/_projects/example_project_a/_data.html b/_projects/scurvy_time/_data.html similarity index 100% rename from _projects/example_project_a/_data.html rename to _projects/scurvy_time/_data.html diff --git a/_projects/example_project_a/_gdpr.md b/_projects/scurvy_time/_gdpr.md similarity index 100% rename from _projects/example_project_a/_gdpr.md rename to _projects/scurvy_time/_gdpr.md diff --git a/_projects/example_project_a/authors.txt b/_projects/scurvy_time/authors.txt similarity index 50% rename from _projects/example_project_a/authors.txt rename to _projects/scurvy_time/authors.txt index a2e529d..4df8801 100644 --- a/_projects/example_project_a/authors.txt +++ b/_projects/scurvy_time/authors.txt @@ -1,2 +1,2 @@ Test Testerson -Trial Runterton \ No newline at end of file +Trial Runner \ No newline at end of file diff --git a/_projects/example_project_a/index.md b/_projects/scurvy_time/index.md similarity index 73% rename from _projects/example_project_a/index.md rename to _projects/scurvy_time/index.md index 47adff2..c9d4c32 100644 --- a/_projects/example_project_a/index.md +++ b/_projects/scurvy_time/index.md @@ -1,30 +1,3 @@ ---- -layout: project -title: Example Project A -authors: -- Test Testerson -- Trial Runterton -tabs: -- { - name: roozwhna, - type: md, - source: _gdpr.md, - label: Gdpr - } -- { - name: ucqrttey, - type: md, - source: _analysis.md, - label: Analysis - } -- { - name: ndflidwz, - type: html, - source: _data.html, - label: Data - } ---- - Main sheet lugger Jolly Roger grog blossom black spot square-rigged maroon hail-shot chantey bounty. Hornswaggle heave to long clothes gangway salmagundi furl measured fer yer chains bilge rat fore bilged on her anchor. Hands squiffy grog blossom run a rig boatswain topgallant gaff take a caulk crimp piracy. Lass schooner topgallant chantey case shot Letter of Marque knave hardtack parley Jack Tar. Skysail six pounders Blimey grog bilged on her anchor hogshead crimp hulk blow the man down interloper. Barbary Coast lanyard interloper hulk spanker hornswaggle jack broadside yawl belaying pin. From af941f452328ce1bd21bdf2aa4f9e8ca5815d79f Mon Sep 17 00:00:00 2001 From: tcouch Date: Fri, 15 Dec 2023 12:10:06 +0000 Subject: [PATCH 02/11] auto generated front matter --- _projects/_project_template/index.md | 21 +++++++++++++++++++++ _projects/cheese_therapy/index.md | 15 +++++++++++++++ _projects/fainting_goats/index.md | 15 +++++++++++++++ _projects/scurvy_time/index.md | 27 +++++++++++++++++++++++++++ 4 files changed, 78 insertions(+) diff --git a/_projects/_project_template/index.md b/_projects/_project_template/index.md index 50eb32b..a0911cf 100644 --- a/_projects/_project_template/index.md +++ b/_projects/_project_template/index.md @@ -1 +1,22 @@ +--- +layout: project +title: Project Template +authors: +- Alan Ahlberg +- Janet Ahlberg +tabs: +- { + name: fdhfbwlu, + type: md, + source: 02_additional.md, + label: 02 Additional + } +- { + name: cjrvwrst, + type: html, + source: 01_extra.html, + label: 01 Extra + } +--- + Write your project overview in markdown format here \ No newline at end of file diff --git a/_projects/cheese_therapy/index.md b/_projects/cheese_therapy/index.md index e047f1f..3bb30c4 100644 --- a/_projects/cheese_therapy/index.md +++ b/_projects/cheese_therapy/index.md @@ -1,3 +1,18 @@ +--- +layout: project +title: Cheese Therapy +authors: +- Anne Onamus +- Professor Plum +tabs: +- { + name: gipkpglp, + type: html, + source: data.html, + label: Data + } +--- + Stinking bishop manchego cheese triangles. Monterey jack when the cheese comes out everybody's happy goat cream cheese roquefort gouda cheese triangles cheeseburger. Melted cheese lancashire airedale macaroni cheese mozzarella babybel stilton port-salut. Camembert de normandie ricotta cheese triangles who moved my cheese mascarpone manchego roquefort cheese slices. Lancashire. Rubber cheese squirty cheese smelly cheese. Ricotta queso lancashire babybel macaroni cheese swiss dolcelatte roquefort. Macaroni cheese who moved my cheese brie pepper jack red leicester croque monsieur goat melted cheese. Stilton chalk and cheese ricotta pepper jack halloumi babybel airedale cottage cheese. Pepper jack melted cheese cheese slices cottage cheese. diff --git a/_projects/fainting_goats/index.md b/_projects/fainting_goats/index.md index ae5ee63..e2147ed 100644 --- a/_projects/fainting_goats/index.md +++ b/_projects/fainting_goats/index.md @@ -1,3 +1,18 @@ +--- +layout: project +title: Fainting Goats +authors: +- Professor Plum +- Doctor Foster +tabs: +- { + name: rttnzstm, + type: html, + source: 03_data.html, + label: 03 Data + } +--- + 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. diff --git a/_projects/scurvy_time/index.md b/_projects/scurvy_time/index.md index c9d4c32..0f0575e 100644 --- a/_projects/scurvy_time/index.md +++ b/_projects/scurvy_time/index.md @@ -1,3 +1,30 @@ +--- +layout: project +title: Scurvy Time +authors: +- Test Testerson +- Trial Runner +tabs: +- { + name: kykeuoqa, + type: md, + source: _analysis.md, + label: Analysis + } +- { + name: gyvgzvxc, + type: md, + source: _gdpr.md, + label: Gdpr + } +- { + name: vhabbkir, + type: html, + source: _data.html, + label: Data + } +--- + Main sheet lugger Jolly Roger grog blossom black spot square-rigged maroon hail-shot chantey bounty. Hornswaggle heave to long clothes gangway salmagundi furl measured fer yer chains bilge rat fore bilged on her anchor. Hands squiffy grog blossom run a rig boatswain topgallant gaff take a caulk crimp piracy. Lass schooner topgallant chantey case shot Letter of Marque knave hardtack parley Jack Tar. Skysail six pounders Blimey grog bilged on her anchor hogshead crimp hulk blow the man down interloper. Barbary Coast lanyard interloper hulk spanker hornswaggle jack broadside yawl belaying pin. From 9fddf3846c6b471bfd45ff5b646eba552b535afb Mon Sep 17 00:00:00 2001 From: tcouch Date: Fri, 15 Dec 2023 12:12:18 +0000 Subject: [PATCH 03/11] Fix cards to use author directly --- _includes/project_card.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/_includes/project_card.html b/_includes/project_card.html index 25597c6..715e5bc 100644 --- a/_includes/project_card.html +++ b/_includes/project_card.html @@ -4,11 +4,10 @@
{{project.title}}
- {%- if project.authors -%} {%- for author in project.authors -%} {%- - assign person = site.data.people[author] -%} + {%- if project.authors -%} {%- for author in project.authors -%} {%- if forloop.last == false -%}, {%- endif -%} {%- endfor -%} {%- endif From 664847f1b65f094ebabddb419e4e751ab0b7d2ec Mon Sep 17 00:00:00 2001 From: tcouch Date: Fri, 15 Dec 2023 12:31:34 +0000 Subject: [PATCH 04/11] Finesse project template a bit --- _projects/_project_template/01_extra.html | 4 ---- .../{02_additional.md => 01_extra.md} | 0 _projects/_project_template/02_data.html | 5 +++++ _projects/_project_template/index.md | 21 ------------------- 4 files changed, 5 insertions(+), 25 deletions(-) delete mode 100644 _projects/_project_template/01_extra.html rename _projects/_project_template/{02_additional.md => 01_extra.md} (100%) create mode 100644 _projects/_project_template/02_data.html diff --git a/_projects/_project_template/01_extra.html b/_projects/_project_template/01_extra.html deleted file mode 100644 index 4e95277..0000000 --- a/_projects/_project_template/01_extra.html +++ /dev/null @@ -1,4 +0,0 @@ - -

Extra

-

This page appears on another tab

- \ No newline at end of file diff --git a/_projects/_project_template/02_additional.md b/_projects/_project_template/01_extra.md similarity index 100% rename from _projects/_project_template/02_additional.md rename to _projects/_project_template/01_extra.md diff --git a/_projects/_project_template/02_data.html b/_projects/_project_template/02_data.html new file mode 100644 index 0000000..4c016ee --- /dev/null +++ b/_projects/_project_template/02_data.html @@ -0,0 +1,5 @@ + +

Data

+

Here's our synthetic data and code

+ + \ No newline at end of file diff --git a/_projects/_project_template/index.md b/_projects/_project_template/index.md index a0911cf..50eb32b 100644 --- a/_projects/_project_template/index.md +++ b/_projects/_project_template/index.md @@ -1,22 +1 @@ ---- -layout: project -title: Project Template -authors: -- Alan Ahlberg -- Janet Ahlberg -tabs: -- { - name: fdhfbwlu, - type: md, - source: 02_additional.md, - label: 02 Additional - } -- { - name: cjrvwrst, - type: html, - source: 01_extra.html, - label: 01 Extra - } ---- - Write your project overview in markdown format here \ No newline at end of file From e6fd16efd33032cfc9f0f4a2c779e1c3ccc7ff52 Mon Sep 17 00:00:00 2001 From: tcouch Date: Fri, 15 Dec 2023 13:46:37 +0000 Subject: [PATCH 05/11] Update project submission guidelines --- contribute/project_submission.md | 77 +++++++++++++++----------------- 1 file changed, 36 insertions(+), 41 deletions(-) diff --git a/contribute/project_submission.md b/contribute/project_submission.md index c7514c1..974f6d6 100644 --- a/contribute/project_submission.md +++ b/contribute/project_submission.md @@ -17,7 +17,7 @@ If you are a UCLH researcher, you can submit details about your own research pro To help people who are interested in your research to better understand what data you have used and how you process it, it can be helpful to generate a synthetic dataset which you can share together with any relevant computer code in an open-access repository. We recommend using UCL's institutional [research data respository](https://rdr.ucl.ac.uk/) service as it is free for all UCL researchers to use and provides an embed link which can be used to include your data alongside details about your project on this site. Please read the guidance on the [UCL Library Researd Data Repository](https://www.ucl.ac.uk/library/open-science-research-support/research-data-management/ucl-research-data-repository) page for details on how to prepare and upload your data. -Once your submission has been approved, you can find the embed URL by navigating to your deposit's page and selecting 'Embed' from the menu. Copy the src url from the iframe tag and save this for step 3. +Once your submission has been approved, you can find the embed URL by navigating to your deposit's page and selecting 'Embed' from the menu. Copy the iframe tag and include this in one of the html or markdown files you create in Step 3. ## Step 2: Clone our repository on GitHub @@ -29,75 +29,70 @@ The source code for this site can be found on GitHub: [{{site.data.github.url}}] ## Step 3: Complete the project template -Once you have cloned the repository, you will need to create a new branch as you will not be able to merge your changes directly back into the main branch (choose a name that identifies you or your group, and the name of the project): +Once you have cloned the repository, you will need to create a new branch as you will not be able to merge your changes directly back into the main branch. Choose a name that identifies you or your group, and the name of the project, for example: `git switch -c group-a-project-x` -The pages for each project are kept in separate folders under `/_projects`, where you will also find a template for creating new projects: `_project_template`. Copy this folder and name it after your project (this folder name will form part of the url for your project pages). Now complete the following required steps: +The pages for each project are kept in separate folders under `/_projects`, where you will also find a template for creating new projects: `_project_template`. Copy this folder and name it after your project. The name of the folder will be used to generate the title for your project (see below for how to override this). As a minimum your project folder should contain two files: + +* index.md +* authors.txt ### index.md -Every project folder must include a file called index.md, which serves two purposes: -1. It contains frontmatter where you can define variables which Jekyll uses when building your pages -2. It serves as the landing page for your project, where you can write an overview +Every project folder must include a file called index.md, which serves as the landing page for your project. This page should include a lay summary of your project written in [markdown](https://en.wikipedia.org/wiki/Markdown) format. You can include as much detail as you like, but you also have the option to add additional pages if you'd like to split things like discussion of the data analysis or how you protect sensitive data into separate sections (see extra content below). If you're new to markdown, have a look at this [markdown cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) to help you get started. -Front matter at the top of the page starts and ends with triple dashes: '---'. This contains information about the project written in [YAML](https://en.wikipedia.org/wiki/YAML) format such as the project title, authors, and any additional content to include. To start with, enter a project title - we go into more detail about adding authors and extra content below. +### authors.txt +This file is simply a list of all the people you'd like to include as authors on the project. Their names will appear at the top of the page, and on the summary card shown on the website's home page. -Below the front matter you should write your project summary. This should be written in [markdown](https://en.wikipedia.org/wiki/Markdown) format and can be as long as you like. You have the option to add additional pages if you'd like to split things like discussion of the data analysis or how you protect sensitive data into separate sections (see extra content below). If you're new to markdown, have a look at this [markdown cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) to help you get started. +Each name should appear on a separate line. -### Extra content -If you'd like to split content across several pages, or include an embed link for your data, you can add extra content in the form of tabs across the top of the page. +### title.txt +By default the title for your project will be derived from the folder name by replacing any dash or hyphen characters with spaces, and converting the result to title case. -First, write your extra content in a separate markdown or html file (e.g. `_extras.md`) in the same folder as `index.md`. Then add the following to the tabs section in the frontmatter at the top of `index.md` for each tab you'd like to add: +If you'd like to override this, add a file called `title.txt` and write the title for your project on the first line. -```yaml - - { - name: 'extra', # Two tabs cannot share the same name - type: 'markdown', # embed/html/markdown - source: '_extras.md', # filename or embed url - label: 'Extra tab' # Optional: label for tab, defaults to capitalised name - } -``` +### Extra content +If you'd like to split content across several pages, or include an embed link for your data, you can add extra content by including additional markdown or html files in your project folder. This content will appear in separate tabs across the top of the page. -The options work as follows: -* `name`: determines the id used by the html elements - must begin with a letter followed by any number of letters, digits, hyphens or underscores (no spaces) -* `type`: specify whether your source file is written in markdown or html, or if it's a link to another page that you'd like to embed -* `source`: the source filename or url for the additional content -* `label`: the label you'd like to appear on the tab if different from capitalised name +**Please note**: Only files with .html or .md suffixes are included, anything else is ignored. This can be useful if you need to include assets (images, javascript, css etc.) such as those generated by quarto. -This is how you can embed content from a research data repository, or even a page you have built with [Quarto](https://quarto.org/) to explain your analysis. +The name of the file is used to generate the tab label for the extra content as follows: -### Authors -You can also list all of the authors who have worked on the project in the frontmatter, and this list will appear at the top of the page and on the summary cards that appear on the main page of the site. To do this you will first need to add each authors' details to the site's people list. For each person you'd like to add to the site, create a new YAML file under `/_data/people/`; e.g. marie_curie.yml. Add the following fields: +* The filename suffix (.md/.html is removed) +* Any underscore(_) or hyphen (-) characters are replaced with spaces +* Digits at the start of the filename are removed +* Any whitespace remaining at the start or end of the name is removed +* The name is converted to title case -* name: how the name should be displayed -* email: optional -* github_username: optional +As an example, the tab label for `03_code-and_data.md` would be "Code And Data". -Once this is done, you can include this person as an author on the project by adding the name of the YAML file (without the .yml suffix) to the author list: - -```yaml -authors: -- marie_curie -- karl_popper -``` +Tab order is alphabetical (except index.md which always appears first). To determine the order in which tabs appear, use numbers at the start of your filenames (e.g. `01_methods.md`, `02_privacy.md`, `03_data.html`). ## Step 4: Make a pull request -When you're ready to publish your project, you can submit a pull request to merge your changes back into the main GitHub repository. If you originally cloned the code as described in step 2, you can push the branch you've created back up to GitHub as follows: +To publish your project, you will need to merge the new files into the main branch on the GitHub repository. To do this you will need to push the branch you've created back up to GitHub and then submit a [Pull Request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests). The pull request process allows us to review submissions before they are added to ensure they comply with our standards. + +### Pushing your branch to GitHub +If you originally cloned the code as described in step 2, you can push the branch you've created back up to GitHub as follows: ```bash git push --set-upstream origin ``` -If you open the repository in GitHub, you should be able to see your branch listed in the drop down menu labelled main at the top of the list of files. +Then, if you open the repository in GitHub, you should be able to see your branch listed in the drop down menu labelled main at the top of the list of files. +Pushing to the repository triggers an automatic process which will generate metadata and prepend it to index.md. Once generated, if you're comfortable working with Jekyll, you can edit this metadata to do things like changing the automatically generated project title and tab labels. + +### Submitting a Pull Request To open a pull request: * Select Pull requests from the top navigation menu * Click the green 'New pull request' button * Select main from the left hand side dropdown labelled base (this should already be selected) * Select your branch from the right hand side dropdown labelled compare * Click 'Create pull request' -* Add a title and description, including and details you think may be relevant for somebody reviewing your changes +* Add a title and description, including any details you think may be relevant for somebody reviewing your changes * Then click 'Create pull request' -Your pull request will then need to be approved by two reviewers who are chosen automatically. Reviewers may make comments or request changes before approving your submission so make sure you are able to receive notifications from GitHub in order to respond to their requests. \ No newline at end of file +Your pull request will then need to be approved by two reviewers who are chosen automatically from a pool of volunteer editors. Reviewers might sometimes make comments or request changes before approving your submission so please make sure you are able to receive notifications from GitHub in order to respond to their requests. + +Once approved, your project will be merged into the main branch and it will automatically appear on the live website. \ No newline at end of file From 6c5a15287f4631b83cf02aa33c4fb8c25528d217 Mon Sep 17 00:00:00 2001 From: tcouch Date: Fri, 15 Dec 2023 13:47:35 +0000 Subject: [PATCH 06/11] Auto generate Jekyll front matter for projects --- _projects/_project_template/index.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/_projects/_project_template/index.md b/_projects/_project_template/index.md index 50eb32b..f8d0f8f 100644 --- a/_projects/_project_template/index.md +++ b/_projects/_project_template/index.md @@ -1 +1,22 @@ +--- +layout: project +title: Project Template +authors: +- Alan Ahlberg +- Janet Ahlberg +tabs: +- { + name: cbcrhfxl, + type: md, + source: 01_extra.md, + label: 01 Extra + } +- { + name: johnsafr, + type: html, + source: 02_data.html, + label: 02 Data + } +--- + Write your project overview in markdown format here \ No newline at end of file From 92ce9507728f15eecec8fee1278c1a2322b75fa6 Mon Sep 17 00:00:00 2001 From: tcouch Date: Fri, 15 Dec 2023 14:16:29 +0000 Subject: [PATCH 07/11] Update label gen and add underscores to source files --- _utils/jekyllify.py | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/_utils/jekyllify.py b/_utils/jekyllify.py index 9d5184a..eeecb7e 100644 --- a/_utils/jekyllify.py +++ b/_utils/jekyllify.py @@ -78,6 +78,26 @@ def get_project_dirs(name:str=None)->list[Path]: def get_random_string(len:int) -> str: return ''.join(random.choice(ascii_lowercase) for i in range(len)) + +def get_tab_source_files(dir:Path) -> list[Path]: + source_files = list(dir.glob("*.md")) + list(dir.glob("*.html")) + # Remove index.md or index.html + for index in [dir/"index.md", dir/"index.html"]: + if index in source_files: + source_files.remove(index) + return source_files + +def generate_label_from_filename(stem:str) -> str: + """Given a filename stem (e.g. 03_code-and_data) convert this to a label by: + + 1. replacing any - or _ characters with spaces + 2. removing any digits at the start of the filename + 3. removing any whitespace remaining at the start or end of the name + 4. converting the name to title case""" + label = stem.replace("_"," ").replace("-"," ") + label = re.sub("^[\d]*","",label) + label = label.strip() + return label.title() def generate_title_yaml(dir:Path) -> str: """Title can come from title.txt, or the project folder name will be used. @@ -107,23 +127,29 @@ def generate_tabs_yaml(dir:Path) -> str: index.html) and return a yaml block style list of tabs referencing those files. Attributes type, source, and label are generated from the file name, and name is a randomly generated string.""" - extra_files = list(dir.glob("*.md")) + list(dir.glob("*.html")) - # Remove index.md or index.html as that's already accounted for - for index in [dir/"index.md", dir/"index.html"]: - if index in extra_files: - extra_files.remove(index) + source_files = get_tab_source_files(dir) tabs = "tabs:\n" - for file in extra_files: + for file in source_files: tabs += "- {\n" tabs += f" name: {get_random_string(8)},\n" # Used as html element id tabs += f" type: {file.suffix[1:]},\n" # Remove the dot from suffix tabs += f" source: {file.name},\n" - tabs += f" label: {file.stem.replace('_',' ').replace('-',' ').strip().title()}\n" + tabs += f" label: {generate_label_from_filename(file.stem)}\n" tabs += " }\n" return tabs +def prepend_underscores_to_tab_sources(dir:Path)-> None: + """For each file in the directory with a .html or .md suffix, rename and prepend + with an underscore character (except for index.md)""" + source_files = get_tab_source_files(dir) + for file in source_files: + if not file.stem[0] == "_": + file.rename(file.with_stem("_"+file.stem)) + def jekyllify(dir:Path)->None: - """Given a project directory, generate yaml front matter and prepend to index.md""" + """Given a project directory, generate yaml front matter and prepend to index.md. + Then add underscores to any .md or .html files other than index.md to ensure + they do not get processed by Jekyll.""" print(f"Adding front matter to {dir}") front_matter = "---\n" front_matter += "layout: project\n" # layout is always project @@ -135,6 +161,7 @@ def jekyllify(dir:Path)->None: content = f.read() f.seek(0,0) f.write(front_matter + content) + prepend_underscores_to_tab_sources(dir) if __name__=="__main__": print("Jekyllify script running...") From fb5d23a6aa195c8e0134558d78e9b7f848053b70 Mon Sep 17 00:00:00 2001 From: tcouch Date: Fri, 15 Dec 2023 14:16:40 +0000 Subject: [PATCH 08/11] Update examples --- _projects/cheese_therapy/{data.html => _data.html} | 0 _projects/cheese_therapy/index.md | 2 +- _projects/fainting_goats/{03_data.html => _03_data.html} | 0 _projects/fainting_goats/index.md | 4 ++-- _projects/scurvy_time/index.md | 6 +++--- 5 files changed, 6 insertions(+), 6 deletions(-) rename _projects/cheese_therapy/{data.html => _data.html} (100%) rename _projects/fainting_goats/{03_data.html => _03_data.html} (100%) diff --git a/_projects/cheese_therapy/data.html b/_projects/cheese_therapy/_data.html similarity index 100% rename from _projects/cheese_therapy/data.html rename to _projects/cheese_therapy/_data.html diff --git a/_projects/cheese_therapy/index.md b/_projects/cheese_therapy/index.md index 3bb30c4..daf7169 100644 --- a/_projects/cheese_therapy/index.md +++ b/_projects/cheese_therapy/index.md @@ -6,7 +6,7 @@ authors: - Professor Plum tabs: - { - name: gipkpglp, + name: veaxthwj, type: html, source: data.html, label: Data diff --git a/_projects/fainting_goats/03_data.html b/_projects/fainting_goats/_03_data.html similarity index 100% rename from _projects/fainting_goats/03_data.html rename to _projects/fainting_goats/_03_data.html diff --git a/_projects/fainting_goats/index.md b/_projects/fainting_goats/index.md index e2147ed..ffa29f2 100644 --- a/_projects/fainting_goats/index.md +++ b/_projects/fainting_goats/index.md @@ -6,10 +6,10 @@ authors: - Doctor Foster tabs: - { - name: rttnzstm, + name: ftuawotq, type: html, source: 03_data.html, - label: 03 Data + label: Data } --- diff --git a/_projects/scurvy_time/index.md b/_projects/scurvy_time/index.md index 0f0575e..d8cbe0b 100644 --- a/_projects/scurvy_time/index.md +++ b/_projects/scurvy_time/index.md @@ -6,19 +6,19 @@ authors: - Trial Runner tabs: - { - name: kykeuoqa, + name: vphbybwh, type: md, source: _analysis.md, label: Analysis } - { - name: gyvgzvxc, + name: npuufhpv, type: md, source: _gdpr.md, label: Gdpr } - { - name: vhabbkir, + name: kqfokysy, type: html, source: _data.html, label: Data From ef832a987ad8bf8005fd5dd59e3028534841156e Mon Sep 17 00:00:00 2001 From: tcouch Date: Fri, 15 Dec 2023 14:26:09 +0000 Subject: [PATCH 09/11] ignore _project dirs and add _ to source before front matter gen --- _utils/jekyllify.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/_utils/jekyllify.py b/_utils/jekyllify.py index eeecb7e..565bf72 100644 --- a/_utils/jekyllify.py +++ b/_utils/jekyllify.py @@ -74,7 +74,13 @@ def get_project_dirs(name:str=None)->list[Path]: else: raise FileNotFoundError(f"No directory named {name} found under {PROJECTS_DIR}") else: - return [path for path in PROJECTS_DIR.iterdir() if path.is_dir()] + return [ + path for path in PROJECTS_DIR.iterdir() + if + path.is_dir() + and + path.stem[0] != "_" + ] def get_random_string(len:int) -> str: return ''.join(random.choice(ascii_lowercase) for i in range(len)) @@ -147,10 +153,11 @@ def prepend_underscores_to_tab_sources(dir:Path)-> None: file.rename(file.with_stem("_"+file.stem)) def jekyllify(dir:Path)->None: - """Given a project directory, generate yaml front matter and prepend to index.md. - Then add underscores to any .md or .html files other than index.md to ensure - they do not get processed by Jekyll.""" - print(f"Adding front matter to {dir}") + """Given a project directory, add underscores to any .md or .html files other than + index.md to ensure they do not get processed by Jekyll, then generate yaml front + matter and prepend to index.md.""" + print(f"Jekyllifying {dir}") + prepend_underscores_to_tab_sources(dir) front_matter = "---\n" front_matter += "layout: project\n" # layout is always project front_matter += generate_title_yaml(dir) @@ -161,8 +168,7 @@ def jekyllify(dir:Path)->None: content = f.read() f.seek(0,0) f.write(front_matter + content) - prepend_underscores_to_tab_sources(dir) - + if __name__=="__main__": print("Jekyllify script running...") args = argument_parser.parse_args() From 8cf620a79843135eef27c20510604f3e06f122b0 Mon Sep 17 00:00:00 2001 From: tcouch Date: Fri, 15 Dec 2023 14:27:00 +0000 Subject: [PATCH 10/11] Fix examples --- _projects/cheese_therapy/index.md | 4 ++-- _projects/fainting_goats/index.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/_projects/cheese_therapy/index.md b/_projects/cheese_therapy/index.md index daf7169..27c5da1 100644 --- a/_projects/cheese_therapy/index.md +++ b/_projects/cheese_therapy/index.md @@ -6,9 +6,9 @@ authors: - Professor Plum tabs: - { - name: veaxthwj, + name: laaitepn, type: html, - source: data.html, + source: _data.html, label: Data } --- diff --git a/_projects/fainting_goats/index.md b/_projects/fainting_goats/index.md index ffa29f2..85ac609 100644 --- a/_projects/fainting_goats/index.md +++ b/_projects/fainting_goats/index.md @@ -6,10 +6,10 @@ authors: - Doctor Foster tabs: - { - name: ftuawotq, + name: qlcxqfnn, type: html, - source: 03_data.html, - label: Data + source: _03_data.html, + label: 03 Data } --- From aefdc4231f087fd772ae4ceb3f37f8058a272f49 Mon Sep 17 00:00:00 2001 From: tcouch Date: Fri, 15 Dec 2023 14:28:28 +0000 Subject: [PATCH 11/11] Remove front matter in template --- _projects/_project_template/index.md | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/_projects/_project_template/index.md b/_projects/_project_template/index.md index f8d0f8f..50eb32b 100644 --- a/_projects/_project_template/index.md +++ b/_projects/_project_template/index.md @@ -1,22 +1 @@ ---- -layout: project -title: Project Template -authors: -- Alan Ahlberg -- Janet Ahlberg -tabs: -- { - name: cbcrhfxl, - type: md, - source: 01_extra.md, - label: 01 Extra - } -- { - name: johnsafr, - type: html, - source: 02_data.html, - label: 02 Data - } ---- - Write your project overview in markdown format here \ No newline at end of file