Re:Show HN: Makesite – A static site generator in 125 lines ...
by est on Saturday March 17, 2018 @08:07AM
(#16606609)
generate static site with 1 line of shell command
[ Parent
| on HN ]
Re:Show HN: Makesite – A static site generator in 125 lines ...
by secura on Saturday March 17, 2018 @08:32AM
(#16606675)
Is this a valid HTML? 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
Re:Show HN: Makesite – A static site generator in 125 lines ...
by butz on Saturday March 17, 2018 @08:52AM
(#16606733)
You can trim <html> tag and still get valid html:
<!DOCTYPE html><title>0</title>
Re:Show HN: Makesite – A static site generator in 125 lines ...
by cryptoz on Saturday March 17, 2018 @10:08AM
(#16606995)
It's still a site even if it doesn't validate. HN (news.ycombinator.com) generates more than 100 errors on that validator. Doesn't mean HN isn't a site.
Re:Show HN: Makesite – A static site generator in 125 lines ...
by rambojazz on Saturday March 17, 2018 @10:41AM
(#16607140)
You can even go more minimalist. An empty file is a site too.
Re:Show HN: Makesite – A static site generator in 125 lines ...
by 52-6F-62 on Saturday March 17, 2018 @11:12AM
(#16607293)
Still takes one line, but it would be smaller in size
touch i
Re:Show HN: Makesite – A static site generator in 125 lines ...
by e12e on Saturday March 17, 2018 @01:30PM
(#16608024)
No 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.
Re:Show HN: Makesite – A static site generator in 125 lines ...
by ariofrio on Saturday March 17, 2018 @04:54PM
(#16609021)
> index.html
You win.
Re:Show HN: Makesite – A static site generator in 125 lines ...
by 52-6F-62 on Saturday March 17, 2018 @07:53PM
(#16609739)
Agreed. I concede!
Re:Show HN: Makesite – A static site generator in 125 lines ...
by petercooper on Saturday March 17, 2018 @08:46PM
(#16609923)
>index.htm
Two characters shorter and will work fine on most HTTP servers ;-)
Re:Show HN: Makesite – A static site generator in 125 lines ...
by 52-6F-62 on Saturday March 17, 2018 @10:08PM
(#16610139)
Now you're just being pedantic, Peter!
Re:Show HN: Makesite – A static site generator in 125 lines ...
by petercooper on Sunday March 18, 2018 @03:39PM
(#16613834)
Yes, but it looked like this was turning into a golfing thread ;-)