Henet

Henet is a web admin application for Pelican.

Henet has the following features:

  • edition, addition & deletion of articles
  • cleanup of the reSTructuredText
  • live preview
  • commenting system with static rendering
  • internationalized interface (French & English built-in)

Limitations:

  • only works with reStructuredText for now.
  • no authentication

See https://github.com/AcrDijon/henet/issues for planned features and ongoing work.

Quick Start

Make sure you have the latest Python 2.7.x and the latest virtualenv, then:

$ virtualenv .
$ bin/pip install https://github.com/AcrDijon/henet/archive/master.zip
$ bin/henet-quickstart
$ bin/henet-server

The web admin will be reachable at http://localhost:8080

More documentation:

Run it

Henet is a web app running under Bottle, to install everything required, it’s encouraged to use a virtualenv:

$ virtualenv .
$ bin/pip install https://github.com/AcrDijon/henet/archive/master.zip

Once it’s installed, the web admin can be run using henet-server:

$ bin/henet-server
Bottle v0.12.9 server starting up (using WaitressServer())...
Listening on http://localhost:8080/
Hit Ctrl-C to quit.

Before running it, make sure you configure everything properly by tweaking the configuration file.

Configuration

Henet uses a configuration file. Example with inline comments:

[henet]
# host and port to run Henet
host = localhost
port = 8080
debug = True

# cache for rst parsing and rendering
cache_dir = /tmp/henet

# blog categories
# by convention, one dir == one article category
categories = actus
            resultats
            foulees
            pages

# urls info from pelican we need to link to the published
# pages
site_url = http://acr-dijon.org
article_url = posts/{date:%Y}/{date:%m}/{date:%d}/{slug}/

# the location of the comments files
comments_dir = /Users/tarek/Dev/github.com/acr-dijon.org/comments

# each category has an id (the section name), a title and a directory
[actus]
title = Actualités
path = /Users/tarek/Dev/github.com/acr-dijon.org/content/actu

[resultats]
title = Résultats
path = /Users/tarek/Dev/github.com/acr-dijon.org/content/resultats

[foulees]
title = Foulées
path = /Users/tarek/Dev/github.com/acr-dijon.org/content/foulees

[pages]
title = Pages statiques
path = /Users/tarek/Dev/github.com/acr-dijon.org/content/pages

# with this flag, you can't add article in that category
can_create = False

Pelican integration

To add the commenting system in Pelican, add the following in your pelicanconf.py:

HENET_SERVER = "http://localhost:8080"
PLUGIN_PATH = '/path/to/henet/plugins'
PLUGINS = ["henet_comments"]

Then adapt your article template to include the comments and the form to add comments. Example:

{% if HENET_SERVER %}
 <form id="henet_comment" action="">
   <input type="hidden" name="article_url" value="{{article.url}}">
   Name: <input type="text" name="author" id="author"/>
   Comment: <input type="text" name="text" id="text"/>
   <button type="button" onclick="post_comment('#henet_comment', {{HENET_SERVER}})">Add comment</button>
 </form>
 <script src="{{HENET_SERVER}}/resources/js/henet.js"></script>
{% endif %}