Spaces:
Running
on
T4
Running
on
T4
import os | |
def load_markdown(language, section, content_dir="app/content"): | |
"""Load markdown content from files.""" | |
if language is None: | |
file_path = os.path.join(content_dir, f"{section}.md") | |
else: | |
file_path = os.path.join(content_dir, language, f"{section}.md") | |
if os.path.exists(file_path): | |
with open(file_path, "r", encoding="utf-8") as f: | |
return f.read() | |
return f"## Content missing for {file_path} in {language}" | |