How the GitHub Discussions to Markdown System Works
This document demonstrates the automated workflow that converts GitHub Discussions into Hugo-compatible markdown files.
Workflow and Process Overview
File Structure
Event Triggers
The workflow is triggered by:
- Discussion Created - Automatically converts new discussions to markdown
- Discussion Edited - Updates existing markdown files with changes
- Manual Dispatch - Can be triggered manually from GitHub Actions
Giscus Compatibility
Each generated markdown file includes:
1
2
3
4
5
| ---
title: 'Discussion Title'
tags: [tag1, tag2]
giscus_discussion_id: 12345
---
|
The giscus_discussion_id
ensures comments are automatically linked to the original GitHub Discussion.
Sample Generated Output
When a discussion is created with:
- Title: “How to contribute?”
- Body: “I’d like to contribute to this project…”
- Labels: “Q&A”
The system generates:
1
2
3
4
5
6
7
| ---
title: 'How to contribute?'
tags: [qa, help-wanted]
giscus_discussion_id: J_awddwdawdwdwadw
---
I'd like to contribute to this project...
|
Benefits
- ✓ Real-time updates (webhook-triggered)
- ✓ No manual conversion needed
- ✓ Preserves formatting and tags
- ✓ Maintains comment continuity via Giscus
- ✓ Fully automated workflow