Projects/_posts/2023-10-09-logseq-publish-excalidraw-to-svg.md
2023-10-20 02:03:34 +00:00

51 lines
1.7 KiB
Markdown

---
title: "GitHub Action: logseq-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
This needs a helper repo or branch to upload the svgs to.
## Inputs
| Input | Requred | Default | Description |
| ----- | ------- | ------- | ----------- |
| dark-mode | false | false | If svg should be rendered for a dark-mode theme |
| asset-repo | true | | The repository to store the svgs in. Has to be public |
| asset-repo-branch | true | | The branch of the repository to store the svgs on |
| asset-repo-token | true | | An access token with content read/write to that repository |
## 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: <YOUR USERNAME>/<YOUR REPOSITORY>
asset-repo-branch: <YOUR REPOSITORY BRANCH FOR AUTOGENERATED ASSETS>
asset-repo-token: "${{ secrets.<YOUR REPOSITORY ACCESS TOKEN WITH CONTENT READ/WRITE> }}"
- 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
```
### [View on Marketplace](https://github.com/marketplace/actions/logseq-excalidraw-to-svg)
### [View on Github](https://github.com/Surferlul/logseq-publish-excalidraw-to-svg)