top | item 16245810

Ivy – A static website generator built in Python

161 points| dm40597 | 8 years ago |mulholland.xyz | reply

75 comments

order
[+] bgrohman|8 years ago|reply
It looks nice, but I guess I still[1] don’t understand the proliferation of simple static site generators. It’s pretty easy (and fun!) to build your own that works exactly as you want it to. And I don’t think a static site generator is suitable for non-technical users. Is there an in-between type of user technical enough to use a static site generator but not able to write their own? Or maybe the proliferation is only because they are both easy and fun to create?

[1]https://news.ycombinator.com/item?id=14877298

Edit: I didn’t intend for this to sound negative for the creator. Even if it’s just for fun and the chance someone else might find it useful, that’s enough of a reason to build it for me.

[+] bane|8 years ago|reply
Learning how to program, especially when one doesn't come about it through self-selected autodidactism, can often seem to be an insurmountable challenge to people who don't know how.

This applies to even extremely technical, highly intelligent people. Often they recognize that there's an extraordinary time component to learning, and they optimize around that in other ways.

Learning to program is a weird thing because once you learn the mental processes of how to do it, it comes fairly easily. But the idea of "I'd like a tool that makes websites for me" and then knowing how to divide that problem down to the right mental abstraction model that perfectly (or near perfectly fits) some programming language and technical environment is a very difficult learning curve.

It's much simpler then to present small technical pieces that are well constrained in scope and definition and have tooling somebody else built do all the rest of the heavy lifting.

Static site generators are one of those things that are relatively easy, even for newish programmers, to build, but exist right on the other side of that learning curve for non-programmers.

[+] coldtea|8 years ago|reply
>It looks nice, but I guess I still don’t understand the proliferation of simple static site generators. It’s pretty easy (and fun!) to build your own that works exactly as you want it to.

Notice how these two sentences are contradictory -- or rather how the second explains what the first supposedly can't understand.

If it's "pretty easy and fun" to build X, then that would inevitably lead to a "proliferation of" X projects.

It just takes a person that built one to then share their implementation on GitHub to increase that proliferation, and that's a very simple additional step.

And it just takes any person who understands "opportunity cost" to want to adopt an existing static site generator rather than build their own.

Both kinds are in abundance.

[+] tempay|8 years ago|reply
I fall into the category of a technical user who could build their own, however I use existing ones as:

- It's faster and I already have more fun projects than my time allows.

- I don't particularly enjoy writing HTML/CSS (though the rest of the project would be fun).

- I'm happier using an existing template rather than making my own. I know I'll be too critical of the design if I do it myself.

[+] crdoconnor|8 years ago|reply
>It looks nice, but I guess I still[1] don’t understand the proliferation of simple static site generators. It’s pretty easy (and fun!) to build your own that works exactly as you want it to.

I don't think that's true. It looks deceptively easy up front but the subtleties involved actually make it pretty hard. I've tried hugo, jekyll and pelican and they've all pissed me off for one reason or another. A common issue involves one of the 'template' themes I found on their template theme libraries not working on the "latest" version of the generator.

Ivy seems to have "solved" this problem by having almost no themes. This is not exactly the solution I was thinking of...

There's still a gap in the market here I think, and there will continue to be a proliferation (like how there was with bad javascript toolsets until jquery 'won' ~2007-8) until somebody makes an acceptably 'good' one or fixes an existing one until it obviously stands head and shoulders above the rest.

If you can make a well designed static site generator with lots of nice themes (or the potential for that) that doesn't fail horribly when I try to use it in a normal fashion I'd switch to it in a heartbeat and tell all of my friends. I'm using hugo now, but I'm not super happy about it: last problem with that being that I couldn't get it to competently handle breadcrumb navigation.

[+] b5|8 years ago|reply
I'm one of those people who falls into that group -- I can, and have, used a static site generator, but have nearly zero programming knowledge so couldn't make one of my own. The biggest issue I have now is choosing which one to use. I've mostly used Hugo, with good results, but always have that slight niggle wondering if there's something that would work a bit better for me.
[+] pmlnr|8 years ago|reply
Static site generators are more than suitable for non-tech users - they used to be called Macromedia Dreamweaver, Microsoft FrontPage; etc.

I'd very much like to see fullon wysiwyg static generators again; it could replace half, if not more, of the WordPress sites around.

[+] rubenbe|8 years ago|reply
I've a site deployed using Lektor[0] for a slightly technically inclined user, who gets a UI to edit his site and when ready to publish, just click the button.

[0] https://www.getlektor.com/

[+] isatty|8 years ago|reply
I think if people dedicated time to creating one for their own use it can be done (I am decent at Python and I would like to think that I can too) but at the same time I don't want to much around with HTML and particularly CSS.

I use static generators purely by available themes because that's the part that I hate the most.

[+] sgallant|8 years ago|reply
We're helping bridge the gap for non-technical users with our Jekyll and Hugo CMS (https://forestry.io). There are many other options too, just check out https://headlesscms.org.

It's an exciting time to be a web developer. We have many static site generators (like this one) to help build super performant sites, we can host them in the cloud for a negligible cost, and we can keep everything in Git.

[+] BeetleB|8 years ago|reply
>Is there an in-between type of user technical enough to use a static site generator but not able to write their own? Or maybe the proliferation is only because they are both easy and fun to create?

Not sure if you mean to ask why people don't create their own static sites (without generators), or did you mean dynamic sites using PHP/Ruby/Python?

For the argument over dynamic sites:

Yes - the type that does not want to worry about security vulnerabilities.

My blog is made via a static site generator. I updated infrequently (once every so many months). I want to have it up and running for years without my intervention (i.e. maintenance).

I once had a Wordpress blog and treated it that way. It was hacked.

Then I built my own in Django. Then at some time it went down because my service provider updated Python libraries, etc.

The funny thing is: Using a static site generator is no more work, and has no fewer advantages. Why should I use a dynamic site or build my own?

For the argument against static sites, well then you'd have to maintain lots of links manually. A SSG gives you a lot of that for free. And you can use templates.

[+] sevagh|8 years ago|reply
>Is there an in-between type of user technical enough to use a static site generator but not able to write their own?

A lot of people who want pretty websites without writing or learning a lick of frontend technologies.

[+] skywhopper|8 years ago|reply
I agree it can be fun. And lots of us probably have written such systems ourselves. However, even for those of us who could write one, sometimes you just want to use a tool, not write it and worry about bugs and new features constantly. A good pluggable static site generator can potentially give you a lot more featues than something you write yourself.
[+] ioddly|8 years ago|reply
I find the features of Jekyll important; I use it for client projects and mock up designs. While I don't like everything about how it's structured and I've written my own for fun, it'd be a lot of work on my part to create and maintain something equivalent.
[+] weberc2|8 years ago|reply
> I guess I still[1] don’t understand the proliferation of simple static site generators

> It’s pretty easy (and fun!) to build your own

Seems like you answered your own question. :)

[+] jonnycomputer|8 years ago|reply
Sure, I could write my own. But, for god's sake, why? My time is too precious to spend on all things that I could do on my own.
[+] jaredandrews|8 years ago|reply
Not sure if OP is the developer behind this but...

As a happy user of Pelican[0], a different Python based static site generator. Why would I want to switch over to Ivy?

[0] https://blog.getpelican.com/

[+] guitarbill|8 years ago|reply
Not OP, but I'm tempted to switch. Because I had an issue with Pelican where I couldn't get year/month archives to work sanely (Pelican does year/month/day which is too fine for me). So I had to write my own generator anyway, and plumb that into Pelican. It wasn't that easy to do, although I do think Pelican is fairly hackable, if anything else was more easily hackable/extensible, I'd use it. Plus not having Python 2 legacy stuff in the codebase is a plus when I'm grokking it. I also find the Pelican config overburdened [0], but understand why it came to be that way.

I'm giving it a go this weekend, let you know if it worked out for me.

[0] http://docs.getpelican.com/en/stable/settings.html

[+] mixmastamyk|8 years ago|reply
I didn’t care for how it pushes a web server and absolute urls on you. Seems it could still learn a lot from Sphinx.

As the sibling comment mentions I sent a pull request to fix some broken css and they requested I fix their test suite first. No thanks, moving on.

[+] fiatjaf|8 years ago|reply
It's odd that this has gotten so many upvotes while there are thousands of other static site generators[1] and this one doesn't even provide a single explanation as to why it is different or why would someone prefer this over one of the most famous ones.

[1]: https://www.staticgen.com/

[+] viperscape|8 years ago|reply
No purchase necessary! The title and the slogan on the site seem to infer something else. It's public domain source, it says at the bottom of the page. Glad to see more static generators, not sure how this is better or different than the other many
[+] ezekg|8 years ago|reply
Thanks for the clarification. I was looking everywhere for a price tag but couldn’t find it. Was excited to see another dev charge for their work! Maybe the title of this post should be changed so it’s less confusing?
[+] dod9er|8 years ago|reply
Sorry for offtopic, but I´ve seen many nice-looking website generators here, but being a backend-guy I struggle more with the frontend, getting a nice layout/theme/font without deepdiving into css/js/html. Any suggestions here ? Any Wysiwyg-Editor which generates a reasonable output ?
[+] TheAceOfHearts|8 years ago|reply
* Avoid custom fonts. You probably don't need a custom font. Just use system fonts. Using built-in fonts will allow your site to load faster.

* Getting a "nice layout/theme" is a design problem. I'd suggest following someone's style guide. I'm fond of the U.S. Web Design System [0] since it's lightweight and accessible. Disagree with their suggestion to use a custom font.

* Keep the layout as simple as possible, with a focus on content. You can go incredibly far with semantic HTML and a smattering of CSS. I don't think it requires a deep-dive.

[0] https://designsystem.digital.gov/

[+] gkya|8 years ago|reply
I know this is controversial but the default html layout is what most people need. You can use markdown or org mode etc. to generate it. One improvement may be centering the content on bigger displays, which I do for my blog with two @media rules as follows: https://www.gkayaalp.com/style.css
[+] luckydude|8 years ago|reply
I love this sort of static generator for a non-obvious (perhaps) reason: you can version control the source. I find that hugely useful when maintaining a complex site.

I wrote a similar tool, years and years ago, that took what looked like "troff -ms" input and spit out the whole website, complete with a site map. Here's an example

http://www.mcvoy.com/lm/bkdocs/UG/tmp/Introduction.html

if you go up a directory level and poke around, that's the source to website and webroff is the script that produced that website.

[+] mkesper|8 years ago|reply
Please, everyone, don't use the "unlicense" for software. It makes it impossible to use / contribute globally. See e.g. here: https://softwareengineering.stackexchange.com/questions/1471...
[+] gw|8 years ago|reply
The fear-mongering about public domain seems to drift further and further from reality. Is SQLite "impossible" to use globally? Its public domain dedication is even more terse than the unlicense. If it really does become a practical issue for Germans, maybe the real problem is the German legal system.
[+] wildermuthn|8 years ago|reply
Looks nice.

If we're going to compile our FE code (sometimes once with production babel/webpack builds, sometimes more often with every server-side rendered cache miss), then we might as well go all in with static-site generators. The epitome of this trend is https://www.gatsbyjs.org/, a framework designed around GraphQL and React.

[+] fiatjaf|8 years ago|reply
In more-or-less the same niche as Gatsby there is my Sitio[1], which also uses React (so kinda isomorphic pages), main differences being:

- No GraphQL stuff, but instead you'll use imperative JS code to tell the library which pages you want to build, with data from anywhere (files, CMSs, hosted contents elsewhere etc.) you can fetch using the same JS code, transform with any library etc.

- No Webpack, no Webpack transforms. I suffered when I tried to use Gatsby because of the gigantic dependencies on Webpack. I guess it's changed nowadays, but still I'm hurt and won't go back there. Here we're proud to use Browserify and go with more modular architecture.

[1]: https://github.com/fiatjaf/sitio

[+] wiradikusuma|8 years ago|reply
Just FYI, "Ivy" is also the name of a very popular dependency management tool in Java, maybe like pip in Python.
[+] peller|8 years ago|reply
Looks pretty nice for simple static sites. However on the homepage it says

> You can build any kind of website using Ivy but it's particularly suited to building project documentation

But unfortunately I'm not seeing anything about generating source code documentation from docstrings (like Sphinx). For me, that would make it much more useful.

[+] zmmmmm|8 years ago|reply
General question - I don't understand why so many static site generates, github, many others, all use templates that won't fill the width of the page. Is using the full width of the page particularly difficult to design for? Or is it an aesthetic decision that template authors feel like having a 20 inch wide monitor with 8 inches of text in the middle flanked by 12 inches of white space is a nice layout? Particularly for code examples it's very frustrating seeing lines wrapped around unnecessarily on a large, wide monitor.

(sorry if this sounds like a rant, actually just genuinely curious).

[+] alant|8 years ago|reply
I tried Jekyll with github and it's awesome (until I can't fix certain details). If Ivy can integrate with with github that'd be awesome!
[+] mikeymop|8 years ago|reply
Nice! I'll have to play with it. It's going to take a lot of uplift me from Hugo with it's single binary.
[+] amelius|8 years ago|reply
> 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.

[+] mixedmath|8 years ago|reply
Suppose 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.

[+] txsh|8 years ago|reply
In 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.

[+] theoctopus|8 years ago|reply
The 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.
[+] brndnmtthws|8 years ago|reply
How does this compare to something like Jekyll? Is the only difference that this is written in Python and Jekyll is Ruby?