News for hackers. Stuff that matters.
Re:Password protect a static HTML page by matsemann on Saturday February 18, 2023 @01:08PM (#34849295)
I think your definition of a static web page is different from the common one?

In my head, a static page is something that's served verbatim, without some backend generating it or inserting things into a template.

Wikipedia seems to agree with that view: https://en.wikipedia.org/wiki/Static_web_page

Re:Password protect a static HTML page by superkuh on Saturday February 18, 2023 @01:11PM (#34849344)
That's exactly what I said. It doesn't matter if I wrote the HTML by hand or I had a perl, or bash, or compiled c program make it. It's just an HTML file.
Re:Password protect a static HTML page by swatcoder on Saturday February 18, 2023 @01:26PM (#34849525)
HTML includes the content of style and script elements (among many others) and the results of whatever they do.

The combination of all of these direct a browser in how to render a page.

Traditionally, a static site or static page is one whose data can be delivered to the client directly as stored, with no server-side alterations or generation.

This is/was a meaningful distinction because a server that can stream stored data is fundamentally much simpler than one that executes programs. Such a server can run in different contexts, be optimized in different ways, and satisfies constraints that allow further optimizations downstream.

Re:Password protect a static HTML page by shawabawa3 on Saturday February 18, 2023 @01:15PM (#34849392)
You're incorrect

CSS and JavaScript and images are also static, it doesn't have to be just HTML

If you have a perl or bash or c backend generating html in response to http requests it's not static

Re:Password protect a static HTML page by superkuh on Saturday February 18, 2023 @01:20PM (#34849443)
You're assuming this is a backend. It is not. Do you consider generating an HTML file in a WYSIWYG editor like, say, "Dreamweaver" that outputs an .html no longer static because it was made by a program? That's absurd.
Re:Password protect a static HTML page by shawabawa3 on Sunday February 19, 2023 @12:17PM (#34859574)
No, that's static, that's why I said "in response to an http request"
Re:Password protect a static HTML page by mytailorisrich on Saturday February 18, 2023 @01:22PM (#34849479)
It can be html, css, javascript, whatever.

'Static' means it's only made of static file that can be served by just a vanilla Web server (i.e. just by serving static files).

Re:Password protect a static HTML page by meghan_rain on Saturday February 18, 2023 @01:15PM (#34849388)
Lol no. If you HTML is generated, it's by definition not static anymore.

Otherwise, all of the React server side rendering is static HTML.

Re:Password protect a static HTML page by superkuh on Saturday February 18, 2023 @01:21PM (#34849458)
Oh, so when I make an .html file in Dreamweaver WYSIWYG HTML editor and save the .html file to my websever ~/www/ dir it is automatically not a static page anymore because I used a program to generate it? This is a very wild and weird interpretation of 'static site' that does not fit with existing usage.
Re:Password protect a static HTML page by Kiro on Saturday February 18, 2023 @01:34PM (#34849622)
You are the last person to have a say in that considering your incorrect take that JS can't be static. You're clearly misaligned with common usage of terms.
Re:Password protect a static HTML page by superkuh on Sunday February 19, 2023 @09:24AM (#34857787)
When javascript started being able to change HTML significantly the result was literally named "Dynamic HTML". So it is clear this is not a static HTML page. The only thing left to argue is weather it is a static web site. People who got into web dev after 2010 will say yes, people who watched HTML/JS evolve over it's lifetime will say no.
Re:Password protect a static HTML page by GeneralTspoon on Saturday February 18, 2023 @01:21PM (#34849463)
No, because React is dynamically generating the HTML on the fly.

If you pre-compile the HTML using something like Jekyll, so that the webserver is just serving HTML files without any dynamic/on-the-fly processing at request time, then it's considered static.

Re:Password protect a static HTML page by matsemann on Saturday February 18, 2023 @01:47PM (#34849766)
React server side rendering: most likely dynamic

React on the client side: static, as you still got the same files served, how they dynamically alter the page runtime doesn't count.

Re:Password protect a static HTML page by SamBam on Saturday February 18, 2023 @06:06PM (#34852049)
This is the most bizarre argument. Of course you can use build tools to generate static web pages.

The issue is whether they are being generated dynamically by a server. This project isn't. You run a build-tool once and then can post the .html page anywhere. It's static.

Re:Password protect a static HTML page by vore on Saturday February 18, 2023 @01:16PM (#34849401)
You can put client-side JavaScript fine in “just an HTML file”?