6 ms·
Void – A website creation tool
- bikamonki 12y agoYessss! 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.
- josephernest 12y agoYes exactly :) I was fed up about using an 18-wheeler for each small project-website I had to set up ;) If you like stats in the same fashion as yours: http://www.thisisvoid.org/article/04 http://www.thisisvoid.org/article/04 ;)
- bikamonki 12y agoMy solution is called Statico: a json file with all the site content and front-end magic to display it. A locally run software allows me to edit the pages, upload images to S3 and update the json file. The additional advantage in my opinion: no server. All hosted on S3 :)
- dheera 12y agoAs 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.
- blumkvist 12y agoYou can deploy node on IIS.
- falcolas 12y agoTo be fair, if you're using a web server other than Apache, PHP involves an equal amount of pain.
- dheera 12y agoSure, but newbies don't care about "web servers other than Apache". They will just use Apache, or whatever can deliver instant gratification. And non-newbies, in general, don't use PHP to start new projects. Part of my point is that I think if we, the development community, want to popularize frameworks with better engineering design, e.g. RoR, Python+Django/Flask, and so on, we'll need to think more carefully about what the newbie experience is like. Because newbies look for instant gratification with something (anything!) and then build up and out from whatever that something is. If the easiest door to open is PHP, they'll keep building with PHP for years. Unfortunately, the easiest door to open is still PHP by a longshot.
- vdaniuk 12y agoAs someone who helps people to learn programming, I'd like to challenge your statement that PHP "is an easiest door to open.. by a long shot". The reality is that the easiest way for a beginner to do a finished product is a make as static HTML webpage with Javascript fetching dynamic data from a remote datastore/website. The cognitive load of request-response model from the client side view is much smaller than from a server side and you actually write your first code in any browser console.
- falcolas 12y agoThe problem with making things simple for newbies is the knock on effect of making it hard for non-newbies to do non-newbie things. Sure, we can then work around the allowances we make for newbies, but complexity is the bane of reliable software.
- 12y ago
- noir_lord 12y agoI 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 12y agoWaw, looks great too!
- noir_lord 12y agoThanks, for a really quick hack it's come in surprisingly useful particularly for generating documentation and quick internal sites.
- dheera 12y agoInteresting. 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.
- krat0sprakhar 12y agoI 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 12y agoHow about http://gohugo.io/ http://gohugo.io/ ?
- josephernest 12y agoLooks 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).
- krat0sprakhar 12y agoHugo is a static site generator much more fully featured than Void, so IMO its not fair to compare on LOC. As far as brew goes, that is just for convenience. You can might as well download the static binary from the releases page - https://github.com/spf13/hugo/releases https://github.com/spf13/hugo/releases
- frio 12y agoImmediately 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.
- epimetheus 12y agoI believe the CMS should build on your local machine and then be pushed to your hosting after it builds the static files. Like Jekyl. That's how I'm reading it, and brew references Homebrew, an OSX package manager.
- weeksie 12y agoHow does this compare to something like Jekyll?
- hobarrera 12y agoI 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 12y agoI 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.
- weeksie 12y agoYou only have to install Jekyll locally, it generates plain-jain html files. Thanks for the info on the differences. Congrats on making a neat tool, I was just legitimately curious as to how they would compare. Cheers!
- valvar 12y agoWow, this is great! I'm switching my WP blog to this immediately.
- josephernest 12y agoShare the URL then! :)
- valvar 12y agoOh, 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 :)
- deleted 12y ago[deleted]
- hpaavola 12y agohttps://github.com/Harri/Spage https://github.com/Harri/Spage It has search, sitemap, comments and moderation etc. but still just a static site generator.
- pearjuice 12y agoHaving 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!"
- pierrec 12y ago"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/
- zapt02 12y agoI 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 12y agoOne 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 12y agoWell 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.
- deleted 12y ago[deleted]
- josephernest 12y agoHere is a discussion exactly about "Why mixing templates and logic is not necessarily bad": http://www.thisisvoid.org/article/03 http://www.thisisvoid.org/article/03 I have a math research background: if you can prove something in 2 pages with no extra tool, it's far better than doing the same by invoking a big difficult Theorem. Moreover, I am not a profesionnal developer. And for me, installing Apache+PHP is enough. I don't want to add more tools, more layers. The list could be endless: Let's use Symfony, Composer, Brew (random name here, I don't know what is Brew)... and at the end I'll have a big big thing... I really want to keep it simple... Each new layer is like "minus 10 points" for my project ;)
- benburwell 12y agoLooks a lot like this little thing I made a few years ago: https://github.com/benburwell/MDEngine https://github.com/benburwell/MDEngine
- ebbv 12y agoC'mon man you hard coded the copyright date? date('Y') is pretty easy. ;)
- josephernest 12y agoThanks :) I fixed this mistake: https://github.com/josephernest/void/commit/43623c00c1c7264ea3749bd65536fe59d8253aca https://github.com/josephernest/void/commit/43623c00c1c7264e...
- ahunt09 12y agoIf 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.
- sparaker 12y agoNo demo, no screens? Atleast have the courtesy to display your work properly.
- josephernest 12y agoNo 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"
- hellbanner 12y agoRelated - 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.
- tarball 12y agoSimilar project, ideal for image-based paginated content: https://github.com/lisezmoi/lightbulb https://github.com/lisezmoi/lightbulb Demo: http://catgifpage.com/ http://catgifpage.com/