diff --git a/action.yml b/action.yml index 43b1656..d244544 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,9 @@ name: Logseq Excalidraw to SVG description: Converts excalidraw to svg references +inputs: + home-md-file: + description: Markdown file of the page you see when accessing the published site + required: false runs: using: composite steps: @@ -10,6 +14,6 @@ runs: python-version: '3.12' # Optional - x64 or x86 architecture, defaults to x64 architecture: 'x64' - - run: python ${{ github.action_path }}/main.py ${{ github.workspace }} + - run: python ${{ github.action_path }}/main.py ${{ github.workspace }} ${{ inputs.home-md-file}} shell: bash diff --git a/main.py b/main.py index 4567244..0091342 100644 --- a/main.py +++ b/main.py @@ -47,12 +47,20 @@ def main() -> None: :return: """ vault_path = Path(argv[1]).expanduser() + home_md_file = None + if len(argv) > 2: + home_md_file = Path(argv[2]).expanduser() + if not home_md_file: + home_md_file = None pages, draws = get_draws(vault_path) + missing_any_svgs = False + replace_dict = {} for draw, svg in iter_svgs(vault_path, draws): if svg is None: replace_dict[f"[[{draw}]]"] = "