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/)
By using this, you can easily publish your org-roam as a digital garden 🌱
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/publish-org-roam-ui@main
with:
org-roam-db-filename: <org-roam-filename>.db
![generated artifact](https://private-user-images.githubusercontent.com/38206334/299356679-fdc9f133-c97c-4d3b-b328-3a1d86560e83.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM5MDkxMDIsIm5iZiI6MTcyMzkwODgwMiwicGF0aCI6Ii8zODIwNjMzNC8yOTkzNTY2NzktZmRjOWYxMzMtYzk3Yy00ZDNiLWIzMjgtM2ExZDg2NTYwZTgzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE3VDE1MzMyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU1MTNiZTk4YmNmMmY4ODJlZDgzNWVhZjc0NTNlNmFkNGYxODdjYTU2MTViNTNkZjFhMWU2ZDE2ZGM1MWQwYWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.hXV29GyApwPHbeHLJXQd-sgatxv7Vx7gx0wsiOCkJjY)
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
You can create an img
directory directly under the repository and display image files stored there.
[[./img/test.png]]
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
└── ・・・
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!
Sites generated by publish-org-roam-ui have additional features implemented that are not in the original org-roam-ui.
Sites generated by publish-org-roam will have code blocks highlighted.
![code highlighting screenshot](https://private-user-images.githubusercontent.com/38206334/316234381-446d2575-8079-473f-a886-be2b2bec03be.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM5MDkxMDIsIm5iZiI6MTcyMzkwODgwMiwicGF0aCI6Ii8zODIwNjMzNC8zMTYyMzQzODEtNDQ2ZDI1NzUtODA3OS00NzNmLWE4ODYtYmUyYjJiZWMwM2JlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE3VDE1MzMyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkwOWFiNGMwNTg1ZDUzYjIwMGRlNjM0NjM3NDkxNWM0MmY0OWM2M2IxNDQ2NmE0MjZmYzQwZjU0MTRmMzFhOTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.vQu1OZdor-dggkpEUocvpFjyAw_Zfs5caR2Gz0H2Jz8)
Search by title, tags, or content and instantly open a node.
![search screenshot](https://private-user-images.githubusercontent.com/38206334/320276487-26f20ce8-1dbf-4377-bee2-fa14da7de105.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM5MDkxMDIsIm5iZiI6MTcyMzkwODgwMiwicGF0aCI6Ii8zODIwNjMzNC8zMjAyNzY0ODctMjZmMjBjZTgtMWRiZi00Mzc3LWJlZTItZmExNGRhN2RlMTA1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE3VDE1MzMyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI5NTZkY2E2MTUxMmYwMjg4ZjE5YTZiODE0MjRlZTE4NTI5ZjI1MmQ0NjNlZjNiMTNjN2U3YTZjMDY5YjE5MTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.wWpcwpwpyuUC9rqvLn2M-4g9nin8oMFiwKP7XOouEdI)
By writing the #+ATTR_HTML keyword for an image, it will be set as HTML attributes for the <img>
tag.
#+ATTR_HTML: :alt org-mode-unicorn :width 280px :align right
[[./img/org-mode-unicorn.svg]]
![HTML attributes example screenshot](https://private-user-images.githubusercontent.com/38206334/341951285-75c32431-15c7-4fad-a019-039a3a2c6e4e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM5MDkxMDIsIm5iZiI6MTcyMzkwODgwMiwicGF0aCI6Ii8zODIwNjMzNC8zNDE5NTEyODUtNzVjMzI0MzEtMTVjNy00ZmFkLWEwMTktMDM5YTNhMmM2ZTRlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE3VDE1MzMyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTUzMzA2NzY0ZjJmMTI1ZWFiYzdjOGY0NzU3ZmU5OWQ2ZDQzZDNmMjA3M2U3MjRlZDQ4NDdjYzM2NmJkNGI4OGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.LhD5hwEoCvQd1tMkX0EKAjyJecao5knAJ3pEikoIkAk)
If you don't want to upload org files to the repository, you can obtain the same site as generated by GitHub Actions by running the site generation script locally.
git clone git@github.com:ikoamu/publish-org-roam-ui.git
cd publish-org-roam-ui
./local.sh /path/to/org-roam-dir <org-roam-filename>.db