<commit_before># Blackblog

Blackblog is a simple blogging platform written in Go. It uses the
[Blackfriday Markdown](https://github.com/russross/blackfriday) library to
format posts.

You can run Blackblog in two modes: standalone server and compiler. In server
mode, you specify a path to the blog posts and it dynamically serves pages on
the fly, acting as a HTTP web server. In compile mode, it takes a directory
of posts and outputs a new directory of static HTML files.

Blackblog is built for Go 1.

## Alpha Software

Blackblog is alpha software. It is used to publish my personal blog, but it is
not yet feature complete.

## Installation

    $ go get github.com/russross/blackfriday
    $ go get github.com/rsesek/blackblog

    To create a new blog and run the built-in server:
    $ blackblog newblog myblog
    $ blackblog serve myblog

    To add new posts, simply create a file.md in myblog/posts/.
    $ vim myblog/posts/first_post.md

    If you keep the server running, it will automatically reload the page as you
    write new content and refresh your web browser.

    Edit the title and other parameters (requires a server restart):
    $ vim myblog/blackblog.json

    To publish your blog as static files:
    $ blackblog render myblog
    $ scp -r ./myblog/out example.com:~/public_html/blog

This installs the two Go packages you need, starts a new blog and copies the
templates so they can be customized for your blog. It then compiles the blog
and uploads it to your server.

## Starting a Post

Posts use pure Markdown formatting, but have some additional metadata at the
beginning of the file. Metadata lines begin with two tilde `~~` characters and
can only occur at the top of the file. The first line that does not start with
two tildes ends the metadata section and starts the post in Markdown format.

Currently, the following metadata attributes are supported:
<commit_msg>Better format the README installation section<commit_after># Blackblog

Blackblog is a simple blogging platform written in Go. It uses the
[Blackfriday Markdown](https://github.com/russross/blackfriday) library to
format posts.

You can run Blackblog in two modes: standalone server and compiler. In server
mode, you specify a path to the blog posts and it dynamically serves pages on
the fly, acting as a HTTP web server. In compile mode, it takes a directory
of posts and outputs a new directory of static HTML files.

Blackblog is built for Go 1.

## Alpha Software

Blackblog is alpha software. It is used to publish my personal blog, but it is
not yet feature complete.

## Installation

    $ go get github.com/russross/blackfriday
    $ go get github.com/rsesek/blackblog

To create a new blog and run the built-in server:

    $ blackblog newblog myblog
    $ blackblog serve myblog

To add new posts, simply create a `file.md` in `myblog/posts/`.

    $ vim myblog/posts/first_post.md

If you keep the server running, it will automatically reload the page as you
write new content and refresh your web browser.

Edit the title and other parameters (requires a server restart):

    $ vim myblog/blackblog.json

To publish your blog as static files:

    $ blackblog render myblog
    $ scp -r ./myblog/out example.com:~/public_html/blog

This installs the two Go packages you need, starts a new blog and copies the
templates so they can be customized for your blog. It then compiles the blog
and uploads it to your server.

## Starting a Post

Posts use pure Markdown formatting, but have some additional metadata at the
beginning of the file. Metadata lines begin with two tilde `~~` characters and
can only occur at the top of the file. The first line that does not start with
two tildes ends the metadata section and starts the post in Markdown format.

Currently, the following metadata attributes are supported:

{'fraction_non_alphanumeric': 0.04640250260688217, 'fraction_numerical': 0.0005213764337851929, 'mean_word_length': 3.7723880597014925, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2030683', 'n_tokens_mistral': 1038, 'n_tokens_neox': 999, 'n_words': 571}