Skip to content

Commit

Permalink
Updated Press Release
Browse files Browse the repository at this point in the history
  • Loading branch information
JacowySnafu committed Aug 28, 2024
1 parent 0648bb3 commit 3bb3340
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 4 deletions.
36 changes: 32 additions & 4 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,38 @@ <h2 class="text-uppercase fw-bold">Saniya Nanu</h2>
</div>
</div>
</div>
<div style="padding-top: 5vh; padding-bottom: 2vh; text-align: center;">
<h1 class="text-center" style="padding-bottom: 3vh;">Press Release</h1>
<iframe src="assets/documents/SLC Press Release.pdf" width="800" height="600"></iframe>
</div>
<div id="press-release-container" style="padding-top: 5vh; padding-bottom: 2vh; text-align: center;"></div>

<script>
fetch('press_releases.json')
.then(response => response.json())
.then(data => {
const container = document.getElementById('press-release-container');

const mostRecent = data.shift();

container.innerHTML = `
<h1 style="padding-bottom: 3vh;">Press Release</h1>
<div style="margin-bottom: 2rem; text-align: center;">
<h2 style="padding-bottom: 3vh;">Most Recent Press Release</h2>
<iframe src="${mostRecent.link}" width="800" height="800" style="border: none; display: block; margin: 0 auto;"></iframe>
</div>
<div style="text-align: center;">
<h2 style="padding-bottom: 2vh;">Past Press Releases</h2>
<ul style="list-style-type: none; padding-left: 0; margin: 0; display: inline-block; text-align: left;"></ul>
${data.map(release => `
<li><a href="${release.link}"
target="_blank">${release.title}</a></li>
`).join('')}
</ul>
<div>
`;
})
.catch(error => console.error('Error loading press release:', error));
</script>


<div class="container" style="
display: flex;
flex-direction: column;
Expand Down
16 changes: 16 additions & 0 deletions public/press_releases.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[

{
"title": "Press Release January 2023",
"link": "assets/documents/SLC Press Release.pdf"
},
{
"title": "Press Release June 2023",
"link": "assets/documents/press-release-2023-06.pdf"
},
{
"title": "Press Release November 2023",
"link": "assets/documents/press-release-2023-11.pdf"
}
]

28 changes: 28 additions & 0 deletions public/press_releases_overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Press Releases JSON Structure

## Structure

The `pressReleases` array contains objects with the following properties:

!! The Most recent press release is the very top title-link set, after that are the most recent ones. When updating rememebr this. !!

- **title**: The title of the press release.
- **link**: URL to the PDF document.

## Example

```json
{

{
"title": "Press Release January 2023",
"link": "assets/documents/press-release-2023-01.pdf",
}

{
"title": "Press Release December 2022",
"link": "assets/documents/press-release-2022-12.pdf",
}

}
```

0 comments on commit 3bb3340

Please sign in to comment.