# Publishing notes, static site generation with Org-roam

**URL:** <https://org-roam.discourse.group/t/publishing-notes-static-site-generation-with-org-roam/3800>\
**Category:** Requests\
**Created:** [May 5, 2025, 3:55pm UTC](https://org-roam.discourse.group/t/publishing-notes-static-site-generation-with-org-roam/3800 "2025-05-05T15:55:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![orgroamer](https://avatars.discourse-cdn.com/v4/letter/o/54ee81/32.png) [@orgroamer](https://org-roam.discourse.group/u/orgroamer)\
**Post date:** [May 5, 2025, 3:55pm UTC](https://org-roam.discourse.group/t/publishing-notes-static-site-generation-with-org-roam/3800/1 "2025-05-05T15:55:28Z")

</div>

I’d like to publish some of my Org-roam nodes (those with `:publish: true` in the properties drawer or something like that).

This would be part of a more complex website, but I’d start off with just the nodes.

I’ve see Ox-Hugo, Quartz, Hakyll, and Org-publish mentioned in posts, but I’m unsure how well these would fare with Org-roam specifically, as opposed to vanilla Org-mode.

I’d prefer to use Org-publish, but would be willing to try another tool if it is not suited to Org-roam.

Any pointers? What are other people using?

---

<div class="post-metadata">

**Author:** ![JeffBrown](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/jeffbrown/32/254_2.png) [@JeffBrown](https://org-roam.discourse.group/u/JeffBrown)\
**Post date:** [May 5, 2025, 9:09pm UTC](https://org-roam.discourse.group/t/publishing-notes-static-site-generation-with-org-roam/3800/2 "2025-05-05T21:09:58Z")

</div>

I do this. There’s the following passage in my .emacs file:

```auto
(setq org-roam-capture-templates
      '( ("u" "public" plain "%?"
          :if-new (file+head "public/${slug}.org"
                             "#+title: ${title}\n")
          :unnarrowed t)
	 ("r" "personal" plain "%?"
          :if-new (file+head "personal/${slug}.org"
                             "#+title: ${title}\n")
          :unnarrowed t)
          ;; and a few more
	 ))

```

When I make a new note, org-roam asks me what repo to put it in. That selection is only a single keystroke – “u” is for public, “r” is for personal, etc. The public repo is one that I publish on github publicly, whereas personal is private.

---

<div class="post-metadata">

**Author:** ![JeffBrown](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/jeffbrown/32/254_2.png) [@JeffBrown](https://org-roam.discourse.group/u/JeffBrown)\
**Post date:** [May 5, 2025, 9:14pm UTC](https://org-roam.discourse.group/t/publishing-notes-static-site-generation-with-org-roam/3800/3 "2025-05-05T21:14:40Z")

</div>

Oh but that’s only half of your problem. You also want the public notes to be navigable, right? For that I wrote some code:

> **[GitHub - JeffreyBenjaminBrown/publish-org-roam-repos: Publish a collection of...](https://github.com/JeffreyBenjaminBrown/publish-org-roam-repos/tree/main)**
>
> main

It reads your data and writes a copy to empty folders you specify where the links have been changed from org-roam links, which GitHub doesn’t understand, to Github style file-and-anchor links. A user online can thus follow links. They can’t see backlinks, though.

---

<div class="post-metadata">

**Author:** ![orgroamer](https://avatars.discourse-cdn.com/v4/letter/o/54ee81/32.png) [@orgroamer](https://org-roam.discourse.group/u/orgroamer)\
**Post date:** [May 9, 2025, 2:43pm UTC](https://org-roam.discourse.group/t/publishing-notes-static-site-generation-with-org-roam/3800/4 "2025-05-09T14:43:13Z")

</div>

OK thank you, that is helpful. I’d prefer to have everything in the same folder and then use Org properties drawer to differentiate, but I think I can write some code for that.

Where do you think I would write that code though? Would I extend the static site generator itself, or do something in Emacs Lisp?

Alternatively, I could write my own code in a different language to generate a set of files that I want to publish, and then pass those files to a static site generator like Ox-Hugo. This is what I am leaning towards now.

With your repo, I think it would not be for me because I want to host on my own webserver not GitHub, but I may be misunderstanding what your code does. Does it do static site generation too, or use an existing program for this?

I came across [this](https://doubleloop.net/2020/08/21/how-publish-org-roam-wiki-org-publish) from 5 years ago that uses Org-publish and does generate backlinks, although the code is quite complex and would probably need a lot of modifying on my end.

---

<div class="post-metadata">

**Author:** ![doubleloop](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/doubleloop/32/99_2.png) [@doubleloop](https://org-roam.discourse.group/u/doubleloop)\
**Post date:** [May 25, 2025, 9:19pm UTC](https://org-roam.discourse.group/t/publishing-notes-static-site-generation-with-org-roam/3800/5 "2025-05-25T21:19:59Z")

</div>

> [@orgroamer](#):
>
> I came across [this](https://doubleloop.net/2020/08/21/how-publish-org-roam-wiki-org-publish) from 5 years ago that uses Org-publish and does generate backlinks, although the code is quite complex and would probably need a lot of modifying on my end.

The (slightly) more up-to-date page for this is here: [How I publish my digital garden to the web with org-publish](https://commonplace.doubleloop.net/how-i-publish-my-wiki-with-org-publish)

I still publish my org-roam to the web at [https://commonplace.doubleloop.net](https://commonplace.doubleloop.net) with org-publish.

Happy to answer any questions.
