News for hackers. Stuff that matters.
Re:Static Website Generators by johnmw on Monday September 19, 2016 @02:00AM (#12529282)
I crave simplicity in my life right now and am using markdeep: https://casual-effects.com/markdeep/

I write my documents in markdown and add this tag at the end of my document <script src="markdeep.min.js">

I "publish it" by copying it to my server and renaming it .html

* note: To get started, here is the suggested starter document: https://casual-effects.com/markdeep/starter.md.html

Re:Static Website Generators by bbx on Monday September 19, 2016 @03:43AM (#12529648)
I'm not sure if this counts as a "static website", since the page is not delivered exactly as stored. It requires JavaScript to actually renders the page, which seems like an overkill.
Re:Static Website Generators by Already__Taken on Monday September 19, 2016 @04:02AM (#12529720)
That's just client side templating. Which has the same problem they all do of being greeted with a white page until ALL the content is ready.

If someone is prepared to accept this it's not that hard to accept generating the html page yourself and uploading that.

Re:Static Website Generators by masklinn on Monday September 19, 2016 @05:06AM (#12529958)
> That's just client side templating. Which has the same problem they all do of being greeted with a white page until ALL the content is ready.

Or being greeted with a white page period if you're using a non-JS enabled HTML client (noscript, CLI browser).

Re:Static Website Generators by laurent123456 on Monday September 19, 2016 @10:01AM (#12531498)
In this particular case, wouldn't they see the plain text markdown? (which in many case is just as good the html)
Re:Static Website Generators by masklinn on Monday September 19, 2016 @10:26AM (#12531683)
Kinda, it looks like they add a bit of CSS (basically make everything monospaced & pre) so the Markdown text is visible when JS is disabled (noscript), but in a CSS-less browser (e.g. links) the file is received as HTML, and the Markdown code is directly interpreted as HTML, which makes for an unreadable mess (the whole thing is a single "line" with newlines collapsed to spaces)

You're really better off using a static conversion tool, or using markdeep as a static conversion tool (with ?export)

Re:Static Website Generators by coldtea on Monday September 19, 2016 @07:36AM (#12530510)
It's 2016, if you use a non-JS enabled HTML client you better be used to the breakage.
Re:Static Website Generators by masklinn on Monday September 19, 2016 @07:56AM (#12530630)
Sure I'm used to closing the page, because really screw you if you can't display half a dozen paragraphs of text without JS.
Re:Static Website Generators by coldtea on Monday September 19, 2016 @08:13AM (#12530718)
Well, most of those websites would rather say:

Don't let the door hit you on your way out

Than spend time catering to outliers...

Re:Static Website Generators by raimue on Monday September 19, 2016 @08:29AM (#12530854)
I fully agree. Why render it in every client when you can do it only once on the server? This feels like a waste of CPU resources.
Re:Static Website Generators by accordionclown on Tuesday September 20, 2016 @05:32PM (#12543614)
compared to all the other things your cpu is doing, and all the time your cpu sits there doing nothing, the "waste" in this case pales to total unimportance. you've got a supercomputer; you might as well use it.
Re:Static Website Generators by raimue on Tuesday September 20, 2016 @05:38PM (#12543638)
An idle core will definitely use less power than one constantly processing. That is what drains the battery in your laptop. I'd rather not spend my battery power if it can be done on the server instead.
Re:Static Website Generators by versteegen on Monday September 19, 2016 @08:58AM (#12531053)
Thanks. That's a nice idea... but if it's that simple I might as well just use a static markdown to html converter, if I don't need the support for diagram generation (which admittedly looks like a killer feature). For example, pandoc supports that (or latex -> html or pretty much anything else), and the results are similar, e.g. (in this case, specifying a very small amount of additional css): http://pandoc.org/demo/example3.html

I'm currently using couscous (http://couscous.io/) to convert markdown to html but it's far more work to use, and does a whole bunch more than that, such as twig templates, so I'll consider switching to markdeep or pandoc.

Re:Static Website Generators by merpnderp on Monday September 19, 2016 @10:25AM (#12531673)
Since the website is rendered with JS onload, doesn't this make your site a second class citizen in regards to SEO? If you want people to actually read what you write, static content from the server is still superior.
Re:Static Website Generators by reitoei on Monday September 19, 2016 @11:26AM (#12532133)
> doesn't this make your site a second class citizen in regards to SEO

Not with any search engine that matters.

Re:Static Website Generators by thomasahle on Monday September 19, 2016 @03:27AM (#12529589)
That's impressive! It even has math support! I do wonder about generating the diagrams at every page load. Seems like markdeep might as well have been a static generator?
Re:Static Website Generators by versteegen on Monday September 19, 2016 @09:06AM (#12531099)
Yeah, but you can easily copy-paste the generated html into a file. Just append '?export' to the URL. I definitely would use it in that way.