Static site generator
Find a file
2023-07-31 18:32:04 +03:00
src Replace deprecated/removed getchildren() 2022-01-31 20:01:54 +02:00
.gitignore Ignore venv directory 2022-01-31 19:59:59 +02:00
build.py Initial version 2020-05-30 18:24:05 +03:00
LICENSE Add license (GPL v3) 2020-06-14 17:29:59 +03:00
Makefile Add Makefile to build and install in one step 2021-02-28 16:46:44 +02:00
pyproject.toml Initial version 2020-05-30 18:24:05 +03:00
README.md Fix path in instructions 2023-07-31 18:32:04 +03:00
setup.py Initial version 2020-05-30 18:24:05 +03:00

Static Bee

Static Site Generator

Static Bee is a static site generator with no configuration, based on XML.

The structure of your site is a mirror of the structure of your sources.

The main idea is: layout + page = result.

For example, consider the following XHTML file as a layout...

<!DOCTYPE html>
<html xmlns:sb="https://cosmin.hume.ro/project/staticbee">
  <head>
    <title>
      <sb:title />
    </title>
  </head>
  <body>
    <sb:content />
  </body>
</html>

... and the following XML file as a page.

<?xml version='1.0' encoding='utf8'?>
<sb:page xmlns:sb="https://cosmin.hume.ro/project/staticbee">
  <sb:title>Example page</sb:title>
  <sb:content>
    <h1>Hello, world!</h1>
    <p>This is some content</p>
  </sb:content>
</sb:page>

Static Bee combines these two together and produces a HTML page for your site:

<!DOCTYPE html>
<html>
  <head>
    <title>Example page</title>
  </head>
  <body>
    <h1>Hello, world!</h1>
    <p>This is some content</p>
  </body>
</html>

Development

To build Static Bee, you need Python 3 and PyBuilder.

python3 -m venv venv
source venv/bin/activate
pip install pybuilder mockito pygments

In the project directory, run:

pyb clean publish

To install:

cd target/dist/staticbee-1.0.dev0/
python3 setup.py install --user

Then edit ~/.local/bin/staticbee and fix the shebang:

sed -i 's/#!python/#!\/usr\/bin\/env python3/' ~/.local/bin/staticbee

Or do all these steps at once by running make in the project directory.

Dependencies

Dependencies are managed by PyBuilder.

For development we use:

At runtime we need:

  • Pygments, for highlighting syntax in the content of your site