{"id":23436899,"url":"https://github.com/logseq/publish-spa","last_synced_at":"2025-04-06T19:12:26.956Z","repository":{"id":154235423,"uuid":"627102346","full_name":"logseq/publish-spa","owner":"logseq","description":"A github action and CLI to publish logseq graphs as a SPA app","archived":false,"fork":false,"pushed_at":"2024-03-21T11:55:47.000Z","size":66798,"stargazers_count":193,"open_issues_count":9,"forks_count":11,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-04-14T14:49:51.043Z","etag":null,"topics":["github-actions","logseq","nbb","publish"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/logseq.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-04-12T19:38:52.000Z","updated_at":"2024-04-16T14:25:10.490Z","dependencies_parsed_at":"2023-12-18T17:29:54.723Z","dependency_job_id":"8004c349-0b09-47b9-9eee-ee99d1bd6c2e","html_url":"https://github.com/logseq/publish-spa","commit_stats":{"total_commits":50,"total_committers":5,"mean_commits":10.0,"dds":0.07999999999999996,"last_synced_commit":"cb365242b95ffe269e67c147efc5ea8ad1ca65a6"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logseq%2Fpublish-spa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logseq%2Fpublish-spa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logseq%2Fpublish-spa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logseq%2Fpublish-spa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logseq","download_url":"https://codeload.github.com/logseq/publish-spa/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246351018,"owners_count":20763233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","logseq","nbb","publish"],"created_at":"2024-12-23T13:34:50.243Z","updated_at":"2025-03-30T17:09:28.619Z","avatar_url":"https://github.com/logseq.png","language":"Clojure","funding_links":[],"categories":["Clojure"],"sub_categories":[],"readme":"## Description\n\nThis is a [github action](https://github.com/features/actions) to publish a\nLogseq graph as a [publishing](https://docs.logseq.com/#/page/publishing) Single\nPage Application (SPA). This action can also be run as a [CLI](#cli).\n\n## Usage\n\n### Github Action\n\nTo setup this action, [enable github pages on your\nrepository](https://docs.github.com/en/pages/quickstart) and add the file\n`.github/workflows/publish.yml` to your graph's github repository with the\ncontent:\n\n``` yaml\non: [push]\n\npermissions:\n  contents: write\njobs:\n  test:\n    runs-on: ubuntu-latest\n    name: Publish Logseq graph\n    steps:\n      - uses: actions/checkout@v4\n      - uses: logseq/publish-spa@v0.3.0\n      - name: Add a nojekyll file # to make sure asset paths are correctly identified\n        run: touch $GITHUB_WORKSPACE/www/.nojekyll\n      - name: Deploy 🚀\n        uses: JamesIves/github-pages-deploy-action@v4\n        with:\n          folder: www\n```\n\nThat's it! Your graph will publish on future git pushes by pushing to the\n`gh-pages` branch. Don't forget to [configure your\ngraph](https://docs.logseq.com/#/page/publishing/block/configuration) if you're\nnot seeing the pages you expect to see.\n\nNOTE: The above example may not have the latest version of this action. See\n[CHANGELOG.md](CHANGELOG.md) for released versions. If you'd prefer to always be\non the latest version of this action, use `logseq/publish-spa@main` but be\ncareful as there could be breaking changes.\n\n#### Action Inputs\n\nThis action takes the following inputs:\n\n```yaml\n- uses: logseq/publish-spa@main\n  with:\n    graph-directory: my-logseq-notes\n    output-directory: out\n    version: nightly\n```\n\nThis action has the following inputs:\n\n##### `graph-directory`\n\n**Required:** Root of the graph directory. Defaults to `.`.\n\n##### `output-directory`\n\n**Required:** Directory where graph is published. Defaults to `www`.\n\n##### `version`\n\n**Required:** Specifies the version of Logseq to build the frontend. This can be\na git tag (version) or a specific git SHA. Defaults to `0.10.6`.\n\nNote: A version before 0.9.2 is not supported as Logseq started supporting this\naction with 0.9.2.\n\n##### `theme-mode`\n\nOptional: Theme mode for frontend. Can be \"dark\" or \"light\". Defaults to \"light\".\n\n##### `accent-color`\n\nOptional: Accent color for frontend. Can be one of \"tomato\", \"red\", \"crimson\", \"pink\", \"plum\", \"purple\", \"violet\", \"indigo\", \"blue\", \"cyan\", \"teal\", \"green\", \"grass\", \"orange\", \"brown\". Defaults to \"blue\".\n\n### CLI\n\nTo use this as a CLI locally, first install\n[babashka](https://github.com/babashka/babashka#installation) and\n[clojure](https://clojure.org/guides/install_clojure). Then:\n\n```sh\n$ git clone https://github.com/logseq/publish-spa\n# If you have yarn 1.X:\n$ cd publish-spa \u0026\u0026 yarn install\n$ yarn global add $PWD\n\n# Otherwise use npm:\n$ cd publish-spa \u0026\u0026 npm i -g\n```\n\nThis CLI depends on Logseq being checked out locally in order to build the\nstatic directory for it. If you haven't built the static directory, you'll need\nto do it once (takes some time):\n\n```sh\n$ git clone https://github.com/logseq/logseq \u0026\u0026 cd logseq\n# Switch to a stable version\n$ git checkout 0.10.6\n# Install deps and build static directory\n$ yarn install --frozen-lockfile \u0026\u0026 yarn gulp:build \u0026\u0026 clojure -M:cljs release publishing\n```\n\nThen use the CLI from any logseq graph directory!\n```sh\n$ logseq-publish-spa out\nParsing 306 files...\nExport public pages and publish assets to out successfully 🎉\n```\n\n## Development\n\nThis github action use [nbb-logseq](https://github.com/logseq/nbb-logseq) and\n[nbb compatible libraries](https://github.com/logseq/logseq/tree/master/deps) to build up a\nLogseq database and then generate html for the publishing app.\n\nWhen viewing a published graph directory, it's highly recommended to use a local http server as multiple features are known to not work (e.g. assets and slides) when viewed as a static file. For example, to view the published graph `out` from the above example:\n```sh\n$ python3 -m http.server 8080 -d out\n```\n\n## LICENSE\nSee LICENSE.md\n\n## Additional Links\n* https://github.com/pengx17/logseq-publish - Used to be the most popular action for publishing Logseq graphs. Now archived. Thanks to @pengx17 for his great work with this. :heart:\n* https://github.com/L-Trump/logseq-publish-docker - Docker image of this repository. This\n  repository [can be used with GitLab](https://github.com/logseq/publish-spa/issues/18#issuecomment-2100932405).\n* https://github.com/logseq/graph-validator - Github action that this one is modeled after\n* https://github.com/logseq/docs - Logseq graph that uses this action\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogseq%2Fpublish-spa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogseq%2Fpublish-spa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogseq%2Fpublish-spa/lists"}