4 ms·
generate static site with 1 line of shell command echo "<html>" > index.html
by est 9y ago
generate static site with 1 line of shell command
echo "<html>" > index.html
- secura 9y agoIs this a valid HTML? https://validator.w3.org/ https://validator.w3.org/ seems to require this as minimal HTML to validate successfully. <!DOCTYPE html><html><title>0</title> I would thus fix your 1 line shell static site generator like this. echo '<!DOCTYPE html><html><title>0</title>' > index.html
- rambojazz 9y agoYou can even go more minimalist. An empty file is a site too.
- 52-6F-62 9y agoStill takes one line, but it would be smaller in size touch i
- e12e 9y agoNo need to use such a bloated tool as "touch" to create a site. Your shell can do it: > index.html And there's ofcourse: <<eof > index.html <html> <p>hello, world! from $(whoami)</p> </html> eof See also: m4.
- ariofrio 9y ago> index.html You win.
- 52-6F-62 9y agoAgreed. I concede!
- petercooper 9y ago>index.htm Two characters shorter and will work fine on most HTTP servers ;-)
- 52-6F-62 9y agoNow you're just being pedantic, Peter!
- petercooper 9y agoYes, but it looked like this was turning into a golfing thread ;-)
- noobermin 9y agoSnark aside, does it matter if most of the "site" is already in templates? Why shouldn't the templates be included in the metric?