Blogit

Blogit is a blog engine backend written in Elixir. It turns a repository (by default git repository), containing markdown files into a list of blog posts, which can e queried. Blogit supports blog configuration in YAML, including blog title, path to custom stiles and images, etc.

There is a frontend implementation in phoenix, which uses Blogit - BlogitWeb. It can be clonned and configured to use any repository to build custom blog.

The blog for the Sofia University Elixir course runs on Blogit.

Installation

It is available in Hex, so the package can be installed as:

  1. Add blogit to your list of dependencies in mix.exs:

     def deps do
       [{:blogit, "~> 1.0.0"}]
     end
  2. Ensure blogit is started before your application:

     def application do
       [applications: [:blogit]]
     end

Configuration

An example configuration for blogit is:

config :blogit,
  repository_url: "https://github.com/ElixirCourse/blog.git",
  polling: true, poll_interval: 300_000

Possible settings are:

Using these settings a custom blog can be created from whatever repository. It is not hard to write FTP repository provider or Ecto repository provider.

Usage

Blogit has a public interface which can be used to build a blog similar to BlogitWeb. When the application is configured and started, the following functions can be called:

License

The license is standard MIT license, feel free to fork Blogit and do whatever you want with it. You can also contribute to it.

Contributions

Just fork the Blogit repository and create a PR. You can also craete issues with features you wish we support. You can propse style changes on the code and additional tests.

All kinds of contributions are welcome!

How to create your own blog?

Blogit has a simple Phoenix frontend application : BlogitWeb.

Follow these steps to create your own blog:

  1. For the aformentioned BlogitWeb project.

  2. Modify its config/prod.exs configuration:

     config :blogit,
       repository_url: "<path-to-a-git-repository-with-your-posts>",
       polling: true, poll_interval: 300_000, mode: :prod,
       meta_divider: "--------", assets_path: "assets"
  3. Deploy it somewhere.

    BlogitWeb depends on distillery and has a little bash script in its root, called build_release.sh. Just run it and it will build a release. You can also run it like this : ./build_release.sh --upgrade in order to create updated release. Follow distillery‘s notes when deploying.’

    BlogitWeb has a Dockerfile.build file which can be used to make a build in Docker if you don’t have Elixir installed. It has a Dockerfile too so you can try it locally.

  4. When it is deployed just add new markdown posts to your repository specified in the configuration and it will be published authomatically.

Features to be implemented

Contact me

I’m Nikolay Tsvetinov (meddle) from elixir-lang.bg.

You can find me at: