Giter Site home page Giter Site logo

ajzdunek / bake Goto Github PK

View Code? Open in Web Editor NEW

This project forked from felipetavares/bake

0.0 1.0 0.0 127 KB

Bake is a templated blog generator.

License: Do What The F*ck You Want To Public License

Makefile 0.20% C++ 18.93% C 72.24% HTML 0.43% CSS 1.29% JavaScript 6.18% CMake 0.73%

bake's Introduction

Bake

Bake is a templated blog generator.

Bake was originally writen in C, for use as blogging tool at ctrl-c club. This version is a new implementation in C++.

You can see an example blog that uses Bake here. Another in here.

Bake is intended to be used in a make-like fashion:

  1. Create a directory, enter it
  2. Write a file named bakefile containing some rules about how to process the input.
  3. Write a template file anywhere you like (the bakefile should point to it)
  4. Write blog posts in the format .markdown
  5. Run bake

Quick Start

If you are just hacking around, try the following:

git clone http://github.com/felipetavares/bake.git
cd bake
make
sudo make install
bake

Now open bake/output/index.html in a browser.

Compiling with CMake (under *nix)

To compile with CMake, you can (after cloning and entering the repository):

mkdir build
cd build
cmake ..
make

Bakefile

The bakefile should be named bakefile in lower case without any extension, just like you see it here (an example bakefile is provided, go take a look!).

The bakefile is composed of key-value pairs, separated by an = symbol. Only one of these key-value pairs is allowrd per line.

All whitespace characters found in the key are removed, what means that all the keys below are equivalent:

key=
k ey=
key =

The same goes for the value:

key = value
key=value
key = v a l u e

are all the same.

If you desire to use whitespace characters in the value, put it between quotation marks "":

name = "Felipe Tavares"

You can put any keys in your bakefile, but the ones that have real functionality are:

  • lang - used to set the locale used by locale-specific functions (dates)
  • template - path to the template file
  • output - path to the output file, if it's a directory, an index.html will be generated, plus a .html for each post.
  • date - formatting string in the strftime format.
  • host - url to the directory where output is located.
  • hash - if set to true hash all post links using k33.

Note about dates: you can set a custom date for a post by using @ in its first line (or its second, if the first contains an author, see below). The rest of the line will be copied to the {date} variable.

Available {vars}

These are the vars available for use in the template. All vars must be inside the main {} that defines the extension of a single post.

  • {:varname} - : is a syntax for html-escaped variables, e.g.: < is converted to &lt; etc)
  • {content} - post content
  • {title} - post title
  • {date} - post date, formated as specified by the date key in the bakefile.
  • {id} - post id (used by permalinks)
  • {link} - permalink to the post, uses the id var.
  • {author} - post author, defined in the first line of each post, if not defined, the unix user name is used instead (from passwd)

Note about authors: to define an author for a post, begin the first line of a post with a tilde ~ character. The rest of the line until a \n is found will be saved to {author}.

Feeds

Bake supports custom feeds. You can create your custom template or use the one that comes with it. You can generate your feed by creating a custom bakefile for it and namig it for example feed, then, you can bake it with:

bake feed

this way Bake will read the feed file as bake file and bake your custom feed. There is a feed bakefile example that you can use to learn how it works.

Contributors

I would like to thanks these guys for their support and for submiting pull requests:

bake's People

Contributors

felipetavares avatar dacap avatar kradih avatar

Watchers

James Cloos 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.