sawhney17 / logseq-schrodinger

A plugin to export pages in Logseq to Hugo.
MIT License
331 stars 38 forks source link

Is there block level publishing support? #35

Open namoopsoo opened 1 year ago

namoopsoo commented 1 year ago

Hi! I tried with "logseq-schrodinger version 1.3.0" first time today the "hugo-single-export" on a page today. I got a nice output. Pretty cool! Thanks!

For logseq, I like the "write everything in Journal/Daily view, referring to specific nodes as you go"

and currently I manually select the block I want to publish in a "YYY_MM_DD.md" and manually put that into my hugo content/en/post/YYY-MM-DD-stuff.md . I am getting tired just writing that sentence 😅 .

With your plugin I tried to select just a block

and "hugo-single-export" and in the sidebar I get Uncaught (in promise) Error: Expected string, got: nil ,

Screen Shot 2023-02-18 at 1 01 55 PM

From what I see "Line 151, Column 57" of "helpers.js" refers to the global.document of the line 151,

var injectionPoint = global.document.head || global.document.body;

so I am guessing in logseq, for a block global.document is not a thing?

I also tried embedding

So I created a new evergreen note, and I added

{{embed ((63f10b5d-f204-4ce6-8e4d-52f975e644fe))}}

in there, and when I ran "hugo-single-export", here the embedded part, only included the text from the parent block being embedded but not from the children.

Maybe the block publish is not common?

My first basic question is whether the publishing of blocks is supported and maybe I'm doing this wrong. And second I am wondering what are your thoughts on how common this publishing style is and whether you think the idea belongs in "logseq-schrodinger" in some future future iteration or whether maybe it is not worth it?

-Michal

namoopsoo commented 1 year ago

As for including the block embed in a "hugo-single-export", I had this theory that maybe the embedded block did not get included because it was in a page which did not have public:: true, so I fixed that and I set public:: true for that journal page and I tried both "hugo-single-export" and "export-public-pages-to-hugo" and in both cases, the page with the {{embed ((63f10b5d-f204-4ce6-8e4d-52f975e644fe))}} block embed, does not get included in the output markdown.

And when I tried the logseq native "Export graph > Export public pages" , in that case, the page with the embed, does export showing the embedded content just fine. (But yea logseq native export creates one giant "index.html" which is not really the same as individual markdown files.)