• Stars
    star
    187
  • Rank 205,237 (Top 5 %)
  • Language
    Python
  • Created over 11 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Blog engine

Benjen

Benjen is a tiny static blog generator. At its heart is a <100 line Python script, which takes in your templates and blog entries and produces a static site.

Installation

easy_install benjen

Usage

From within a blog directory, simply run benjen and your site's output will be in the directory specified in your config file.

Creating a new blog

Create a new directory with the following structure:

  • yourblog/
    • entries/
    • static/
    • templates/
    • config.yaml

The entries directory contains all your blog entries as Markdown files. These should, however, contain the following lines at the beginning:

title: Entry Title Goes Here
date: YYYY-MM-DD

Date must be in the YYYY-MM-DD form; however, you can optionally append '.X' to the end of the date, to signify which post it is in a given day. Note: This format has changed as of v1.2, from the #title and #date format. The included 'benjen-upgrade' utility will, when run from within your blog root (or given the path to the root), automatically update your entries from <=1.1 to the new format.

The templates directory contains Mako templates. There are three templates in use, with the following parameters passed in.

  • index.html -- Used for index pages
    • page -- Current page number
    • pages -- Total number of pages
    • prev -- None or filename to the previous page
    • next -- None or filename to the next page
    • posts -- List of post objects for this page
    • recent_posts -- List of the most recent posts
  • post.html
    • post -- Current post object
  • archive.html
    • posts -- List of all posts

Post objects are dicts containing the following values:

  • title -- Entry title
  • date -- Entry date
  • raw -- Markdown text
  • html -- HTML version
  • link -- Filename for the post

The static directory contains any static data to copy into the output path. This is where you'll want to put your CSS. Note: the Markdown output will be using Pygments for code highlighting, so you'll need to add the appropriate CSS rules for it (see also: https://github.com/richleland/pygments-css).

The config.yaml file describes a dict with the following values:

  • path -- Path for Benjen to output files (this can be absolute or relative from the blog directory)
  • per_page -- How many posts to show per index page
  • recent_posts -- How many elements to put in the recent_posts list for index pages
  • root_url -- Root URL for your blog
  • rss_title -- (Optional) Title for your blog for RSS; without this, your RSS feed will not be generated
  • rss_description -- (Optional) Description for your blog for RSS.

Git Hook

If you want to generate your blog automatically on your server when you push updates, you can set up a Git repo and hook to do this.

Basic steps:

Once you've done this, you need to add a file called post-receive to barerepo/hooks/ and make it executable. Sample hook:

#!/bin/bash
unset GIT_DIR
cd /path/to/realrepo/blog/directory/
git pull origin master
benjen

When you push to the server's repository, it will automatically pull the latest contents into realrepo and then run Benjen. Make sure you change the repository names/paths accordingly.

That's all!

If you have issues, contact me at [email protected] or use Github's issue tracker.

More Repositories

1

httprebind

Automatic tool for DNS rebinding-based SSRF attacks
Python
272
star
2

SSRFTest

SSRF testing tool
Python
217
star
3

Emokit

Python library for the Emotiv EPOC headset
Python
164
star
4

Qtzweb

Quartz Composer to JS/WebGL compiler
JavaScript
152
star
5

ReCurta

Curta Calculator information
Python
120
star
6

ShockEmu

Keyboard+Mouse to Dualshock 4 emulation for PS4 Remote Play (OS X)
Objective-C
104
star
7

GrinningSoul

A userland iOS emulator for MacOS
C++
94
star
8

libmoonage

Standalone AArch64 Emulator Library
C++
69
star
9

PsychopompNX

Nintendo Switch emulator for Apple Silicon
Swift
57
star
10

RenrakuOS

Managed research kernel
43
star
11

Shaderforth

A shader language inspired by Forth and APL.
Python
41
star
12

kdl-py

Python implementation of the KDL Document Language
Python
39
star
13

OpenEQ

Open source Everquest client
C#
38
star
14

EmpireOfSteel

A prototype C# PS4/PS5 emulator
Dockerfile
34
star
15

SharpRetro

A libretro-inspired system for .NET emulators
C#
30
star
16

PepakuraReverse

Reverse-engineering the Pepakura 3 file format
Python
30
star
17

Zookeeper

Xbox emulator
C++
30
star
18

PSReverse

Pokerstars protocol reversing
Python
29
star
19

EveInject

EVE Online Python injector
Python
28
star
20

SupercellNx

C#
26
star
21

WebGLEnabler

WebGL Enabler for iOS tweak
24
star
22

DistributedBalance

Federated Activism
24
star
23

LockResearch

Repository for documentation and code around the Onity HT locks
Java
21
star
24

Dyna6502Asm

Dynamically recompiling 6502 emulator for Javascript
JavaScript
18
star
25

JsDataFlowEditor

Javascript dataflow graph editor
JavaScript
18
star
26

Refriender

A handy tool for reverse-engineering archive files
C#
17
star
27

LumberSharp

Turning 3d scenes into Escher-style woodcuts for plotting
C#
16
star
28

WebArena

C#
15
star
29

WebStation

Browser-based Playstation Emulator
JavaScript
15
star
30

AnchorNX

C#
14
star
31

wash

Wolfram Alpha shell
Python
14
star
32

Pyvascript

Python->Javascript compiler
Python
13
star
33

traNVparency

C++
13
star
34

HopperXbe

XBE (XBox Executable) loader plugin for Hopper Disassembler v3
Objective-C
13
star
35

SteelBreeze

Xbox Emulator
C++
12
star
36

QuestCompanions

Python
11
star
37

Arienette

Flash implementation in Ruby
Ruby
11
star
38

fret.js

Parametric fretboard generator for electric guitars/basses
JavaScript
11
star
39

pybelkusb

Python library for the Belkin Network USB Hub
Python
10
star
40

Dotpack

Extreme (TM) binary packer for .NET
Boo
10
star
41

RMarshal

Ruby gem to support the Python marshal format
Ruby
9
star
42

SharpStation

C#
9
star
43

EQView

Reference implementation for EverQuest file formats
JavaScript
9
star
44

BbSpider

Simple spider for bug bounty recon
C#
8
star
45

VideoTool101

An (almost) all-in-one educational video creation suite.
Python
8
star
46

browser.js

Web browser written in JS
7
star
47

BinaryPHP

PHP->C++ compiler
C++
7
star
48

Windowpane

WebGL demo generator
Ruby
7
star
49

Prooby

A Ruby->Python compiler
Ruby
7
star
50

DTrace4win

DTrace port for Windows
6
star
51

AArch64TestSuite

A test suite for AArch64 processors and emulators.
C#
6
star
52

TheGrudge

Convert WebAssembly modules to .NET assemblies.
C#
6
star
53

WaylandSharp

Native .NET Implementation of the Wayland Protocol
C#
6
star
54

Jemerles

Nemerle-inspired language targeting JavaScript
JavaScript
6
star
55

libhyper

Cross-platform hypervisor library
C++
6
star
56

daeken.github.com

My github pages
6
star
57

IronVisor

ARM64 Hypervisor library for .NET 6
C#
6
star
58

Ultilang

New experimental language
Python
6
star
59

UnicornSharp

Idiomatic .NET bindings for Unicorn
C#
5
star
60

QtChaos

Quicktime fuzzer
Python
5
star
61

genshaders

JavaScript
5
star
62

NObfs

Deobfuscator for Quicktime/iTunes
5
star
63

ygritte

Pyweek entry
Python
5
star
64

Transformana

Runtime code manipulation for Python
Python
5
star
65

tarogen_old

A generic interpreter/dynarec core.
Python
5
star
66

SoundBlossom

Tiny audio synthesis library for .NET
Boo
5
star
67

webgl-inspector

C#
5
star
68

Ronin

Poker bot
C++
4
star
69

RelaxorFlow

A .NET native machine learning library
C#
4
star
70

TetrisBot

Python
4
star
71

alayout

DSL for Android UIs
Python
4
star
72

Ngco

An efficient, cross-platform, embeddable GUI library for .NET Core
C#
4
star
73

psxunittest

Python
4
star
74

Straytex

Straylight Texture Studio
JavaScript
4
star
75

LyrOS

C#
4
star
76

VNCaster

C#
4
star
77

Epicentre

Demo
JavaScript
4
star
78

DaeForth

Shaderforth gone general purpose
C#
4
star
79

Straylight

Straylight demo repository
C
3
star
80

TestCosm

Test Cosm and Client for Hypercosm
C#
3
star
81

CannedHeat

Console-mode hex editor and file loader
3
star
82

cliddit

CLI Reddit reader
Python
3
star
83

BitcodeSharp

LLVM Bitcode reader for .NET Core
C#
3
star
84

daeweb

JavaScript
3
star
85

demoeffects

Demo effects playground
JavaScript
3
star
86

SharpXpra

Pure C# client for the Xpra protocol
C#
3
star
87

Alky

C
3
star
88

PaleFlag

Experimental Xbox emulator and high-performance Hypervisor library for .NET
C#
3
star
89

webray

JavaScript
3
star
90

PttRecorder

Live PTT audio recording to your computer from your Android phone
C#
3
star
91

Tarogen

Generic CPU description framework
Python
3
star
92

ShadeRunner

Shadertoy -> Android app converter
Java
3
star
93

AlienAngel

C#
3
star
94

HyperMosaic

Unity-based Hypercosm Browser
C#
3
star
95

DoubleSharp

A set of extension methods and helpers for .NET (C# specifically)
C#
3
star
96

NewOpenEQ

C#
3
star
97

PyTableGen

Python implementation of LLVM's TableGen
Python
2
star
98

TempleOfGold

JS implementation built in C#9 for .NET 6
C#
2
star
99

PyStand

Miscellaneous libraries for use in Python projects
Python
2
star
100

LosingDogs

Fast parser combinators for modern JS
JavaScript
2
star