Ivy

A static website generator for people who enjoy the simpler things in life.

Version 6.0.0

FAQ


Is Ivy fast?

No. Ivy is designed to be easy to use, with lots of flexibility under the hood if you're prepared to write a little extension code. Execution speed isn't a significant design goal as it's simply irrelevant for the kind of small personal or project websites Ivy is intended to be used for.

As a rough benchmark, a clean (no-cache) build of the Ivy demo site which contains 7 output pages takes 0.15 seconds on my laptop. A clean build of the Holly demo site which contains 951 output pages takes 1.7 seconds. This means that on my particular hardware I can expect a throughput of roughly 500 pages per second.

If you need to build a website with tens or hundreds of thousands of pages, Ivy probably isn't the right tool for you. Hugo is a popular static site generator with a focus on execution speed that may be a better match for large sites.

Can I build a blog using Ivy?

Holly is a blog-engine plugin for Ivy. It adds support for WordPress-style post and tag indexes.

Where do I put my image files?

Image files, along with any other static assets, should be stored in the site's resources directory, res. The content of this directory is copied to the output directory when the site is built.

As an example, assume we have a file named photo.jpg stored in a directory named images within the res directory, i.e.

site/
|-- res/
    |-- images/
        |-- photo.jpg

This file will be copied to the output directory and can be accessed in templates and node files via the url:

@root/images/photo.jpg

Ivy has no special support for WordPress-style featured images but we can implement similar functionality simply by adding the image name as an attribute to the page header, e.g.

---
title: Page Title
image: photo.jpg
---

We can then check for the presence of a featured image in the appropriate template file:

{% if node.image %}
    <img src="@root/images/{{node.image}}">
{% endif %}

Yaml supports lists so we can implement galleries in a similar manner by adding a list of image names to the header and then iterating over the list in the template file:

{% for image in node.gallery %}
    <img src="@root/images/{{image}}">
{% endfor %}

Why do I get an error when I add a url to a Yaml header?

Yaml doesn't support unquoted values that begin with an @ symbol so you'll get an error message if you add a bare @root/ url to a Yaml header, e.g.

---
image: @root/images/photo.jpg
---

Quoting the url solves the problem:

---
image: "@root/images/photo.jpg"
---

How do I deploy a site built with Ivy?

One of the nicest things about a static website is that it's completely independent of the tool used to build it. You can host your website anywhere you like — in the simplest case you can 'deploy' it simply by double-clicking on the .html files to view them locally in your browser.

To make your website available on the public internet you have lots of options. Here's some of the most common, in order of increasing difficulty and expense.

Why is it called Ivy?

I liked the name Industrial Vellum, IV. Also, the branching tree structure of the nodes reminded me of ivy.

How do I generate absolute urls?

You can tell Ivy to generate absolute urls by specifying an explicit root domain in your site configuration file, e.g.

root = "http://example.com/"

Specify a single forward slash to generate site-relative urls.

How do I specify a custom file extension?

You can specify a custom file extension for output files in your site configuration file, e.g.

extension = ".htm"

Specify a single forward slash to generate directory-style urls.