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

Add an alumni page #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
<li class="nav-item">
<a class="nav-link" href="{{ site.baseurl }}/resources">Resources</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ site.baseurl }}/alumni">Alumni</a>
</li>
</ul>
</div>
</div>
Expand Down
69 changes: 69 additions & 0 deletions _pages/alumni.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
layout: default
title: "Alumni"
permalink: /alumni/
---


<!DOCTYPE html>
<html>
<head>
<title>Alumni</title>
<style>
table {
border-collapse: collapse;
}

th, td {
border: 1px solid black;
padding: 8px;
}
</style>
</head>
<body>
<table id="csvTable">
<thead>
<tr id="headerRow"></tr>
</thead>
<tbody id="dataRows"></tbody>
</table>

<script>
function displayCSV(csvData) {
var headerRow = document.getElementById('headerRow');
var dataRows = document.getElementById('dataRows');

// Create table header
var headers = csvData[0];
for (var i = 0; i < headers.length; i++) {
var th = document.createElement('th');
th.textContent = headers[i];
headerRow.appendChild(th);
}

// Create table data rows
for (var j = 1; j < csvData.length; j++) {
var rowData = csvData[j];
var tr = document.createElement('tr');
for (var k = 0; k < rowData.length; k++) {
var td = document.createElement('td');
td.textContent = rowData[k];
tr.appendChild(td);
}
dataRows.appendChild(tr);
}
}

// { site.baseurl }/old_site_and_survey_people.csv
// Fetch CSV file
fetch('../old_site_and_survey_people.csv')
.then(response => response.text())
.then(data => {
var csvData = data.split('\n').map(row => row.split(','));
displayCSV(csvData);
});
</script>
</body>
</html>


1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ <h5 class="my-2"><a href="{{ site.baseurl }}/research">Research</a></h5>
<h5 class="my-2"><a href="{{ site.baseurl }}/people">People</a></h5>
<h5 class="my-2"><a href="{{ site.baseurl }}/publications">Publications</a></h5>
<h5 class="my-2"><a href="{{ site.baseurl }}/resources">Protocols and Resources</a></h5>
<h5 class="my-2"><a href="{{ site.baseurl }}/alumni">Alumni</a></h5>
</div>
</div>
</div>
Expand Down