Skip to main content

Static site generator

Project description

# stone

Yet another static website generator.

Used by half.systems


# Installation


pip install stone-site


# Usage

To get started with `stone`:

# Create template layout
stone example_site init --site-name 'example.com'
# Generate site
stone example_site generate


## Folder Structure

Site projects can be structured as you wish.

The layout which stone was developed along side is:

* root
* blog
* main
* templates
* templated HTML for blog and main
* site.json

As `site.json` is explicit about the location of templates and files, the
structure is flexible. You could locate separate template folder inside each
site or have one giant mess in your project root.


## Pages

The source markdown files should consist of simple markdown with a YAML header
that describe the attributes of the generated page including the page title and
the template it uses. For example:


```
template: base.html
title: TEST

# This is a header

Here is so lovely content.
```

There are additional attributes:

* date - Adds the date the page was create to the page metadata. This is
currently used when generating indexes for blogs. Format YYYY-MM-DD


## Templates

Templates support **jinja2**, an example:

`base.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.

```
stone root_folder generate
```

### Example

An example project that generates an html version of this README can be found in
the example folder.

You can build it by running:

```
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.1a1.dev2.tar.gz (5.4 kB view details)

Uploaded Source

File details

Details for the file stone-site-0.1a1.dev2.tar.gz.

File metadata

File hashes

Hashes for stone-site-0.1a1.dev2.tar.gz
Algorithm Hash digest
SHA256 c1aeb16dfc1d4fe455e6270243033112da2687605c5e1a54c52f3c455916bad9
MD5 c6263565512fb2fc43a20720c44420e4
BLAKE2b-256 56b77f9a0d5efc558eca8ea5465ce094620e1ad11dbe5a07d75cedcec177c09c

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