Skip to content

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

License

Notifications You must be signed in to change notification settings

haxrob/obsidian-to-hugo-pages

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages