feat: Implement date tracking for skills
- Added `date_added` field to all skills in frontmatter. - Updated Home page to display skill addition date alongside risk level. - Enhanced Skill Detail page to show date added in a badge format. - Created scripts for managing skill dates, including adding missing dates and generating reports. - Updated validators to enforce date format compliance. - Added comprehensive documentation on date tracking implementation and usage. - Introduced a new skill template including the `date_added` field.
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
import os
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
|
||||
import yaml
|
||||
|
||||
# Ensure UTF-8 output for Windows compatibility
|
||||
if sys.platform == 'win32':
|
||||
import io
|
||||
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
||||
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8')
|
||||
|
||||
def parse_frontmatter(content):
|
||||
"""
|
||||
Parses YAML frontmatter, sanitizing unquoted values containing @.
|
||||
@@ -59,7 +66,8 @@ def generate_index(skills_dir, output_file):
|
||||
"name": dir_name.replace("-", " ").title(),
|
||||
"description": "",
|
||||
"risk": "unknown",
|
||||
"source": "unknown"
|
||||
"source": "unknown",
|
||||
"date_added": None
|
||||
}
|
||||
|
||||
try:
|
||||
@@ -77,6 +85,7 @@ def generate_index(skills_dir, output_file):
|
||||
if "description" in metadata: skill_info["description"] = metadata["description"]
|
||||
if "risk" in metadata: skill_info["risk"] = metadata["risk"]
|
||||
if "source" in metadata: skill_info["source"] = metadata["source"]
|
||||
if "date_added" in metadata: skill_info["date_added"] = metadata["date_added"]
|
||||
|
||||
# Fallback for description if missing in frontmatter (legacy support)
|
||||
if not skill_info["description"]:
|
||||
|
||||
Reference in New Issue
Block a user