/publish-org-roam-ui

Generates a static site for org-roam-ui from org-roam files managed on GitHub. And it is easy to publish to GitHub Pages.

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

publish-org-roam-ui

This action generates a static site for org-roam-ui from org-roam files managed on GitHub.

It also allows deployment to GitHub Pages. (See https://ikoamu.github.io/publish-org-roam-ui/)

How to Use

First, please manage the .org files in org-roam-directory and the db file in org-roam using git.

(setq org-roam-directory "/path/to/org-roam-dir")
(setq org-roam-db-location "/path/to/org-roam-dir/<org-roam-filename>.db")
cd /path/to/org-roam-dir/
git init

Then, a static org-roam-ui site is easily generated for the artifact by creating a workflow like the following.

name: Generate static org-roam-ui page
on:
  push:
    branches:
      - main
jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - name: Generate org-roam-ui page
        uses: ikoamu/org-roam-ui-hosting@main
        with:
          org-roam-db-filename: <org-roam-filename>.db
generated artifact

Deploy to GitHub Pages by setting deploy-to-pages to true. And sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages.

Under the repositories Settings > GitHub Pages select Deply from Action.

permissions:
  contents: read
  pages: write
  id-token: write

jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - name: Generate org-roam-ui page
        uses: ikoamu/publish-org-roam-ui@main
        with:
          org-roam-db-filename: <org-roam-filename>.db
          deploy-to-pages: true

Show Image

You can create an img directory directly under the repository and display image files stored there.

[[./img/test.png]]

Store org files in subdirectory

Set org-roam-directory to store org files in a subdirectory instead of directly under the repository.

jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - name: Generate org-roam-ui page
        uses: ikoamu/publish-org-roam-ui@main
        with:
          org-roam-directory: org-files
          org-roam-db-filename: org-roam.db
YourRepository
├── .github/workflows
├── org-files
│   ├── img
│   │   ├── img1.png
│   │   └── img2.png
│   ├── org-roam.db
│   ├── roam1.org
│   ├── roam2.org
│   └── ・・・
├── README.org
└── ・・・

Setting site tile

You can change the title of the site by specifying site-tile. (The default is ORUI)

jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - name: Generate org-roam-ui page
        uses: ikoamu/publish-org-roam-ui@main
        with:
          org-roam-db-filename: <org-roam-filename>.db
          site-title: my org-roam!

Customized org-roam-ui

Sites generated by publish-org-roam-ui have additional features implemented that are not in the original org-roam-ui.

Code highlighting

Sites generated by publish-org-roam will have code blocks highlighted.

code highlighting screenshot

Search feature

Search by title, tags, or content and instantly open a node.

search screenshot