feat: added language info
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user