Skip to content

Commit

Permalink
Merge pull request #4 from angelicagardner/dev
Browse files Browse the repository at this point in the history
Initial repo setup
  • Loading branch information
angelicagardner authored Apr 11, 2024
2 parents dab2198 + a911208 commit 6208084
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 30 deletions.
31 changes: 2 additions & 29 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,4 @@
# Tech Talk Title
Until ready; mark as Draft.

Mention any related issues here, using the syntax `#issue_number`. For example:
Mention related issue here, using the syntax `#issue_number`. For example:
- This PR closes #123.

**Speaker(s):**
**Video URL:**

## Timestamps

- `00:00` -
- `00:00` -

## Official Abstract/Summary

>
## Key Takeaways

-
-

### Questions/Discussion Points**

-
-

## Relevant Links/Resources

-
-
34 changes: 34 additions & 0 deletions .github/workflows/update-gh-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Update Talks Information and Deploy to GitHub Pages

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install Dependencies
run: |
pip install -r requirements.txt
- name: Run Python Script
run: python main.py

- name: Commit and Push Changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add index.html
git commit -m "Update index.html" -a || echo "No changes to commit"
git push
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
# tech-talks-digest
# Tech Talks Digest

## About

A curated collection of insights, summaries, and key takeaways from various tech talks and conferences. Includes detailed timestamps for quick reference and video links for deeper exploration.

## Setup

1. ...
2. ...
31 changes: 31 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>Tech Talks Digest</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<meta name="description" content="Insights, summaries, and key takeaways from various tech talks. Includes timestamps for quick reference and video links for deeper exploration.">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Tech Talks Digest</h1>
<p>List of finished talks.</p>
<select id="labelFilter">
<option value="all">All Labels</option>
<!-- Options will be added here by the script -->
</select>
<table id="talksTable">
<thead>
<tr>
<th>Title</th>
<th>Labels</th>
</tr>
</thead>
<tbody>
<!-- TABLE_ROWS_PLACEHOLDER -->
</tbody>
</table>
<script src="script.js"></script>
</body>
</html>
27 changes: 27 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import frontmatter
import os

def generate_table_rows(talks_directory):
rows = []
for filename in os.listdir(talks_directory):
if filename.endswith(".md") and not filename.startswith("_"):
with open(os.path.join(talks_directory, filename), 'r') as f:
post = frontmatter.load(f)
title = post.metadata.get('title', 'No Title')
year = post.metadata.get('year', '')
labels = post.metadata.get('labels', '')
rows.append(f'<tr data-labels="{labels}"><td><a href="https://github.com/angelicagardner/tech-talks-digest/talks/{filename}">{title}</a></td><td>{labels}</td></tr>')
return '\n'.join(rows)

def update_html_with_table_rows(table_rows):
html_file_path = 'index.html'
with open(html_file_path, 'r', encoding='utf-8') as file:
html_content = file.read()

new_html_content = html_content.replace('<!-- TABLE_ROWS_PLACEHOLDER -->', table_rows)
with open(html_file_path, 'w', encoding='utf-8') as file:
file.write(new_html_content)

if __name__ == "__main__":
table_rows = generate_table_rows('./talks')
update_html_with_table_rows(table_rows)
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
frontmatter
13 changes: 13 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
document.getElementById('labelFilter').addEventListener('change', function() {
const selectedLabel = this.value.toLowerCase();
const talks = document.querySelectorAll('tr');

talks.forEach(talk => {
const labels = talk.dataset.labels.toLowerCase();
if (selectedLabel === 'all' || labels.includes(selectedLabel)) {
talk.style.display = '';
} else {
talk.style.display = 'none';
}
});
});
34 changes: 34 additions & 0 deletions talks/_example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: "Example Title"
labels: "topic1, topic2"
year: 1989
---

# Title

**Speaker(s):**
**Video URL:**

## Timestamps

- `00:00` -
- `00:00` -

## Official Abstract/Summary

>
## Key Takeaways

-
-

### Questions/Discussion Points**

-
-

## Relevant Links/Resources

-
-

0 comments on commit 6208084

Please sign in to comment.