7 ms·
So I haven't done web development since the early 2000's when I transitioned into becoming a technical PM and recruiter full time, nothing more than tweaking so
by iamdave 11y ago
So I haven't done web development since the early 2000's when I transitioned into becoming a technical PM and recruiter full time, nothing more than tweaking something in my blog theme (changing a font or a link color). Therefore, I am way behind the times.
Here's my genuine question: it seems like the term 'static site' means something different from my understanding of it in the 00's-a plain HTML page with no server side processing (PHP, ASP, Coldfusion, etc). Is this correct? What exactly are these static sites and why does one need to be "generated" versus crafting your own markup? Time and efficiency or is there more under the hood than I understand?
Thanks!
- jdmaurer 11y agoStatic site generators are used to speed up the process of development in terms of being able to code it as you would a dynamic site, but "compiling" down to a production-ready static site with minified code. A lot of them allow you to do things like including partials, string interpolation, using middleware and pre-processors, etc.
- iamdave 11y agoWhen you say 'minified' in regards to code, what does that mean exactly? More concise code that simply does the same thing as larger chunks of markup?
- detaro 11y agoYes. E.g. removing unnecessary newlines/spaces, refactoring JavaScript to short variable names, ... to reduce the file sizes.
- Jack000 11y agoif you write html files individually, you'll have to update the navigation of each file when you add a new page. Same issue with categories, tags etc. SSGs just make it a bit easier to manage that stuff, and provide a framework to add other functions - markdown support, rss, sitemaps etc
- iamdave 11y agoif you write html files individually, you'll have to update the navigation of each file when you add a new page I remember this being a MASSIVE pain. Managing that is a huge benefit. Thanks for the explanation!
- bdg 11y agoIt's also cool because you can prototype on a static site and think about the design like it is dynamic (eg, not doing a cut and paste of page layout). Then the migration to a proper framework like Symfony, or Silex is much simpler as you can always move the templates over (but you'll still need some tweaking).
- pierrec 11y agoA static site still designates a site with no server-side processing, just serving of (static) content. As for it being plain HTML, no, it can be full of JS, videos, whatever, it's still static. I do remember a time when the expression "dynamic HTML" was popular to designate HTML+JS. Therefore, "static" may have been used in contrast to "dynamic" to designate plain HTML pages indeed. This is not the case now.
- detaro 11y agoTime and efficiency is the main point. Take a blog: if you write it entirely by hand and add an article, you now have to: * include it in the main page * update the RSS feed * include it in all the category/tag listings * if you have prev/next article links, you have to add it to the last article * included images need to be prepared for web * if you show a code example, you might want to syntax-highlight it If you want to change the design, you have to touch all pages (or do search/replace and hope that it doesn't mess anything up) ... Or you could have a program that you feed text + raw images for your articles and that automatically generates all the necessary files/changes old ones accordingly, based on this input and templates. The result then can be served by web server that doesn't speak any server-side language.
- mtw 11y agoStatic site generators don't have server side processing. They are best when building landing pages, corporate sites, or simple blogs. It's cleaner, lighter and more maintainable than solutions like wordpress, drupal or most cms