• Stars
    star
    217
  • Rank 181,040 (Top 4 %)
  • Language
    Clojure
  • License
    MIT License
  • Created over 1 year ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A github action and CLI to publish logseq graphs as a SPA app

Description

This is a github action to publish a Logseq graph as a publishing Single Page Application (SPA). This action can also be run as a CLI.

Usage

Github Action

To setup this action, enable github pages on your repository and add the file .github/workflows/publish.yml to your graph's github repository with the content:

on: [push]

permissions:
  contents: write
jobs:
  test:
    runs-on: ubuntu-latest
    name: Publish Logseq graph
    steps:
      - uses: actions/checkout@v3
      - uses: logseq/[email protected]
      - 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

That's it! Your graph will publish on future git pushes by pushing to the gh-pages branch. Don't forget to configure your graph if you're not seeing the pages you expect to see.

NOTE: The above example may not have the latest version of this action. See CHANGELOG.md for released versions. If you'd prefer to always be on the latest version of this action, use logseq/publish-spa@main but be careful as there could be breaking changes.

Action Inputs

This action takes the following inputs:

- uses: logseq/publish-spa@main
  with:
    graph-directory: my-logseq-notes
    output-directory: out
    version: nightly

This action has the following inputs:

graph-directory

Required: Root of the graph directory. Defaults to ..

output-directory

Required: Directory where graph is published. Defaults to www.

version

Required: Specifies the version of Logseq to build the frontend. This can be a git tag (version) or a specific git SHA. Defaults to 0.9.2.

Note: A version before 0.9.2 is not supported as Logseq started supporting this action with 0.9.2.

theme-mode

Optional: Theme mode for frontend. Can be "dark" or "light". Defaults to "light".

CLI

To use this as a CLI locally, first install babashka and clojure. Then:

$ git clone https://github.com/logseq/publish-spa
$ cd publish-spa && yarn install
$ yarn global add $PWD

This CLI depends on Logseq being checked out locally in order to build the static directory for it. If you haven't built the static directory, you'll need to do it once (takes some time):

$ git clone https://github.com/logseq/logseq && cd logseq
# Switch to a stable version
$ git checkout 0.9.2
# Install deps and build static directory
$ yarn install --frozen-lockfile && yarn gulp:build && clojure -M:cljs release publishing

Then use the CLI from any logseq graph directory!

$ logseq-publish-spa out
Parsing 306 files...
Export public pages and publish assets to out successfully πŸŽ‰

Development

This github action use nbb-logseq and nbb libraries to build up a Logseq database and then generate html for the publishing app.

LICENSE

See LICENSE.md

  • https://github.com/pengx17/logseq-publish - Thanks to @pengx17 for his great work with this. ❀️ This is currently the most popular action for publishing Logseq graphs. If you're happy using it, feel free to continue using it. publish-spa has more flexibility with versions of Logseq that can be used and may acquire more functionality than it since it hooks into the publishing process at a lower level.
  • https://github.com/logseq/graph-validator - Github action that this one is modeled after
  • https://github.com/logseq/docs - Logseq graph that uses this action

More Repositories

1

logseq

A privacy-first, open-source platform for knowledge management and collaboration. Download link: http://github.com/logseq/logseq/releases. roadmap: http://trello.com/b/8txSM12G/roadmap
Clojure
31,871
star
2

awesome-logseq

Awesome Logseq resources created by the community <3
2,230
star
3

logseq-plugin-samples

Logseq plugin samples for beginner 🌱
CSS
298
star
4

marketplace

A centralized packages manager for Logseq marketplace plugins.
JavaScript
239
star
5

mldoc

Another Emacs Org-mode and Markdown parser.
OCaml
235
star
6

git-auto

A Simple Shell Script To Do Git Commit And Push Automatically
Shell
179
star
7

nbb-logseq

nbb with features enabled for logseq
Clojure
140
star
8

publish

JavaScript
130
star
9

docs

Logseq documentation
Clojure
127
star
10

graph-validator

Validate your logseq graphs
Clojure
47
star
11

awesome-logseq-cn

31
star
12

rdf-export

Export a logseq graph to RDF
Clojure
29
star
13

plugins

Documentation site of Logseq plugins
HTML
19
star
14

deprecated-github-backend

Clojure
18
star
15

bb-tasks

Reusable babashka tasks used by logseq team
Clojure
17
star
16

rsapi

Logseq's rsapi: Encryption, Sync.
Rust
16
star
17

sqlite-db

SQLite integration via WASM
C
12
star
18

sites

Logseq home page
CSS
10
star
19

logseq-cn

Logseq δΈ­ζ–‡θ΅„ζ–™εΊ“
8
star
20

handbooks

Handbooks resources for Logseq.
Clojure
5
star
21

capacitor-file-sync

Logseq Sync capacitor plugin for iOS and Android
Swift
5
star
22

datahike-rs

Experimental datahike native binding
JavaScript
5
star
23

logseq-extension-example

An example Logseq extension that showcases Logseq's API
JavaScript
3
star
24

Ranker

Ranker is the home for prioritizing and tracking issues and feature requests. We pull in tickets from GitHub and discussions from Discourse, and use algorithm to rank requests so the most important features get built first.
Python
3
star
25

AgeEncryption

Age Encryption
Rust
2
star
26

logseq.github.io

https://docs.logseq.com
HTML
2
star