Ivy – A static website generator built in Python
mulholland.xyz
mulholland.xyz
[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.
I use static generators purely by available themes because that's the part that I hate the most.
However I’ve had lots of success building sites with Jekyll and love the speed with which it’s possible to get something up and running.
A lot of people who want pretty websites without writing or learning a lick of frontend technologies.
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.
Because there are an unlimited number of things to create, and only a finite time in your life?
- 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.
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.
Also yea, don't really want to do CSS and web design just to put a bit of content online. Hence why these things exist.
Yes, it really is a chicken-egg problem where I think you need to start with at least a half-dozen attractive themes to get attention.
Theme designers are not going to build themes for a site generator that nobody uses. And nobody (relatively) is going to use a site generator that has only a "document" theme.
Generators like Hugo, for whatever their faults, have dozens of really nice-looking themes so it's easy to find something close to what you want and either use it as-is or make some minor tweaks.
A lot of the themes on generators like Hugo are ugly or don't work too.
Probably porting a group of 10 nice ones would be enough.
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.
> It’s pretty easy (and fun!) to build your own
Seems like you answered your own question. :)
I'd very much like to see fullon wysiwyg static generators again; it could replace half, if not more, of the WordPress sites around.
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.
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.
As a happy user of Pelican[0], a different Python based static site generator. Why would I want to switch over to Ivy?
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.
I'm giving it a go this weekend, let you know if it worked out for me.
You'd have to re-write all your links, and the way you attach e.g. images to a post (for me the biggest deal breaker). You'd also have to write your own extensions for tags, neighbour pages, and much more. To be fair, the author never claimed it replaced Pelican or any other blog-capable static site generator. If you have a very simple site, it could work.
I also get the feeling Ivy is a bit of a vehicle to push the author's replacements for argparse (janus), markdown (monk), and jinja (ibis).
* 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.
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.
So the "unlicense" or "public domain" license is basically not more than a weak promise that the author won't sue you over any usage which they can break at any moment. On a proper license, you'd be safe if you comply with the license.
Waiving all your present and future claims on a software without any compensation beforehand could very well not be permitted in many legal systems. Law systems such as Germany and many other countries do not recognize software as an intellectual property. Software is recognized as a right which has personal and economic prospects. It is asserted that you can make legal acts on the economic prospects, but your ability to make legal acts for the personal part of your right on the software you've written can be limited. Because it is believed that there are some rights you have, that you cannot freely dispose of. For example you cannot make a legal act to become the slave of someone else, or you cannot trade your life for money. Because of the same reasons you cannot trade all rights for something you've created (~your software).
On the other hand, as tscs37 has stated, the unlicensed "license" statement means that you promise to not pursue your legal rights against anyone who uses your software. But as there are no parties, no signatures, no compensation, this is not a license agreement. This could only be regarded as a promise. You could break it at any moment, change your idea etc. But if you do that without any cause, you could get sued for damages, because of the trust you've implied to the other party.
Again, I don't know much about copyright law. I'm just a law student. But IMHO, you can safely rely on using software that promises to guarantee the unlicensed clause. If the author of the software changes their minds, you might have to switch to using a different software but you can in principle get compensation for all provable costs that this change has caused you or may cause you in the future.
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.
- 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.
> 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.
(sorry if this sounds like a rant, actually just genuinely curious).
Perhaps a stupid question but isn't that what HTML was designed for? It doesn't even require a generator.
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.
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.
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.