Skip to main content

Static site generator

Project description

=====
Stone
=====

Yet another static website generator, with plugin support.

Used by (www|blog).half.systems to convert Markdown and Jinja2 into HTML.


Installation
------------

.. code-block:: sh

$ pip install stone-site


Usage
-----

To get started with `stone`:

.. code-block:: sh

# Create template layout
stone example_site init --site-name 'example.com'
# Generate site
stone example_site generate
# Add a new page
stone example_site newpage --name "About Us"

By default Stone is configured to turn Markdown + YAML metadata + Jinja2
templates into HTML but as it has support for custom plugins it can generate
anything it has code for.

==================
Site Configuration
==================

Configuration File
------------------

Stone generates sites based on the contents of `site.json <docs/site-json.md>`_.
Each site can specify which backends, generators and renderers to use, custom
versions will be loaded from the ``$HOME/.stone`` directory.

Folder Structure
----------------

Stone was originally designed to generate the subdomains of half.systems.
The following is the layout of the sites:

.. code-block:: sh

.
├── blog
│   └── ...
├── main
│   └── ...
├── site.json
└── templates
└── ...

`site.json <docs/site-json.md>`_ is flexiable about the location of templates
and files. As such your not constrained to any particular layout for your site.
You could have separate template folders inside each site or one shared in the
project root. Each site can specify its template directory


Pages
-----

By default pages are Markdown file, that can have optional YAML metadata that
describe the attributes of the page including the title and which template to
uses. For example:

.. code-block::
template: base.html
title: Hello, World

# This is a header

Here is some lovely content.

Stone makes all metadata available to page templates. Any data templates may use
can be embedded into a page. For exampled: an author's name, email, the date the
page was written. The behaviour is dependent on the generator and renderers
used. See the [renderers](docs/renderers.md) and
[generators](docs/generators.md) for more details.


Templates
---------

By default templates are HTML pages with `jinja2 <http://jinja.pocoo.org>`_
markup.

``base.html``:

.. code-block:: html

<html>
<head>
{% block head %}
<title>{{ title }}</title>
{% endblock %}
<head>
<body>
{% block body %}
<h1>{{ title }}</title>
<div id="post">
<!-- Most likely we are going to pass more html here --->
{{ content|safe }}
</div>
{% endblock %}
</body>
</html>


Generating
----------

To generate a particular site invoke ``stone`` with the location of the project's
root folder.

.. code-block:: sh

stone root_folder generate

Example
-------

An example project that generates an example landing page and blog is included
in Stone's project source. you can build it by running:

.. code-block:: sh

stone example generate

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stone-site-0.1.6.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stone_site-0.1.6-py2.py3-none-any.whl (15.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file stone-site-0.1.6.tar.gz.

File metadata

  • Download URL: stone-site-0.1.6.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for stone-site-0.1.6.tar.gz
Algorithm Hash digest
SHA256 803434cd75679604a6ddfe1b73ba3d30435de7a9b75ac9f77596f3becf47565f
MD5 38ae7563a5d52c40328f958c25934057
BLAKE2b-256 2e52648b9f6949f65b22bc7339742175dcee885caa97232ced62b6387dac7efd

See more details on using hashes here.

File details

Details for the file stone_site-0.1.6-py2.py3-none-any.whl.

File metadata

  • Download URL: stone_site-0.1.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for stone_site-0.1.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 26c484aaebdd277956a9981ef9565fd4eca438191397dac32a2f6148de3ec95d
MD5 c540b45252f9b0779b8c00100ed15ceb
BLAKE2b-256 751b740f9c25b58fc3a15cb17504acb69c923de3f6bd18e5561f125577cfea8b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page