Simply do a git push
. Hugo static content is generated within the Github runner.
Note: A detailed tutorial can be found here
- Place Obsidian vault within a correctly setup Github pages repository. If a Hugo site has not been generated, run
hugo new site
. - Create an Github action in the repository, e.g.
.github/workflows/main.yml
with the following contents. Notevault-path
should be changed to the directory name of the Obsidian vault:
name: Deploy from Obsidian notes
on:
push:
branches:
- main
jobs:
publish_job:
runs-on: ubuntu-latest
name: Publish Obsidian notes to Github pages
steps:
- uses: x1sec/obsidian-to-hugo-action@main
with:
vault-path: myvault
github-token: ${{ secrets.GITHUB_TOKEN }}
- Ensure the repository workflows permissions for the Github actions on the repository is set to
Read and write
. This can be found inSettings
under the repository name,Actions
,General
. Reference
The conversion from Obsidian Markdown to Hugo is done by running obsidian-export and adding a modification to the default template layout to fix relative URIs for links and images embedded in the Obsidian notes. Hugo generation uses the workflow hugo-setup
Please feel free to reach out to me on Twitter if you have any issues.