diff options
| author | Paweł Redman <pawel.redman@gmail.com> | 2026-06-14 21:16:42 +0200 |
|---|---|---|
| committer | Paweł Redman <pawel.redman@gmail.com> | 2026-06-14 21:16:42 +0200 |
| commit | c9474445c9bbf22f79778acb292ccd79c7b4d1e5 (patch) | |
| tree | 9f11020b7678187428af278214224382c57fa2b1 /build.py | |
| parent | 6f945ce1a971099b53ed6ce94fff62abd07955df (diff) | |
Implement breadcrumbs
Diffstat (limited to 'build.py')
| -rw-r--r-- | build.py | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -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__': |
