philmichel / obsidian-to-hugo-pages

Github workflow action that converts Obsidian notes to a static website hosted in Github pages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Usage

Simply do a git push. Hugo static content is generated within the Github runner.

Installation

Note: A detailed tutorial can be found here

  1. Place Obsidian vault within a correctly setup Github pages repository. If a Hugo site has not been generated, run hugo new site.
  2. Create an Github action in the repository, e.g..github/workflows/main.yml with the following contents. Note vault-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 }}
  1. Ensure the repository workflows permissions for the Github actions on the repository is set to Read and write. This can be found in Settings under the repository name, Actions, General. Reference

Further details

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.

About

Github workflow action that converts Obsidian notes to a static website hosted in Github pages

License:MIT License


Languages

Language:HTML 100.0%