News for hackers. Stuff that matters.
Re:Sculpin – PHP Static Site Generator by iamdave on Sunday October 11, 2015 @04:30PM (#10370829)
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!

Re:Sculpin – PHP Static Site Generator by detaro on Sunday October 11, 2015 @05:03PM (#10371019)
Time 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.

Re:Sculpin – PHP Static Site Generator by pierrec on Sunday October 11, 2015 @04:51PM (#10370955)
A 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.

Re:Sculpin – PHP Static Site Generator by iamdave on Sunday October 11, 2015 @04:58PM (#10370989)
This makes sense, helping me get over the syntax of 'static' vs 'dynamic' in my mind thanks!
Re:Sculpin – PHP Static Site Generator by rascul on Sunday October 11, 2015 @08:25PM (#10371806)
Static sites can be dynamically generated ;)
Re:Sculpin – PHP Static Site Generator by jdmaurer on Sunday October 11, 2015 @04:43PM (#10370902)
Static 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.
Re:Sculpin – PHP Static Site Generator by iamdave on Sunday October 11, 2015 @05:00PM (#10370995)
When 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?
Re:Sculpin – PHP Static Site Generator by detaro on Sunday October 11, 2015 @05:04PM (#10371025)
Yes. E.g. removing unnecessary newlines/spaces, refactoring JavaScript to short variable names, ... to reduce the file sizes.
Re:Sculpin – PHP Static Site Generator by Jack000 on Sunday October 11, 2015 @04:45PM (#10370912)
if 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
Re:Sculpin – PHP Static Site Generator by iamdave on Sunday October 11, 2015 @04:59PM (#10370992)
if 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!

Re:Sculpin – PHP Static Site Generator by bdg on Sunday October 11, 2015 @05:09PM (#10371062)
It'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).
Re:Sculpin – PHP Static Site Generator by mtw on Sunday October 11, 2015 @05:06PM (#10371047)
Static 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