feat: added language info

This commit is contained in:
2025-04-10 17:49:59 +02:00
parent 7a3aec9872
commit d2d2628e56
2 changed files with 156 additions and 1 deletions

View File

@@ -67,6 +67,8 @@ class Context:
def convert_md(src: Path, dst: Path, context: Optional[Context] = None):
logger.info("converting %s", src)
html_content = markdown.markdown(src.read_text())
context = context or Context(str(src.parent))
full_page = context.get_text(content=html_content)
@@ -86,7 +88,7 @@ class CustomLanguageCode:
@property
def language_code(self) -> str:
return self.file.name.replace(".md", "")
@property
def relative_url(self) -> str:
return "/" + str(Path(self.file.parent, self.language_code))