-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Currently, contributors need to manually add frontmatter to their markdown files, which can be a barrier to contribution and lead to formatting issues. This was highlighted in PR #32 where the required frontmatter was missing.
Proposed Solution
Create an automated system to generate and add frontmatter to markdown files when they're submitted in a PR. This would make contributing easier and ensure consistent formatting.
Options to Consider
- GitHub Action (Recommended)
- Automatically runs on PRs
- Extracts title from first H1 heading
- Generates description from first paragraph
- Sets date to PR creation date
- Determines discipline/contentType from file path
- Generates tags based on content analysis
- No setup required from contributors
- Eleventy Transform
- Injects frontmatter during build if missing
- Works locally during development
- Might miss some metadata that could be extracted from PR context
- Requires build to see results
- Pre-commit Hook
- Works locally before commit
- Requires setup from contributors
- May not have access to all context (like PR date)
- Template Files
- Simple solution
- Requires manual copying
- No automation
- Could still be forgotten
Implementation Details for GitHub Action Approach
The action would:
- Trigger on PR creation/update
- Scan for new/modified .md files
- Check for missing frontmatter
- Generate frontmatter using:
- Title: Extract from first H1 (
# Title) - Description: Use first paragraph or generate from content
- Date: PR creation date
- Layout: Always "markdown.njk"
- Discipline: Extract from file path
- ContentType: Extract from file path
- Tags: Generate based on content analysis
- Title: Extract from first H1 (
Questions to Consider
- Should we auto-commit the changes or just comment on the PR?
- How sophisticated should the tag generation be?
- Should we validate the generated frontmatter against our requirements?
- Should we provide a way for contributors to override the automation?
Next Steps
- Choose preferred approach
- Create proof of concept
- Test with sample content
- Document the automation process
- Update contribution guidelines
Let's discuss which approach would work best for our team and contributors.
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers