Coder Social home page Coder Social logo

obyde's Introduction

obyde

A minimal tool to convert a "standardly" configured Obsidian vault to a Jekyll or Hugo blog.

Installation

Install obyde using pip:

pip install git+https://github.com/khalednassar/obyde

Or using pipenv:

pipenv install git+https://github.com/khalednassar/obyde#egg=obyde

Caveat

obyde is mainly meant to support easy "default" Obsidian vault to Jekyll or Hugo blog conversions and it does so in an opinionated way. In order to create posts in an easy fashion, it requires that post filenames have a "post date", this is mainly to align with Jekyll, but it is also nice to use for Hugo. This is done by utilizing frontmatter in the Obsidian markdown notes, which means that each note must have a frontmatter section with at least a date key-value pair as such:

---
date: 2021-02-13

---

Additionally, currently only dates of the format YYYY-MM-DD are supported.

Usage

Copy the config.yaml.sample file and change the paths to align with your set up or copy this sample configuration:

vault:
        path: "/path/to/vault/root/" # Path to the Obsidian vault root. Markdown file discovery will start at this directory recursively.
        asset_path: "/path/to/vault/attachments/" # Path to the Obsidian vault attachments folder
        excluded_subdirectories: # Optional: list of excluded subdirectories of the Obsidian vault root
                - .trash
output:
        post_output_path: "/path/to/jekyll/_posts/" # Path to the Jekyll or Hugo posts directory
        asset_output_path: "/path/to/jekyll/assets/" # Path to the blog assets directory, copied from the Obsidian attachments folder
        relative_asset_path_prefix: "{{ site.blog_assets_location }}" # Optional: a relative URL prefix for blog assets without a trailing slash. Can also be a liquid template substitution for Jekyll.
        post_link_mode: "jekyll" # Optional, values can be either "jekyll" or "hugo" and the default is "jekyll". Sets the way post references are output.

Write your posts in the Obsidian vault then move the vault to the configured Jekyll or Hugo blog directory using

obyde -c <path to config.yaml>

Options

Regex-based find and replace transformations: (see PR #1) can be done through the frontmatter by specifying a find regex list and a corresponding replace string list of the same length. Each find regex will be compiled to search and replace matching instances with the string that is at the same index in the replace list.

For example, the following frontmatter configuraiton will replace every instance of foo with baz and every instance of bar and bak with qux:

---
find:
  - foo
  - ba(r|k)
replace:
  - baz
  - qux

obyde's People

Contributors

notkmhn avatar khalednassar avatar

Watchers

 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.