Skip to main content
Glama
parser.py1.01 kB
"""Parser for Jekyll posts - handles both Markdown and AsciiDoc.""" import frontmatter from pathlib import Path from typing import Dict, Any class PostParser: """Parse Jekyll posts with front matter.""" @staticmethod def parse_post(file_path: Path) -> Dict[str, Any]: """ Parse a Jekyll post file. Args: file_path: Path to the post file Returns: Dictionary with 'metadata' and 'content' keys """ with open(file_path, 'r', encoding='utf-8') as f: post = frontmatter.load(f) return { 'metadata': dict(post.metadata), 'content': post.content, 'file_path': str(file_path), 'file_name': file_path.name, 'extension': file_path.suffix } @staticmethod def is_valid_post(file_path: Path) -> bool: """Check if file is a valid post (.md or .adoc).""" return file_path.suffix in ['.md', '.adoc'] and file_path.is_file()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jottinger/jekyll-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server