README.md
<a href="http://github.com/Nate-Wilkins/reblog">
<img alt="reblog" src="https://rawgit.com/Nate-Wilkins/reblog/master/logo.svg" width="275">
</a>
[![status](https://img.shields.io/travis/Nate-Wilkins/reblog.svg?style=flat-square&longCache=true)](https://travis-ci.org/Nate-Wilkins/reblog)
[![license](https://img.shields.io/github/license/nate-wilkins/reblog.svg?style=flat-square&longCache=true)](https://github.com/Nate-Wilkins/reblog/blob/master/LICENSE)
[![spacemacs](https://img.shields.io/badge/color-spacemacs-927cba.svg?label=built%20with%20&style=flat-square&logo=spacemacs&longCache=true)](http://spacemacs.org)
> _High performant_ static blog generator.
# WIP :: No releases available. Comeback later.
To view an existing blog generated with `reblog` see [`code-null`](http://code-null.com/).
# Setup
The following is to setup your environment to run `reblog`.
You can do this by using [docker](http://docker.com) or
natively with [erlang](http://www.erlang.org/) and [elixir](https://elixir-lang.org/)
### Using [Docker](http://docker.com/)
Run the following command to execute `reblog`.
```
docker run -v $(pwd):/context -u `id -u $USER`:`id -g $USER` nate-wilkins/reblog
```
__Optional__
To make things easier there's a helper script to run the above command more easily.
You can run the following to symlink the helper file into your `~/bin/` directory.
_NOTE:_ Make sure that `$HOME/bin` is in your `$PATH`.
```
git clone https://github.com/nate-wilkins/reblog ~/.local/src/reblog
chmod +x ~/.local/src/reblog/run-container.sh
ln -sf ~/.local/src/reblog/run-container.sh ~/bin/reblog
reblog
```
## Using [Erlang](http://www.erlang.org/) and [Elixir](https://elixir-lang.org/)
Install `reblog` from [hex](https://hex.pm/) using the following command.
```
mix archive.install hex reblog
```
Once installed you can run `reblog` with `mix`.
```
mix reblog
```
# Getting Started
1) Initialize a new blog.
```
reblog init my-blog
```
This will create a new blog with the following structure.
```
my-blog/
├─ _site/
├─ assets/
│ └─ favicon.svg
├─ pages/
│ └─ about.eex
├─ posts/
│ ├─ 2018-1-1_hello-world.md
│ └─ .layout.eex
└─ .layout.eex
```
2) Build the blog.
```
reblog build
```
3) Deploy the blog locally.
```
reblog deploy -t local -a port=7575
```
4) Open a browser to [http://localhost:7575](http://localhost:7575)
---
## Posting
To add a new blog post just add a new markdown post to the `posts` directory following the `YYYY-m-d_my-post-title.md` format.
You can also use the `reblog post` command to automatically create a new post.
```
reblog post my-post-title
```
## Custom Pages
To add a custom page just add a new markdown page to the `pages` directory.
You can also use the `reblog page` command to automatically create a new page.
```
reblog page my-page-title
```
## Themeing
To build using a different theme run `reblog build -t <theme>` where `<theme>` is a valid theme.
To list all available themes run `reblog theme --list`.
__Custom Themes__
__NOTE:__ It is highly suggested that you start out with a preexisting theme before moving on to a custom one.
```
reblog theme --new
```
The general idea is to constantly rebuild the blog while developing your theme.
```
reblog deploy -t local -a port=7575 livereload
```
## Providers
To deploy using a different provider run `reblog deploy -p <provider>` where `<provider>` is a valid provider.
To list all available providers run `reblog provider --list` or visit [providers.md](./docs/providers.md) to learn more.
# Development
To build the reblog command line use `mix escript.build` to learn more see [executables](https://elixirschool.com/en/lessons/advanced/escripts/) on [elixirschool](https://elixirschool.com).
To test run `escript reblog` with the arguments you want to test with.
# Roadmap
- List of sites that use `reblog`.
- More themes! :trophy:
- More providers! :trophy:
- Add livereload for optimal development.