Skip to content
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
37 changes: 0 additions & 37 deletions .github/workflows/update-page.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/update-repos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Update repo list

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
update-list:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: pip install requests
- name: Generate GitHub data
run: python generate_repos_list.py
- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add _data/repos.json _data/profile.json
if git diff --cached --quiet; then
echo 'No changes to commit'
else
git commit -m 'Update GitHub data'
git push
fi
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Pat Little's Blog

This repository hosts my personal blog built with [Jekyll](https://jekyllrb.com/) and the `minima` theme.

## Writing posts

Add new markdown files to the `_posts` directory. Filenames must follow the pattern `YYYY-MM-DD-title.md` and include YAML front matter like:

```markdown
---
layout: post
title: "My Post Title"
---
```

The content under the front matter is written in regular Markdown.

## Updating GitHub data

Run `python generate_repos_list.py` to fetch information about my GitHub profile and repositories. The script saves repository links to `_data/repos.json` and profile details to `_data/profile.json`. The homepage uses these files to show profile stats and links.

## License

Unless otherwise noted, content on this site is licensed under a [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/).
6 changes: 6 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
baseurl: ""
title: "Pat Little's Blog"
description: "Personal blog for sharing thoughts and projects."
theme: minima
license_name: "Creative Commons Attribution 4.0 International"
license_url: "https://creativecommons.org/licenses/by/4.0/"
7 changes: 7 additions & 0 deletions _data/profile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"avatar_url": "https://avatars.githubusercontent.com/u/0?v=4",
"html_url": "https://github.com/PatLittle",
"followers": 0,
"organizations": [],
"achievements": []
}
1 change: 1 addition & 0 deletions _data/repos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
18 changes: 18 additions & 0 deletions _includes/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<div class="footer-col-wrapper">
<div class="footer-col">
<p class="text-small">{{ site.description }}</p>
</div>
<div class="footer-col">
<p class="text-small">&copy; {{ site.time | date: '%Y' }} {{ site.title }}. Powered by <a href="https://jekyllrb.com">Jekyll</a>.</p>
</div>
</div>
<p><strong>Prominent disclaimer:</strong> The views expressed here are my own, and don’t represent the opinions of my team or my employer.</p>

<p>
<a rel="license" href="{{ site.license_url }}">
<img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" />
</a>
<br />
This work is licensed under a <a rel="license" href="{{ site.license_url }}">{{ site.license_name }}</a>.
</p>

6 changes: 6 additions & 0 deletions _posts/2025-07-02-welcome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
layout: post
title: "Welcome to My Blog"
---

This is the first post on my new Jekyll-powered blog. Stay tuned for more content!
117 changes: 72 additions & 45 deletions generate_repos_list.py
Original file line number Diff line number Diff line change
@@ -1,51 +1,78 @@
import requests
import json
import re
from pathlib import Path

import requests

USER = "PatLittle"
REPOS_OUTPUT = Path("_data/repos.json")
PROFILE_OUTPUT = Path("_data/profile.json")


def fetch_repos(user):
def fetch_repos(user: str):
url = f"https://api.github.com/users/{user}/repos"
response = requests.get(url)
return response.json()

def generate_html(repos):

html_content = """<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pat Little's Blog</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<h1>Welcome to Pat Little's Blog</h1>
<nav>
<ul>
<li><a href="#about">About</a></li>
<li><a href="#repos">Repositories</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
</header>
<main>
<section id="about">
<h2>About Me</h2>
<p>Hi, I'm Pat Little. Welcome to my personal blog where I share my projects and ideas.</p>
</section>
"""
html_content += "<h2>Repositories owned by User:PatLittle</h2>\n"
html_content += "<ul>\n"
for repo in repos:
html_content += f"<li><a href='{repo['html_url']}'>{repo['name']}</a></li>\n"
html_content += "</ul>\n"
return html_content

def save_html(content, filename):
with open(filename, "w") as file:
file.write(content)
response.raise_for_status()
return [
{"name": repo["name"], "html_url": repo["html_url"]}
for repo in response.json()
]


def save_repos(repos, path: Path):
path.parent.mkdir(parents=True, exist_ok=True)
with open(path, "w", encoding="utf-8") as f:
json.dump(repos, f, indent=2)


def fetch_profile(user: str):
url = f"https://api.github.com/users/{user}"
response = requests.get(url)
response.raise_for_status()
data = response.json()
return {
"avatar_url": data.get("avatar_url"),
"html_url": data.get("html_url"),
"followers": data.get("followers"),
}


def fetch_organizations(user: str):
url = f"https://api.github.com/users/{user}/orgs"
response = requests.get(url)
response.raise_for_status()
orgs = []
for org in response.json():
orgs.append({"login": org.get("login"), "html_url": f"https://github.com/{org.get('login')}"})
return orgs


def fetch_achievements(user: str):
url = f"https://github.com/users/{user}/achievements"
response = requests.get(url)
response.raise_for_status()
alts = re.findall(r'alt="([^"]+)"', response.text)
achievements = []
for alt in alts:
if alt and alt not in achievements and "avatar" not in alt.lower():
achievements.append(alt)
return achievements


def save_profile_data(profile: dict, orgs, achievements, path: Path):
data = dict(profile)
data["organizations"] = orgs
data["achievements"] = achievements
path.parent.mkdir(parents=True, exist_ok=True)
with open(path, "w", encoding="utf-8") as f:
json.dump(data, f, indent=2)


if __name__ == "__main__":
user = "PatLittle"
repos = fetch_repos(user)
html_content = generate_html(repos)
save_html(html_content, "index.html")
repos = fetch_repos(USER)
save_repos(repos, REPOS_OUTPUT)

profile = fetch_profile(USER)
orgs = fetch_organizations(USER)
achievements = fetch_achievements(USER)
save_profile_data(profile, orgs, achievements, PROFILE_OUTPUT)
57 changes: 0 additions & 57 deletions index.html

This file was deleted.

45 changes: 45 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
layout: home
title: "Pat Little's Blog"
---

Welcome to my personal blog! Here you'll find my latest posts.

{% if site.data.profile %}
![Profile Picture]({{ site.data.profile.avatar_url }}){: style="width:150px;border-radius:50%;" }

**Followers:** {{ site.data.profile.followers }}

{% if site.data.profile.organizations and site.data.profile.organizations | size > 0 %}
### Organizations
<ul>
{% for org in site.data.profile.organizations %}
<li><a href="{{ org.html_url }}">{{ org.login }}</a></li>
{% endfor %}
</ul>
{% endif %}

{% if site.data.profile.achievements and site.data.profile.achievements | size > 0 %}
### Achievements
<ul>
{% for ach in site.data.profile.achievements %}
<li>{{ ach }}</li>
{% endfor %}
</ul>
{% endif %}
{% endif %}

[Connect with me on LinkedIn](https://www.linkedin.com/in/patrickjlittle/)

## My GitHub Repositories

{% if site.data.repos and site.data.repos | size > 0 %}
<ul>
{% for repo in site.data.repos %}
<li><a href="{{ repo.html_url }}">{{ repo.name }}</a></li>
{% endfor %}
</ul>
{% else %}
<p>No repository data available. Run <code>generate_repos_list.py</code> to update.</p>
{% endif %}