Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
80 lines (62 sloc) 3.72 KB

Pelletron

Pelletron is yet another static site generator. Every modern programmer must reinvent this particular wheel.

Description

Pelletron aims to minimize the effort of creating rich content, imposing as little overhead as possible to provide this power.

Pelletron is written in Python. Jinja2 is its templating language. Flask is the glue, providing utilities to build, serve (while debugging), and deploy the static pages. The FlatPages extension defines page content, using YAML to define the structure. It supports Markdown for text formatting and pygments for code syntax highlighting. The Frozen-Flask extension converts the templates to static pages.

Pelletron lets you preview your site using Flask's built-in development server, and includes Flask-DebugToolbar.

Rsync handles deployment to the target server.

Override the skeleton starter templates with widely used HTML5 frameworks such as Bootstrap, Foundation, and HTML5 Boilerplate. (See Beyond bare bones below for more information.)

Installation

For Linux and OS X:

  • Clone this repository:
    • $ git clone git@github.com:jeffkayser/pelletron.git
  • Create a new python virtual environment:
    • $ mkvirtualenv my-site
  • Ensure you're using the new virtual environment:
    • $ workon my-site
  • Install the requirements:
    • $ pip install -r requirements.txt
  • Test the site build process:
    • $ python site.py build
    • You may see some warnings; it's safe to ignore them
  • Test the server:
    • $ python site.py server
    • Use your web browser to navigate to http://localhost:5050
    • You should see a page with the following text at the top appear: > Pelletron is working
  • Deploy to localhost as the current user:
    • $ python site.py deploy
    • Edit config.py to change deployment options such as host, username, and path.

Usage

.
|-- built/               <-- Final static site output
|-- config.py            <-- Set configuration options
|-- framework.py         <-- Framework name currently in use
|-- site.py              <-- Site management utility
`-- source/              <-- User defined content goes here
    |-- controller.py    <-- MVC controllers (blank by default)
    |-- model.py         <-- MVC models (blank by default)
    |-- modules/         <-- Holds modules such as front-end frameworks
    |   |-- bootstrap/
    |   |-- custom/
    |   |-- foundation/
    |   `-- html5boilerplate/
    |-- pages/           <-- Holds 'page' content
    |   `-- home.md      <-- Sample 'page'
    |-- static/          <-- Static content goes here (favicon, css, javascript, etc.)
    |-- templates/       <-- Page layout
    `-- view.py          <-- MVC views (includes URL route mappings)

Beyond bare bones

Vanilla Pelletron is not opinionated beyond its basic technical structure, which is optimized for content not design, and provides none of the common HTML5 frameworks popular as jump-off points today. However, modules for the following frameworks are available for your use immediately:

These frameworks can give you a much stronger jumping off point if your site's design needs match up with their respective authors' choices.

Copyright and License

Copyright © 2015 Jeff Kayser. Released under the MIT license.