3 ms·
Short version: you maintain some data on our own machine which describe your content. Most commonly, this is done in flat files formatted with markdown or anot
by patio11 11y ago
Short version: you maintain some data on our own machine which describe your content. Most commonly, this is done in flat files formatted with markdown or another plain-text option.
Your static site generator is built out of code. You execute it on your local machine, periodically, generally when you have a new blog post to publish or similar. The generator combines your content plus templates (either ones it ships with, ones you build, or ones you found from the community around that generator) to spit out a bunch of compiled HTML/CSS/Javascript.
You then upload the entire compiled site to your host of choice. From the perspective of someone visiting your website, they don't know it was generated at all -- they just download HTML really, really fast which appears to have bells-and-whistles from dynamic sites like e.g. navigation which is consistent across multiple pages, related article links, etc etc.
There exist numerous other ways to achieve this objective, but the above description of a static site generator is the one most programmers independently re-invent when they attempt to build one. I had built four in my younger years before I realized that software like that had a name and was available on the Internet for free.