Skip to main content

Obsidian SSG Blog PyPI

DISCLAIMER: Still work-in-progress, so API definitely will change. To use it you'd better to have some programming experience

The idea is to create a simple blog generated from obsidian Map Of Content notes original zettelkasten benefit.

Features

  • Yet another static site generator for obsidian.
  • Built to use with git, github pages and action.
  • Uses handlebars template engine
  • Supports --watch and --serve modes for local writing
  • Recursively parses [[includes]] and has cycles detection
  • Automatically copies included local images into the build
  • Supports --drafts mode to work unpublished files locally
  • Privacy. Notes can be published only with explicit published: True annotation.
  • Fluent title detection from [[note | alt title]], frontmatter title attribute, or a filename.
  • Render notes as links, in case they're included in the middle of the paragraph and have link frontmatter attribute.
  • Supports filename delimeters: Topic - Category - Note becomes just Note

Installation

pip install obsidian-blog

Usage

$ obsidian-blog -h
obsidian-blog

Static site generator for obsidian.md notes.

Usage:
  obsidian-blog [-d] [-w] [-s] [--port <number>] [--title <string>] [--posts_dir <directory>] [--pages_dir <directory>]

Options:
  -h --help                     Show this screen.
  -w --watch                    Enable watcher
  -s --serve                    Enable web-server
  -p --port=<number>            Web-server port [default: 4200]
  -d --drafts                   Render draft pages and posts

  --title=<string>              Blog title [default: My Blog]

  --version             Show version.

Example

See Obsidian Blog Theme

Env

obsidian-blog expects you have an .env file. Supported variables and their default values can be found in src/dataclasses/config_data.

Blog files

notes ❯ tree .blog -a -I .git
├── .blog
│   ├── _assets # static files to be copied into .build
│   │   └── styles.css
│   └── _layouts # layout files
│       └── main.hbs # name of layout, can be selected with `layout` frontmatter attribute. Default: `main`
├── .build # build directory created by run `obsidian-blog` to be deployed
├── .env # environment variables
├── Pages # Pages directory, contains handlebars and markdown files
└── Posts # Posts directory contains obsidian markdown files (which are anyway processed via handlebars)

Posts

Posts are obsidian markdown files with includes, images, and anything you usually have in your obsidian notes. Posts are post-processed by handlebars, so you can use it if you need (but not sure if it's a good idea tho).

---
title: My awesome post
date: 2021-01-01 (used for sorting)
published: True # privacy, can't be skipped
layout: main (default_layout is used if it skipped)
---

Pages

Pages are handlebars templates (or just markdown files), rendered via global (pages and posts lists) and local (self points to the entity being rendered) contexts.

Assets

Assets are divided into 2 types:

  • .blog/_assets copyed during the build unconditionally
  • Images insluded either with markdown reference or incline images, or by obsidian ![[]] syntax. This ones are detected and copyed during the build.

Deployment

So far I'm using github actions to deploy my stuff to my blog.

Feedback and things

Just text me in telegram or file an issue. I'd be happy to know if you want to use it.

Alternatives

  • Obsidian Export - cli to render obsidian notes into markdown written in Rust

Metadata

Release files for obsidian-blog 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for obsidian-blog 0.2.2
File Size Uploaded
obsidian-blog-0.2.2.tar.gz 15.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for obsidian-blog 0.2.2
File Interpreter ABI Platform
obsidian_blog-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 37.1 kB

Release files / obsidian-blog-0.2.2.tar.gz

Download URL obsidian-blog-0.2.2.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6af6dd65b9d5b6e3c608d5cc75c08adba1b26c301cf4bb08967d52d5fbba313d
BLAKE2b-256 checksum
How to use checksums
331b0fe69990dde208d616c5d0d42f313fdce05bb4264bff77ef802aa1ca6939
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.0 CPython/3.10.2 Linux/5.15.0-1019-azure

Release files / obsidian_blog-0.2.2-py3-none-any.whl

Download URL obsidian_blog-0.2.2-py3-none-any.whl
Size 21.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
288689eceea889ab7035bbccbbf5c550a527181e12a298c47aff5910f41589af
BLAKE2b-256 checksum
How to use checksums
f7c3e97c2f9bf78c978b9eb2f807ef12b4344c326967fe71d66cbf174636e635
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.0 CPython/3.10.2 Linux/5.15.0-1019-azure

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page