Giter Site home page Giter Site logo

fenton42 / obsidian-to-jekyll Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adriansteffan/obsidian-to-jekyll

0.0 0.0 0.0 5 KB

This is a simple python script that converts Obsidian notes to a format that is compatible with Jekyll themes that support wikilinks and backlinking like Jekyll Garden or Digital Garden Jekyll Template. It adds the filename to the frontmatter as a title and lets you set the visibility of your notes on a folder or note-by-note basis.

Home Page: https://notes.adriansteffan.com

Python 100.00%

obsidian-to-jekyll's Introduction

Obsidian 2 Jekyll

This is a simple python script that converts Obsidian notes to a format that is compatible with Jekyll themes that support wikilinks and backlinking like Jekyll Garden or Digital Garden Jekyll Template. It adds the filename to the frontmatter as a title and lets you set the visibility of your notes on a folder or note-by-note basis.

Prerequisites

Usage Instructions

Converting

To convert your vault into theme-compatible markdown, run

python3 [OBSIDIAN_VAULT_DIR] [OUTPUT_DIR]

Controlling the Visibility of your Notes

Notes are either public or private, where the script does not copy over notes that are defined as private.

  • To explicitly set a note to public or private, include public: yes or public: no in the yaml frontmatter.
  • If a note does not define its own visibility, it inherits the visibility of the folder it resides in. Folders can be made public or private by placing a .public or a .private file in the directory.
  • If the directory does not define its own visibility, it inherits the visibility of its parent directory.
  • If the parent directory also does not do not define or inherit a visibility, the visbility defaults to private.

Limitations

  • (TODO) & in the filename breaks links
  • (TODO) obsidian aliases do not work atm
  • duplicate filenames - when there are two notes with the same name, only one will be copied to the destination directory
  • only works for jenkyll themes that support wikilinks - would need conversion to standard markdown links

Duct Tape Obsidian Publish

This script is part of my selfmade Obsidian publish setup, which is roughly outlined below. You can see the result over at my digital garden. It uses the Jekyll Garden theme and Github Pages to publish the notes.

The setup consists of 3 separate repositories:

  • obsidian-to-jekyll (this one)
  • jekyll-theme (the repository of the Jekyll theme connected to Github Pages)
  • obsidian-vault (the Bbsidian vault connecten via Obsidian Git sync)
ducttape-obsidian-publish
├── obsidian-to-jekyll
├── jekyll-directory
└── obsidian-vault

The following Github workflow is placed in the obsidian-vault repository and opdates the Jekyll page whenever there is a change to the vault. Add ssh credentials and adjust the filepaths if you intend to use the workflow in your own setup.

name: Publish Notes to Jekyll
on: 
  push:
      branches:
        - master
  workflow_dispatch:

jobs:
  deploy-application:
    runs-on: ubuntu-latest
    steps:
    - run: |
        eval $(ssh-agent -s)
        mkdir -p ~/.ssh
        chmod 700 ~/.ssh
        echo "${{ secrets.DEPLOYMENT_SERVER_KEY }}" | tr -d '\r' | ssh-add -
        echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
        ssh ${{ secrets.DEPLOYMENT_SERVER_USER }}@${{ secrets.DEPLOYMENT_SERVER_IP }} "cd /YOURPATH/ducttape-obsidian-publish/obsidian-vault && git pull"
        ssh ${{ secrets.DEPLOYMENT_SERVER_USER }}@${{ secrets.DEPLOYMENT_SERVER_IP }} "cd /YOURPATH/ducttape-obsidian-publish/obsidian-to-jekyll && python3 ./convert.py ../obsidian-vault ../jekyll-directory/NOTE_DIRECTORY"
        ssh ${{ secrets.DEPLOYMENT_SERVER_USER }}@${{ secrets.DEPLOYMENT_SERVER_IP }} 'cd /YOURPATH/ducttape-obsidian-publish/jekyll-directory && git pull && git add . && git commit -m "Update Digital Garden" && git push'

Authors

obsidian-to-jekyll's People

Contributors

adriansteffan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.