-- Leo's gemini proxy

-- Connecting to sixohthree.com:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini; lang=en

Publishing to the Gemlog with logseq


I've recently started using logseq, "a privacy-first, open-source knowledge base that works on top of local plain-text Markdown and Org-mode files." Of course I'm curious what else I can use logseq for, so I'm live-testing publishing to my gemlog from within logseq.


Logseq


I already have a workflow where my gemlog is automatically synched to a VPS using Resilio Sync, and a cron script rebuilds the atom feed every 5 minutes using gmisub2atom.


gmisub2atom


I can easily create a new page in logseq, so let's make a Gemlog page and create a child node, "Publishing to the Gemlog with logseq" (the page you're reading right now). We'll create some "properties," aka frontmatter, to this page for attributes like the post status (let's treat posts as "draft" unless they have an explicit "published" status) and post date.


logseq documentation: term/properties


As we write, we'll try to be gemtext-friendly, with no inline links or other text properties that don't translate 1:1 to gemtext. We still need to convert the Markdown to Gemtext. We can use CommonMark from the League of Extraordinary Packages to get an AST for a Markdown document, which is maybe overkill but I'm going to run with it.


CommonMark

League of Extraordinary Packages


Then we write some PHP to parse logseq's Gemlog index and get a list of articles, parse those articles and convert them into Gemtext, and write those articles back out to my capsule's Gemlog directory.


logseq2gemlog


The above repository isn't quite done: I should really backfill my short list of Gemlog posts into logseq and then have the script regenerate the Gemlog index. Not bad for a first attempt though.


✑ Annika

📅 21 May 2022


gemlog

home

-- Response ended

-- Page fetched on Tue May 21 11:07:34 2024