
Void – A website creation tool - josephernest
http://thisisvoid.org/
======
pierrec
" _Static site generators seem like music databases, in that everyone
eventually writes their own crappy one that just barely scratches the itch
they had (and I 'm no exception)._" [1]

(And neither am I!) See this massive list of static website generators [2],
though it, too, probably barely scratches the surface.

My homepage is static and generated in raw PHP. Being originally a templating
language, I found it well suited to static generation, even without any
framework or tool on top of it. This especially applies if you don't need a
lot of "common" features, and have some other specific requirements (in my
case, I mainly needed pjax with non-pjax fallback, which keeps the music
playing while changing pages - surprisingly badly supported by existing
generators).

[1]:
[https://news.ycombinator.com/item?id=7747651](https://news.ycombinator.com/item?id=7747651)

[2]: [https://staticsitegenerators.net/](https://staticsitegenerators.net/)

------
pearjuice
Having 100 lines of code is not something to be proud of, especially if the
lines (3 examples picked arbitrarily) look like this:

    
    
        1/ if (count(array_slice(array_reverse(glob("./article/*.txt")), $_GET['start'], 11)) > 10)
        2/ error_reporting(0);
        3/ if (trim(dirname(parse_url($_SERVER['PHP_SELF'], PHP_URL_PATH)), '/') === $requestedpage)
    

Though I really hate to blame the programmer, projects like these is what
gives PHP a bad name; "Oh look another undocumented, untested, write-once
piece of PHP not confirming to any standards whatsoever!"

------
zapt02
I am pro PHP, but this is honestly an awful display of PHP usage. Templates
mixed with logic inside the main php file? Check. Not using Composer for
dependency management? Check. Reinventing the wheel when it comes to routing
instead of using a battle-tested component like the Symfony Router? Check.
Three strikes, you're out!

~~~
dewey
One of it's features is that it's "A single PHP file of less than 100 lines of
code." \- Adding all these things you listed would just make it more
complicated for no good reason. I'm all for sticking to best practises but in
that case it'd make no sense. This is supposed to be deployed easily on shared
web hosts, installing dependencies wouldn't work there.

~~~
zapt02
Well it could be 5 lines of code. To edit the output you would have to fork
the project for no good reason. Templating exists so you don't have to do
stuff like that. Regarding dependencies, you can provide a pre-built zip
archive with the dependencies installed already. Then it's just a matter of
uploading the folder.

------
hpaavola
[https://github.com/Harri/Spage](https://github.com/Harri/Spage)

It has search, sitemap, comments and moderation etc. but still just a static
site generator.

------
krat0sprakhar
I have nothing against PHP but it would be great if this is built in a
language like Go so that anyone can download a static binary without any
dependencies.

Kudos for shipping!

~~~
primroot
How about [http://gohugo.io/](http://gohugo.io/) ?

~~~
josephernest
Looks nice but when I click "Install" on home page of gohugo.io, I see: "brew
install hugo". Another tool that I don't know: "brew", and that I probably
cannot install on my shared hosting server.

The point of Void is minimalism: apache+php, nothing else required. < 100
lines of code in a single php file (+ the markdown parser lib of course).

~~~
frio
Immediately above that it has a big button that says "Download", which takes
you here
([https://github.com/spf13/hugo/releases](https://github.com/spf13/hugo/releases)).
Above the `brew install hugo` part, it asks "Using Homebrew?", implying that
option is for people already using that tool.

I definitely agree that less complexity is better, but I think levelling that
complaint against (this part of) Hugo is unfair.

------
tarball
Similar project, ideal for image-based paginated content:
[https://github.com/lisezmoi/lightbulb](https://github.com/lisezmoi/lightbulb)
Demo: [http://catgifpage.com/](http://catgifpage.com/)

------
weeksie
How does this compare to something like Jekyll?

~~~
hobarrera
I had the same question.

The answer is awfully:

1) I don't see how it generates static websites. It generates pages on-demand:
[http://thisisvoid.org/article/05-perf](http://thisisvoid.org/article/05-perf).

2) The documentation is a tribute to it's name: null.

3) PHP (AFAIK) doesn't do nice URLs like "/articles/article-7", so my guess is
that there's some additional configuration done to the web server. Ugly
(compared to Jekyll's stupid-simple solution to this).

4) You seem to need to fork it in order to use it (rather than being able to
install it and use it as you would any other tool).

~~~
josephernest
I think you miss the point.

You compare :

* Jekyll which is a great tool, with lots of features, but which has at least 50 files & probably 1000s of line of code. It's great but I wouldn't be able to understand 100% of how it works in 2 hours. Impossible. Moreover I cannot install gem (and probably not Jekyll) on my shared hosting. Huh...

* _Void_ , my toy-website-creation-tool (yes, I have no problem with that: it's a toy tool): you can understand 100% of how it works by reading less than 100 lines. Nothing more. You can install it on a shared hosting, only requirement: Apache + PHP.

Yes, you need to open and hack the PHP file of Void to customize. What's the
problem with that? It's done on purpose.

Is it mandatory nowadays to use many tools like Brew, Composer, Gem, Symfony,
etc. to set up a simple website? (I mixed random names that are required in
lots of CMS/static generators I found).

My answer is no: you can do something simple with a "hack it yourself"
philosophy. And less of 100 lines of code.

~~~
hobarrera
> * Jekyll which is a great tool, with lots of features, but which has at
> least 50 files & probably 1000s of line of code. It's great but I wouldn't
> be able to understand 100% of how it works in 2 hours.

Do you _need_ to understand the internals of every tool you use? Do you know
how the PHP interpreter works, the kernel, etc?

> Moreover I cannot install gem (and probably not Jekyll) on my shared
> hosting. Huh...

Why would you install a development tool on the server? Do you install gcc on
servers too? That makes no sense at all.

> You can install it on a shared hosting, only requirement: Apache + PHP.

This pretty much reinforces my point: it does not generate static pages, and
actually generates them on request-time.

> My answer is no: you can do something simple with a "hack it yourself"
> philosophy. And less of 100 lines of code.

Indeed, you can do that. You can also hack your own. gp's question was how
this compared to Jekyll, and that's what I answered.

~~~
josephernest
> Do you need to understand the internals of every tool you use?

If possible, I like to understand. For Wordpress, I can't (too big). For
simple projects, I can and I enjoy it!

> Why would you install a development tool on the server? Do you install gcc
> on servers too?

At the moment of my last comment, I didn't know at all how Jekyll works, and
knew nothing, zero, about Ruby. Never used in my life. Thus my comment. I had
a quick look, in the meantime.

> it does not generate static pages, and actually generates them on request-
> time.

Exactly. Like a CMS, like a blog, like a Wordpress. I _never_ said my tool
generates static HTML that should be uploaded to server after each new
article. I don't want this by the way. (True that some people thought it was a
static generator. My bad, because few documentation yet (currently writing
it...))

> gp's question was how this compared to Jekyll, and that's what I answered.

Sure, no problem. I just don't understand why the _awfully_ in your comment.
The point of this tool is not to be a static generator. I never said that. Why
is it "awful" to just drop .txt files into the server, and let the server and
PHP generate content on request-time?

------
dheera
Interesting. I built something almost identical except used JSON for the
parameters at the top, used plain old HTML for the content and did all the
beautifying with CSS, and powered it with Python+Flask instead of PHP.

------
noir_lord
I did something very similar a while back except in python more as a PoC but
ended up using it -
[http://benlowery.co.uk/blog/statomatic.html](http://benlowery.co.uk/blog/statomatic.html)

Mine supports arbitrarily nested pages, customisable templates, metadata in
YAML at the top of the file and automatic ToC etc.

Largely thanks to the insanely good PyMarkdown library.

~~~
josephernest
Waw, looks great too!

~~~
noir_lord
Thanks, for a really quick hack it's come in surprisingly useful particularly
for generating documentation and quick internal sites.

------
benburwell
Looks a lot like this little thing I made a few years ago:
[https://github.com/benburwell/MDEngine](https://github.com/benburwell/MDEngine)

------
hellbanner
Related - anyone have the link to "the last anonymous hosting service"? If you
send him a dollar & a un/pw he would set it up for you. I think "void" was in
the URL, too.

------
ebbv
C'mon man you hard coded the copyright date? date('Y') is pretty easy. ;)

~~~
ahunt09
If the OP is claiming copyright they only need to claim the year of original
publication. Technically, not even that. To print the copyright as the current
year doesn't make sense. Unless: \- The copyright is on specific content, made
in the year indicated. \- The content is substantially revised (should just
add a year, not replace it.).

For the entire website as an entity, 2015 is fine as the copyright notice and
original date of publication.

That's my understanding anyway. Not legal advice.

------
valvar
Wow, this is great! I'm switching my WP blog to this immediately.

~~~
josephernest
Share the URL then! :)

~~~
valvar
Oh, it's controversial, somewhat edgy, political nonsense, but I might end up
using this for some other project as well, and then I'll certainly share the
URL :)

------
sparaker
No demo, no screens? Atleast have the courtesy to display your work properly.

~~~
josephernest
No demo? It's in the middle of the page
[http://thisisvoid.org/](http://thisisvoid.org/) : "Download it now, __see the
demo__ website, or browse the code"

------
bikamonki
Yessss! Except I get heartburn when I eat PHP :) Maybe I can port the 100 LOC
to JS and try a node version! Code flavor aside, your logic is right on point:
for 99,99% sites out there* a CMS like WP is like using an 18-wheeler to go do
grocery! Why did that happen? My only explanation is that The Home Depot is
behind this whole DYI website non-sense...

* Yeah, I made that stat up.

~~~
dheera
As much as I too hate PHP is as a programming language, I'd say it's fine for
this though, where it's being used effectively as a more powerful version of
server-side includes.

Python/Ruby/Java/node are all awesome to develop on at first (and have
excellent development servers) but all PITAs to production-deploy thanks to
poor documentation/tutorials, lack of any kind of project cooperation from the
major production HTTP servers, and lack of shared hosting services that have
built infrastructure to support these.

PHP is easy to production deploy. Drop .php files into /var/www/html. This is
unfortunately what keeps PHP going, because newbies like the simplicity of
deployment.

~~~
vdaniuk
>Python/Ruby/Java/node ... all PITAs to production-deploy thanks to poor
documentation/tutorials

I don't get it. I am not a professional programmer or devops and I was able to
deploy multiple servers for ruby(rails on webrick, puma and unicorn) and node
apps without any significant problems. Over time, I used do/linode prebuilt
images, stock ubuntu server, docker containers with and without nginx and did
not spend much time or effort in any configuration.

There are multiple easy "git push" heroku-like paas alternatives, docker is
available on most popular iaas platforms.

Can you elaborate what exactly cooperation from http servers do you need to
deploy ruby/python?

~~~
jerrac
We're deploying several tomcat apps at work. Each of them have to have apache
in front to proxy from 80/443 to 8080/8443\. We tried to get jcvs(or whatever
it's called) working, and it did not work. Thus, deploying java apps is a
pain. Seriously, do they expect me to ask my users to add the port number to
the url?

We love GitLab at work as well. But a few years ago it was real pain to set
up. Mainly due to having to figure out how to get the correct Ruby version
installed. GitLab fixed this issue with documentation describing exactly what
version to compile, and how to compile it. The fact remains, though, that I'm
not using Ruby from the distro repos, and thus, if a major security issue
arises, I won't get automatic updates. If it was more than one server, I'd not
be happy...

I once deployed a python app. Then tried to deploy it again, and could not
figure out what the heck I did the first time. I still have no idea how to do
so. And I never did find a decent tutorial on the subject.

So, ultimately, I prefer PHP. You install mod_php, php, configure your vhost,
and drop your files in the correct directory. Done.

As for how experienced I am, I run 50+ vmware vm's, most of which run
different applications than the others. Thus, I've had to deploy many
different applications over the years. PHP apps are always the easiest.

~~~
vdaniuk
Okay, I don't know much about Java, its vast and sparsely connected ecosystem
scares me and I am not going that way yet.

But how "install mod_php, php, configure your vhost, and drop your files in
the correct directory" is easier than "sudo apt-get install node, drop files
in the correct directory, run node app.js"?

Your example requires two distinct entities written in different languages
using differerent config formats: apache server and php code to run.

Node requires node runtime that doesn't have to be configured and a node app.

Also if you are not ok with configuring apache to forward ports, why ios it ok
to configure your vhosts?

PHP apps may be the easiest but deploying single server php apps it is
insignificantly easier than deploying single server javascript apps.

~~~
lmz
The vhost does not _really_ need to be configured if you have just one of
them. I'm sure the default apache config handles that just fine (listening on
any address port 80). Also for "run node app.js" don't forget "add a script
that runs 'node app.js' at server startup".

