Skip to main content

Feature rich static site generator for obsidian.md

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

obsidian-blog-0.2.1.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

obsidian_blog-0.2.1-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file obsidian-blog-0.2.1.tar.gz.

File metadata

  • Download URL: obsidian-blog-0.2.1.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.10.2 Linux/5.15.0-1014-azure

File hashes

Hashes for obsidian-blog-0.2.1.tar.gz
Algorithm Hash digest
SHA256 0718fd67b5c88e1f97fe3e29aa801b83b514ec5f34288e66c016073cc3c73dfb
MD5 25efabfffd41f64c36799cf9b440f159
BLAKE2b-256 fb134b3360f2a712e5cf1145b9033a9a0c8868fbbe1f04a42639e27971e9b4a2

See more details on using hashes here.

File details

Details for the file obsidian_blog-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: obsidian_blog-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.10.2 Linux/5.15.0-1014-azure

File hashes

Hashes for obsidian_blog-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5dcc88da6eb5f6ccad5883804b393276eaf75889d8370daa7bf57ff1c640df08
MD5 9d5c54fb19f16aed174bee0ef4f2e987
BLAKE2b-256 6fc11e2b900e7ba1367e6301e3513204ee9cb37f270d6d29674a31b60bb027e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page