Skip to main content

hotchocolate

Hot Chocolate is a static site generator that uses Markdown files as input, and is designed for building very lightweight sites.

https://github.com/alexwlchan/hot-chocolate/raw/master/hotchocolate.jpg

Disclaimer

You should consider this as alpha-quality software at best. Although I run several sites with it, it’s still user-unfriendly, undocumented and rough around the edges. If you want a static site generator, look at something like Jekyll or Pelican.

I’d like to document it properly and make it user-friendly, but for now it’s more like a melting pot for my ideas about static site generators.

Installation

Install with pip:

$ pip install hotchocolate

Hot Chocolate requires Python 3.5 or later.

Commands

  1. Create a site:

    cocoa init
  2. Build articles:

    cocoa build
  3. Run a preview server (requires Docker):

    cocoa serve

Site structure

Each Markdown file starts with YAML-like front matter, followed by content:

title:   The cacao bean
slug:    /cacao-beans/

The *cacao bean* is the seed of the cacao tree, and is used to make
cocoa solids and cocoa butter.  This is the basis of chocolate, among
other foods.

You can read more about cacao [on Wikipedia][wiki].

[wiki]: https://en.wikipedia.org/wiki/Cocoa_bean

For posts, the slug will be prepended with a /YYYY/MM slug when built. For pages, the slug is relative to the root of the web server.

The following directory structure is used (and generated by cocoa init):

(source folder)/
   pages/
      (you can organise this folder however you like)
      about.md
      contact.md
      ...
   posts/
      (likewise, you can organise this however you like)
      (Hot Chocolate will find any Markdown files in the tree)
      an-interesting-story.md
      another-interesting-story.md
      the-final-part-of-the-story.md
      ...
   static/
      (this directory structure is copied directly into the build root)
      aztec-sculpture.jpg
      cacao-beans.png
      personal/
         contact-photo.tiff
      ...
   style/
      (a custom.scss file in this directory will override the base styles)
      custom.scss
   templates/
      (templates in this directory replace the base templates)
      base.html
      ...

Metadata

Release files for hotchocolate 3.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hotchocolate 3.0.1
File Size Uploaded
hotchocolate-3.0.1.tar.gz 18.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hotchocolate 3.0.1
File Interpreter ABI Platform
hotchocolate-3.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 51.8 kB

Release files / hotchocolate-3.0.1.tar.gz

Download URL hotchocolate-3.0.1.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
cf0e045fec5f0e71edc665f25534abc471ba78656248d82f06addfb915ca4963
BLAKE2b-256 checksum
How to use checksums
9020a877690897e35d65b3bfc74ccde005df99ca6baa1a5ab1bc2c0576434164
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / hotchocolate-3.0.1-py3-none-any.whl

Download URL hotchocolate-3.0.1-py3-none-any.whl
Size 33.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
065aacf6bb9de7b7e229082cf30323c668bcb136ac762de2bceb3b1ed990194e
BLAKE2b-256 checksum
How to use checksums
ccc3ae008e816ac84f97e41fc1fc776a935d0bac3440dbdc342720a08135e107
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

3.0.1 This release

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

3 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page