How this is built
This site starts from a Logseq graph, its actually the Logseq graph I’ve been using since ~2022, but every page in that graph denoted with public:: true
is part of this website.

My graph as it stands as of Jan 31st, 2025
I’ve written some Python that speaks to the Logseq HTTP API (basically the same API that is exposed to Logseq plugins, but accessible over a simple HTTP RPC interface).
This Python queries Logseq with a simple (property public true)
, to get all of the pages for the site, and then gets each page using the logseq.Editor.getPageBlocksTree
method against the HTTP API.
The structure returned by getPageBlocksTree
is pretty nice to work with, I map over this structure, and in the most simple case, I simply take the .content
property of a block, and add it to a string for each child of a block.
Where things get interested, is if the block has properties on it, such as this example from projects:
component:: Project
image:: <Image src='/asset/_jaharrhy_1738274907463_0.webp' alt='_jaharrhy.webp' width={167} height={149} />
link:: https://www.cs.mun.ca/~jaharrhy/
name:: ~jaharrhy
description:: My labnet garden, giving old web vibes.
I have some code, that turns the above into this:
<Project image="/asset/_jaharrhy_1738274907463_0.webp" link="https://www.cs.mun.ca/~jaharrhy/" name="~jaharrhy" description="My labnet garden, giving old web vibes." />
During this I also make note of <Image src='/asset/_jaharrhy_1738274907463_0.webp' alt='_jaharrhy.webp' width={167} height={149} />
, parse it using Regex, and keep a record of it separate to the markdown, so later on I can bundle up all assets referenced by my graph, and create an asset manifest I can later upload to cloud storage.
I also support embedding:
Images, using the above method of regular expressions.
Excalidraw drawings.
Logseq has native support for doing a /draw
slash command, giving me an embedded Excalidraw UI in Logseq.
I simply export these to SVG, saving a reference to this in an <img ... />
tag and adding another asset to the asset manifest.
Embedding pages in pages.
Doing {{embed [[Example]]}}
will embed the document visually in Logseq, I can just find these and call my already in use get_page
to get the content of any page, and spit out its markdown directly into the document.
I plan on the ability to embed blocks, i.e. sections of documents from places into other places.
Still need to figure out exactly how to denote that something is a reference visually.
Raw HTML
@@html ... @@
in Logseq will render raw HTML I can see in the editor, I just strip these from the output so my parser in the Astro side kicks in.