mdblog 0.5.1

create static site blog from markdown files.
Documentation

Mdblog

Create static site blog from markdown files with features:

  • TeX style math support
  • file path is the post url
  • file name is the post title
  • post can be hidden(link does not be insert into index/tag page)

Install

mdblog is implemented by rust language, so you need cargo command:

cargo install mdblog

mdblog will be installed in your cargo binary directory(~/.cargo/bin/).

CLI

mdblog can be use as a command:

$ mdblog -h
static site generator from markdown files

USAGE:
    mdblog <SUBCOMMAND>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    build    Build the blog static files
    help     Prints this message or the help of the given subcommand(s)
    init     Initialize the blog directory layout
    serve    Serve the blog, rebuild on change

you can also check the subcommand usage:

$ mdblog serve -h
Serve the blog, rebuild on change

USAGE:
    mdblog serve [OPTIONS]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -p, --port <port>    Serve the blog at http://127.0.0.1:<port> [default: 5000]

init blog

$ mdblog init myblog

blog directory(myblog) layout is initialized:

myblog
├── Config.toml
├── media
├── posts
│   └── hello.md
└── _themes
  • Config.toml: blog config file
  • media: blog media directory
  • posts: blog posts directory
  • posts/hello.md: a markdown style post
  • _themes: blog themes directory

build blog

$ cd myblog
$ mdblog build

the blog static files are build into the subdir _build, the current blog directory(myblog) layout is:

myblog
├── _builds
├── Config.toml
├── media
├── posts
│   └── hello.md
└── _themes
  • _builds: generated static-site top directory

serve blog

$ mdblog serve

open the site index page automatically, and re-generate your static-site when you add or change content,

new post

create a markdown file posts/another.md with the content:

date: 2018-01-01 00:00:00
tags: hello, another

This is just another post.

refresh the index page, you will find the new post.

Config.toml

footer_note = "Keep It Simple, Stupid!"
site_logo = "/static/logo.png"
site_motto = "Simple is Beautiful!"
site_name = "Mdblog"
theme = "simple"