3 ms·
> Ivy is a static website generator. It transforms a directory of text files into a self-contained website. Perhaps a stupid question but isn't that what HTML
by amelius 9y ago
> Ivy is a static website generator. It transforms a directory of text files into a self-contained website.
Perhaps a stupid question but isn't that what HTML was designed for? It doesn't even require a generator.
- theoctopus 9y agoThe main advantage of a static site generator is it allows you to just write the contents of each page and the generator will insert that into a page template. It means that, for example, a site-wide navbar only needs to be written once rather than added to every page manually.
- nine_k 9y agoEven more importantly, if you change the navbar, it changes everywhere, no chance to forget, no tedious and error-prone copy-pasting. Also, applying syntax highlighting to code fragments, doing the right thing around pictures, e.g. set explicit size, and many other seemingly trivial but tedious things. In short, static site generators remove the legwork from static HTML.
- mixmastamyk 9y agoAll these reasons and it sucks to write html by hand compared to markdown or rst.
- mixedmath 9y agoSuppose for instance you wanted a static blog. Blog engines like wordpress (or django or flask for python setups) generate parts of the site on the fly as users visit. For instance, you might generate the most recent 10 posts in some list somewhere. This requires some (often not much, but some) additional time from the server as these are generated on the fly. A static website generator like this allows you to make a blog (for example) and update content like most-recent-10-post lists (also for example) only when you actually add a new post. Thus no additional time is required on the fly. I might add that there is an extension for flask (which I normally think of as dynamic) called Frozen-Flask which also allows a flask-built site to become a static site. This probably exists for django as well, but I'm less familiar with django than flask.
- biscotti 9y agoOne django app that provides this is django-bakery, you could run the local server to add or edit content using django-cms or mezzanine then use bakery to generate a static site to host. https://github.com/datadesk/django-bakery https://github.com/datadesk/django-bakery
- txsh 9y agoIn HTML you cannot reuse code or split the code into multiple files without using copy and paste, iframes, or Javascript. Software like this allows you to create templates and generate multiple pages with different content. This can be achieved with server-side scripting languages. However, it is slower than static HTML. So if the content doesn’t change often, generating static HTML might be the eay to go.