From c9474445c9bbf22f79778acb292ccd79c7b4d1e5 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sun, 14 Jun 2026 21:16:42 +0200 Subject: Implement breadcrumbs --- build.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'build.py') diff --git a/build.py b/build.py index 2dd8504..e253d4c 100644 --- a/build.py +++ b/build.py @@ -10,7 +10,7 @@ from pathlib import Path import jinja2 from loguru import logger -from typst import Compiler +from typst import Compiler, TypstError from watchfiles import watch @@ -36,7 +36,13 @@ class Builder: output_path = self.public_dir / relative_path.with_suffix('.html') output_path.parent.mkdir(parents=True, exist_ok=True) - self.compiler.compile(input=path, output=output_path) + self.compiler.compile( + input=path, + output=output_path, + sys_inputs={ + 'path': str(relative_path.with_suffix('')), + }, + ) metadata = json.loads( self.compiler.query( @@ -98,7 +104,10 @@ def main() -> None: for changes in watch(site_dir): print(changes) - builder.build() + try: + builder.build() + except TypstError as e: + logger.exception(e) if __name__ == '__main__': -- cgit