diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 485dee6..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.idea diff --git a/README.md b/README.md index 934ec8a..3506ed1 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,33 @@ # logseq-publish-excalidraw-to-svg Excalidraw drawings are not rendered when published in logseq. This action makes sure that they are converted to svg and inserts the svgs + +## Example action: + +```yaml +on: [push] + +permissions: + contents: write +jobs: + test: + runs-on: ubuntu-latest + name: Publish Logseq graph + steps: + - uses: actions/checkout@v3 + - uses: Surferlul/logseq-publish-excalidraw-to-svg@main + with: + dark-mode: true + asset-repo: / + asset-repo-branch: + asset-repo-token: "${{ secrets. }}" + - uses: logseq/publish-spa@main + with: + version: nightly + theme-mode: dark + - name: add a nojekyll file # to make sure asset paths are correctly identified + run: touch $GITHUB_WORKSPACE/www/.nojekyll + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: www +``` \ No newline at end of file diff --git a/action.yml b/action.yml index e1a5f5d..aae5de5 100644 --- a/action.yml +++ b/action.yml @@ -7,7 +7,7 @@ inputs: default: 'false' asset-repo: description: Repository to store svg assets in - required: ture + required: true asset-repo-branch: description: The branch to store the svg assets in required: true @@ -34,22 +34,11 @@ runs: - name: Creating SVG files run: (cd "${{ github.workspace }}" && find . -type f -name '*.excalidraw' -exec bash "${{ github.action_path }}/to_svg.sh" "{}" ${{ inputs.dark-mode == 'true' }} ";") shell: bash - - uses: EndBug/add-and-commit@v9 # You can change this to use a specific version. + - uses: EndBug/add-and-commit@v9 with: - # The arguments for the `git add` command (see the paragraph below for more info) - # Default: '.' add: 'svg-assets' - - # The name of the user that will be displayed as the author of the commit. - # Default: depends on the default_author input author_name: logseq-publish-excalidraw-to-svg - - # The email of the user that will be displayed as the author of the commit. - # Default: depends on the default_author input author_email: mail@lu-dev.de - - # The local path to the directory where your repository is located. You should use actions/checkout first to set it up. - # Default: '.' cwd: 'svg-repo' - name: Replace excalidraw file references run: find "${{ github.workspace }}" -type f -name '*.md' -exec sed -ri 's|\[\[(.*\.excalidraw)\]\]|![\1](https://raw.githubusercontent.com/${{ inputs.asset-repo }}/${{ inputs.asset-repo-branch }}/svg-assets/\1.svg)|g' "{}" ";"