Giter Club home page Giter Club logo

blogen's Introduction

Blogen

About

Blogen is a static site/blog generator. Everything it can do, is generate a range of pages and blog posts out of text files marked up in markdown.

It is based on Flask and Frozen-Flask. It makes also use of Flask-FlatPages Flask-Themes and Flask-Script.

It was inspired by Nicolas's blog post and was written and is maintained by Alexander Jung-Loddenkemper.

Setup

Download blogen as a zip and unzip it or clone the git repository:

git clone git://github.com/alexex/blogen.git

Then do the following:

cd blogen
python blogen.py setup

That's it already.

Configuration

You should create a file blogen.cfg in the app's root. So far there are only two settings available, of which none is necessary but one recommended:

TITLE = "Your site's title." # this is recommended
THEME = "<ID>" # this defaults to the default bootstrap theme.
PER_PAGE = <NUM> # optional, the default is 5
PAGESLUG = '<SLUG>' # optional, customize the slug for pages to your likings, see the Slugs section for more info on available parameters
POSTSLUG = '<SLUG>' # optional, customize the slug for posts to your likings, see the Slugs section for more info on available parameters
DISQUS='<SHORTNAME>' # optional, disqus support, just enter your disqus shortname here
ANALYTICS='<ID>' # optional, analytics support, just enter your analytics ID here
SOCIAL=[('<Name>', '<URL>')] # optional, will create a social dropdown if given. put a number of tuples you like
MENU=[('<Name>', '<URL>')]  # optional, add custom entries to the menu.
DATETIME='<FORMATSTRING>' # optional, how dates should be looking like on your blog, check out http://docs.python.org/library/datetime.html#strftime-strptime-behavior for further information

Slugs

The following parameters are available for configuration, you can combine them, however you like:
%title% - title of your post/page
%path% - path of the file
%year% - year of the post
%month% - month of the post
%day% - day of the post
%hour% - hour of the post
%minute% - minute of the post 

For all time dependent vars applies the fact, that of no date is given the file modification date is used.

Blogging

Create files that end with .md in pages if you want pages and posts in posts. The part before the .md will also be the url of you page/post for now. Configuration is done via YAML. Create at least a title-tag in the beginning of the file. For now title, date, tags and slug are supported. There will be more supported tags in the future.

A minimal example would look like this:

title: Title of the post or page

text

A more advanced example would like this:

title: Title of the post or page
date: 2012-06-18 18:30
tags: [we, are, tags, "many tags"]
slug: "i/am/a/custom-url"

Building

Just run:

python blogen.py build

Deployment

I personally push my blog via git and have a deploy hook that executes blogen.py, but you can of course deploy how ever you want. Rsync might be a nice idea, for example.

Templating

Blogen makes us of jinja2, just copy the default-theme from themes/ and adapt/rewrite it to your needs. Set THEME in your blogen.cnf to the id of your theme.

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.