Skip to content

Commit 66da014

Browse files
jwilgerclaude
andauthored
feat: improve GitHub Pages website UX and release display (#121)
## Summary - Removed copyright statement from footer (keeping MIT License only) since Union Square is a project, not an entity - Stacked getting started boxes vertically with full content width for better readability of code examples - Added dynamic GitHub release fetching to automatically display latest release information on the website ## Changes 1. **Footer Update**: Removed copyright statement, keeping only "MIT License" text 2. **Layout Improvement**: Changed getting started section from grid to vertical stack layout with max-width for better code readability 3. **Dynamic Release Display**: Added JavaScript to fetch latest release from GitHub API and display it with formatted markdown 4. **Workflow Enhancement**: Updated GitHub Pages deploy workflow to trigger on release publication events ## Test plan - [x] Verified copyright statement removed from footer - [x] Confirmed getting started boxes stack vertically with better width - [x] Tested release fetching JavaScript (handles both existing releases and no-release case) - [x] Workflow will trigger on next release publication 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent 17d4267 commit 66da014

File tree

4 files changed

+62
-3
lines changed

4 files changed

+62
-3
lines changed

.github/workflows/deploy-gh-pages.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
- 'package.json'
1212
- '.github/workflows/deploy-gh-pages.yml'
1313

14+
# Trigger on release publication
15+
release:
16+
types: [published]
17+
1418
# Allows you to run this workflow manually from the Actions tab
1519
workflow_dispatch:
1620

docs/assets/css/style.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,9 +494,11 @@ body {
494494
}
495495

496496
.steps-grid {
497-
display: grid;
498-
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
497+
display: flex;
498+
flex-direction: column;
499499
gap: var(--spacing-lg);
500+
max-width: 800px;
501+
margin: 0 auto;
500502
}
501503

502504
.step-card {

docs/assets/js/main.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,56 @@ style.textContent = `
166166
}
167167
`;
168168
document.head.appendChild(style);
169+
170+
// Fetch and display latest GitHub release
171+
async function fetchLatestRelease() {
172+
try {
173+
const response = await fetch('https://api.github.com/repos/jwilger/union_square/releases/latest');
174+
175+
if (response.status === 404) {
176+
// No releases yet
177+
return;
178+
}
179+
180+
if (!response.ok) {
181+
throw new Error(`HTTP error! status: ${response.status}`);
182+
}
183+
184+
const release = await response.json();
185+
186+
// Update release card with actual release data
187+
const releaseCard = document.querySelector('.release-card');
188+
if (!releaseCard) return;
189+
190+
const releaseDate = new Date(release.published_at).toLocaleDateString('en-US', {
191+
year: 'numeric',
192+
month: 'long',
193+
day: 'numeric'
194+
});
195+
196+
releaseCard.innerHTML = `
197+
<div class="release-status">
198+
<span class="status-badge">${release.prerelease ? 'Pre-release' : 'Latest'}</span>
199+
<span class="release-date">${releaseDate}</span>
200+
</div>
201+
<h3 class="release-title">${release.name || release.tag_name}</h3>
202+
<div class="release-description">${marked.parse(release.body || 'No release notes available.')}</div>
203+
<div class="release-actions">
204+
<a href="${release.html_url}" class="btn btn-outline">View Release</a>
205+
<a href="https://github.com/jwilger/union_square/releases" class="btn btn-outline">All Releases</a>
206+
</div>
207+
`;
208+
} catch (error) {
209+
console.error('Error fetching release:', error);
210+
// Keep the default content on error
211+
}
212+
}
213+
214+
// Load marked.js for markdown parsing
215+
const script = document.createElement('script');
216+
script.src = 'https://cdn.jsdelivr.net/npm/marked/marked.min.js';
217+
script.onload = () => {
218+
// Fetch release once marked.js is loaded
219+
fetchLatestRelease();
220+
};
221+
document.head.appendChild(script);

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ <h3 class="release-title">No releases yet</h3>
217217
<div class="footer-content">
218218
<div class="footer-left">
219219
<img src="https://raw.githubusercontent.com/jwilger/union_square/main/logo.svg" alt="Union Square Logo" class="footer-logo">
220-
<p>&copy; 2024 Union Square. MIT License.</p>
220+
<p>MIT License</p>
221221
</div>
222222
<div class="footer-links">
223223
<a href="https://github.com/jwilger/union_square">GitHub</a>

0 commit comments

Comments
 (0)