Skip to content

Commit 7e41eb5

Browse files
Create People sub-pages layout (#52)
* Relocate people files to people/ * Create desired sub-pages for People section * Update some notes and create people/README * Add gfm output label * Change to standard md file * Begin creating a numbering script for member profile files * Rename page * Add separate alumnae and fellow pages * Update _quarto.yml * Remove example files
1 parent 92c82c1 commit 7e41eb5

23 files changed

+323
-226
lines changed

_quarto.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,16 @@ website:
4646
- open-research-cycle.qmd
4747
- text: People
4848
icon: people
49+
# href: people/overview.qmd
4950
menu:
50-
- people.qmd
51-
- leadership.qmd
52-
- boards.qmd
53-
- members.qmd
51+
- people/overview.qmd
52+
- people/management.qmd
53+
- people/staff.qmd
54+
- people/scientific-board.qmd
55+
- people/advisory-board.qmd
56+
- people/members.qmd
57+
- people/fellows.qmd
58+
- people/alumnae.qmd
5459
- href: events.qmd
5560
icon: calendar-event
5661
text: Events
@@ -101,6 +106,7 @@ format:
101106
css:
102107
- https://raw.githubusercontent.com/lmu-osc/branding-resources/refs/heads/main/styles.css
103108
- custom-navbar.css
109+
- styles.css
104110
toc: true
105111
include-in-header:
106112
- file: matomo_analytics.html

boards.qmd

Lines changed: 0 additions & 3 deletions
This file was deleted.

leadership.qmd

Lines changed: 0 additions & 3 deletions
This file was deleted.

members.qmd

Lines changed: 0 additions & 3 deletions
This file was deleted.

people/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
This file describes the structure of the `people/` directory.

people/_people_template.qmd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ publications:
4949

5050

5151
<!-- The "includes" below are templates for the different sections of the
52-
member profile pages. Each document returns an R object that contains the
53-
necessary HTML elements to render the section.
52+
member profile pages. Each document returns one or several R objects that
53+
contains the necessary HTML elements to render the section.
5454
1. You can modify these templates to change the layout or content of each section. This will change the layout of all member profiles the next time the site is built.
55+
- Make sure to keep using the HTMLtools functions like `div()`, `p()`, `img()`, etc. to create the HTML structure if you are creating an R object. Otherwise, the HTML will not render correctly--extra <a> tags will be added to your elements and this messes with spacing. Raw HTML, however, will work as expected.
5556
2. You can also create new templates for additional sections if needed.
5657
3. If you want to add some custom content for an individual member, you can do so directly in the member's .QMD file, outside of the includes. You will then need to insert the new R object containing HTML into the `profile` object below.
5758
-->

people/add_people_id.R

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
2+
3+
file2 <- c("00001_felix example 2.qmd",
4+
"00002_felix example 3.qmd",
5+
"00003_felix example 4.qmd")
6+
7+
8+
# check if file already has 5 leading digits
9+
str_detect(file2, "\\d{5}.*.qmd")
10+
11+
# create string for new max value
12+
find_and_pad_next_id <- function(files) {
13+
# Extract the numeric part from the file names
14+
ids <- str_extract(file2, "\\d{5}") %>%
15+
as.numeric()
16+
17+
# Find the maximum ID and increment it by 1
18+
next_id <- max(ids, na.rm = TRUE) + 1
19+
20+
# Format the new ID with leading zeros
21+
str_pad(as.character(next_id), width = 5, side = "left", pad = "0")
22+
}
23+
# str_extract(file2, "\\d{5}") %>%
24+
# as.numeric() %>%
25+
# {max(.) + 1} %>%
26+
# str_pad(width = 5, side = "left", pad = "0")
27+
28+
29+
# find_current_max_id(file2)
30+
31+
# files <- c(list.files("./people/profiles"), file2)
32+
33+
# untagged_files <- files[!str_detect(files, "\\d{5}.*.qmd")]
34+
35+
# find_and_pad_next_id(file2)
36+
37+
find_current_max_id <- function(files) {
38+
# Extract the numeric part from the file names
39+
ids <- str_extract(files, "\\d{5}") %>%
40+
as.numeric()
41+
42+
# Find the maximum ID
43+
if (all(is.na(ids)) | length(ids) == 0) {
44+
return(0) # If no IDs found, return 0
45+
}
46+
max(ids, na.rm = TRUE)
47+
}
48+
49+
tag_files <- function(files) {
50+
untagged_files <- files[!str_detect(files, "\\d{5}.*.qmd")]
51+
current_max_id <- find_current_max_id(files)
52+
new_labels <- vector("character", length(untagged_files))
53+
vec_position <- 0
54+
for (file in untagged_files) {
55+
vec_position <- vec_position + 1
56+
current_max_id <- current_max_id + 1
57+
new_label <- str_pad(as.character(current_max_id), width = 5, side = "left", pad = "0")
58+
new_labels[vec_position] <- paste0(new_label, "_", file)
59+
}
60+
return(new_labels)
61+
}
62+
63+
# provided a vector with existing number tags
64+
tag_files(files)
65+
66+
# bootstrap from 0 i.e. none of the # files have a 5 digit number tag
67+
files[!str_detect(files, "\\d{5}.*.qmd")] %>%
68+
tag_files()
69+
70+
71+
72+
73+
74+

people/advisory-board.qmd

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
format:
3+
html:
4+
toc: true
5+
toc-depth: 1
6+
css:
7+
- people.css
8+
page-layout: full
9+
include-in-header:
10+
- text: |
11+
<script src="../assets/javascript/display_name_hover.js" defer></script>
12+
title: "Advisory Board"
13+
editor: source
14+
repo-actions: false
15+
listing:
16+
- id: current-advisory-board-listing
17+
contents: profiles
18+
template: people-listing.ejs
19+
include:
20+
membertype: "current advisory board"
21+
- id: past-advisory-board-listing
22+
contents: profiles
23+
template: people-listing.ejs
24+
include:
25+
membertype: "past advisory board"
26+
---
27+
28+
29+
30+
31+
32+
# Advisory Board
33+
::: {#current-advisory-board-listing}
34+
:::
35+
36+
37+
# Previous Advisory Board
38+
::: {#past-advisory-board-listing}
39+
:::
40+

people/alumnae.qmd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: "Alumnae"
3+
format: html
4+
---
5+

people/felix_example copy 2.qmd

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)