Code Monkey home page Code Monkey logo

etblog's Introduction

ETBlog (Extremely Tiny Static Blog Generator)

Installation (using RubyGems)

$ sudo gem install etblog -N

That’s it!

Installation (from sources)

First, you will obviously need Ruby 2.1 or newer.

You will need to install Kramdown and plist first:

$ sudo gem install kramdown plist -N

Then build and install this gem:

$ gem build etblog.gemspec
$ sudo gem install --local ./etblog-0.1.1.gem -N

Creating a blog

Basically, you need to use the etblog command-line utility to create and build blogs.

First, create a directory for your blog:

$ mkdir myblog
$ cd myblog

Now run etblog init to initialize the blog:

$ etblog init

After that, you should get this directory tree:

.
├── blog.plist
└── static

The blog.plist file is the configuration file of your blog. There, you can specify:

  • Your name and the name of your blog

  • The description of your blog

  • Links to various posts and sites that the user will see on the sidebar

Open it in your favorite text editor and change the name of your blog, specify your real name and change the description.

If you would like to change the folder where the compiled HTML files should be placed, change the Static option too.

Adding links is pretty easy. As the key, you specify the title of the link and as the value, you specify the href location of the link. Example (add this after <dict>):

<key>Tim K's website</key>
<string>http://timkoi.gitlab.io</string

After that, save the plist file and add some blog posts.

Adding blog posts is pretty easy too. You just create a markdown file with the post- prefix and write your blog in pure markdown. No need to specify the date or anything like that manually!

For example, let’s create a hello world post. The file name of our post should be post-helloworld.md. We just create that file near the blog.plist file and add some contents into it:

$ touch post-helloworld.md
$ nano post-helloworld.md

Example contents:

# Hello world
This is my first blog post on my ETBlog-based blog.

Now compile the blog:

$ etblog build

In the static folder (if you did not change the value of the Static key in the plist file), you should find:

static/
├── index.html
└── posts
    └── post-helloworld.md
        └── index.html

Now open the static/index.html file to see your blog and then (if you like it) publish it to your server and enjoy!

Creating custom themes

Basically, a theme is a single HTML page with external dependencies only that contains these tags that are later substituted by the ETBlog preprocessor:

  • @{post} - mandatory tag. Will be substituted with the title and the contents of the post. If you are building a Bootstrap-based ETBlog theme, put this tag inside <div class="container">.

  • @{title} - mandatory tag. Will be substituted with the name of the blog. If you are building a Bootstrap-based theme, put it in the navbar.

  • @{description} - optional tag. Will be substituted with the description of the blog.

  • @{links} - optional tag. Will be substituted with the links specified in blog.plist. If you are building a Bootstrap-based theme, put it in the navbar.

etblog's People

Contributors

tenfensw avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.