logseq / publish-spa

A github action and CLI to publish logseq graphs as a SPA app
MIT License
233 stars 15 forks source link

Publish my Logseq graph - is hard because of a few things missing or not stressed in the README. #4

Closed ChasManRors closed 5 months ago

ChasManRors commented 1 year ago

I have never written a gh Issue before. I hope putting these comments in an Issue is the proper place for them. I use Logseq daily and want it to be the best.

I did NOT use the official Logseq documentation at https://docs.logseq.com/#/page/publishing to publish my Logseq graph. I tried. I suppose with a little more documentation in the README I will be able to get it to work. So here are my requests, but first.

In case anyone else is having trouble and can use these simple alternative publishing solutions, here they are: https://www.youtube.com/watch?v=fHc2cVNMNrA&ab_channel=OneStutteringMind https://docs.logseq.com/?ref=blog.logseq.com#/page/publishing%20(desktop%20app%20only)

I skipped the official documentation because I had too many questions and:

  1. I wish the README was written as arecipe. That it required multiple educated guesses and I still need more time to get it to work makes me sad. 1.1 Ok, It required some understanding of github actions. 1.2 It is not clear if I am to use the graph or the exported graph for this gh Action. Which one gets pushed to github for the github Action? I must have missed this. But bears repeating in the README for an official solution. 1.3 It is not clear if I can git remote add origin to the logseq graph directory or if it has to be copied else where first. Why would I ask that? When I was using an earlier solution - https://github.com/pengx17/logseq-publish and did a git fetch and git pull It messed things up s.t. no further deploys worked. 1.4 Most ppl may know the answer but it might help to be explicit. Can I ignore the gitdir: in the .git file in the Logseq graph dir, assuming I am pushing up the graph or should I push from the referenced directory? Seems like they should both work. Tangentially, there seems to be a bug in the All graphs page. If a graph is in a subdirectory of a logseq dir the leading logseq dir is ignored. 1.5 The pengx17 gh Actions solution seems to allow for multiple graphs to all be present on gh pages. Can this feature bug be preserved?
logseq-cldwalker commented 1 year ago

Hi. Thanks for the feedback. I've added one of those links to the official docs. .git is needed in order for git to work so you can ignore it and you shouldn't modify it.

The pengx17 gh Actions solution seems to allow for multiple graphs to all be present on gh pages. Can this feature bug be preserved?

I'm not sure what the first sentence means. I think you're asking whether a repository can have multiple logseq graphs in it. If so, then yes. You could then configure this action with the graph-directory input to specify the subdirectory of the logseq graph you want to publish

raging-sea commented 1 year ago

This is my first time to use github actions. The page shows 404 after the deployment. Please help. This is my yml file

name:  Publish

on: 
  push:
    branches: [ master ]

  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - name: Logseq Publish
        uses: logseq/publish-spa@main
        with:
          output-directory: www
          verson: 0.9.15

      - name: add a nojekyll file
        run: touch $GITHUB_WORKSPACE/www/.nojeklly

      - name: Deploy
        uses: JamesIves/github-pages-deploy-action@v4
        with:
          branch: gh-pages
          folder: www
          clean: true
          single-commit: true
logseq-cldwalker commented 1 year ago

Hi @raging-sea . I'd recommend double checking your yml file against the provided example. I don't see a permissions line and it seems you misspelled the nojekyll file

raging-sea commented 1 year ago

@logseq-cldwalker Thank you for your response! I added the permission content and fixed the name of nojekyll but still a 404. And I can't find the permission line in logseq/doc's yml file.

Then I tried to paste the full content of the provided example to my yml file, still 404

---update--- fixed this by changing the page deployment branch to gh-pages. Now it works perfectly! I paste all the setting yml from logseq/doc and found it doesn't have the permission line. No idea why it works for the logseq/doc. After added the permission line to logseq/doc's yml, it works with no error.

logseq-cldwalker commented 5 months ago

Closing as no reponse from issue creator