Hacker News new | ask | show | jobs
by verusfossa 3804 days ago
The intimidating thing for me was always how heavy blogging software was. Never really liked the idea of centralized hosting, but hosting some huge PHP blob with a database never felt like it was worth it. I'm hosting my own site now running Hugo and I love it. I agree that most people have moved to centralized hosting, but I'm seeing a resurgence of self-hosting with static site generators like jekyll, middleman or hugo. Things like static search[1] and static comments[2] are possible with some thought. Really neat and lightweight and with gitolite, I can keep my git repo containing the blog code on the server too, setup commit hook to rebuild the site and I'm maintenence free. I have some npm postcss scripts that build my scss, autoprefix it, etc and dump it into the assets for hugo to build from all in one go.

A lot of this is unncessary, I could just be using css. I like that there's not all this asset-flow magic built out, just simple npm with bash cli. Unix philosophy and very little heavy lifting. I think there's still hope.

Now if we can just teach casual users git...

[0]https://gohugo.io/ [1]http://www.blevesearch.com/news/Site-Search/ [2]https://tlvince.com/static-commenting

6 comments

I use WordPress, a huge PHP blob with a database, for my self-hosted blog. I somewhat agree with the parent and sister comments in that, as a programmer, the way these things work irks me out.

However, I don't agree with the apparently widespread conclusion that it follows, from this sentiment, that not publishing is better than publishing using a less-than-lovely platform. I also don't agree with the widespread corollary, "build your own blog", when as a result you get less features than the irksome WP would give you (a common omission is support for comments - I got some amazing comments over the years, if you think it's not worth having this feature, I think I see where you're coming from, and I think you should reconsider.)

I treat blogging software as I treat any other - I dislike most programs that I run, but I often still choose to run them because the result is worth it. I can't see how "it's not worth" to run PHP+DB in order to be able to publish your thoughts. This is not to say that, given today's alternatives, WP or similar should be chosen over those alternatives, just that not using any of the available options because they're all too irksome feels over the top.

I use github pages for my blog, disqus for comments. Pages is just a convenient place to host - I have my entries in a git repo, the pages are statically generated with Jekyll, I'm sure I could run it myself if github started doing anything onerous. For comments it's just become too hard to self-host anything given how much spam there is, so I've given in and use disqus in the same way that I've stopped self-hosting email and use gmail.
It's pretty easy to hack a comment form so that there's no real heavyweight craptcha but on the other hand a bot will not know to fill it unless your site is specifically targeted. Security by obscurity. Works like a charm for me.
Have you ever had to change your form because a spammer added an exception for you?
>However, I don't agree with the apparently widespread conclusion that it follows, from this sentiment, that not publishing is better than publishing using a less-than-lovely platform.

After having had to deal with the aftermath of a hacked Wordpress site that was sending out massive amounts of spam, I would respectfully disagree. I consider Wordpress (and Wordpress plugins, especially) as essentially a security hole that allows malicious actors to gain free access to relatively powerful hardware on fat datacenter pipes, making the Internet worse for everyone around them.

By all means, publish. But don't publish using a platform that allows unauthorized users to misuse your hardware and turn it into a spam zombie/DDOS box/staging box for hacks, etc.

I see

"GET /wp-login.php HTTP/1.1"

about eight times a day on my lowest traffic sites. And I don't even have WP installed. (Or PHP.)

WP is a distributed botnet farm. I know people who have given up reseller hosting businesses because keeping customer WP installs clean was becoming a 24/7 job for them.

Unfortunately Hugo, Jekyll, etc are a poor substitute for WP, because they're much too difficult for non-coders to use. They're also a poor substitute economically - the WP template & plug-in market is huge.

It must surely be possible to build a blog engine that's secure, easy to use, and easy to customise?

> I don't agree with the apparently widespread conclusion [..] that not publishing is better than publishing using a less-than-lovely platform

And moreover, I don't agree that not communicating is better than communicating using a less-than-lovely platform... Static generators are fine for publishing but taking into account the requirements for blog-style bidirectional communication (comments, trackback, pingbacks etc.) excludes static sites unless one surrenders control to third parties such as Discus & al.

Wordpress is fine - as long as one carefully selects plugins and culls the unmaintained ones mercilessly.

I'm working on a little static site generator now for my own site. The PHP/SQL wordpress kind of option just annoys me and have held me back from publishing altogether (don't even get me started on publishing services and social media sites.

Well, stuff like hugo, nanoc, ikiwiki... inspirational!

My static site generator is using rake for file rules to do stuff with git hooks. It's going to depend on Ruby, but won't be a "Ruby framework". Rake might as well run php, perl, a bash script or a binary. Rake is just a wonderful tool for the job, and Ruby is about as ubiquitous as Perl these days.

Here's some inspiration: http://patshaughnessy.net/2015/1/8/using-rake-to-generate-a-...

Be sure to check out the "power rake" talk he mentions if you haven't already.

Edit: one more thought. On the idea of teaching casual users "git", I think that's an amazing idea. It touches on tip of an iceberg: computer/scientific/technological literacy gaps. If our technologies continue down the path of "black magic," with the ever extreme dichotomy of priests who know the secrets vs. ordinary/"dumb" people who are locked out of the inner knowledge, it's just not going to be conducive to a bright future.

Remember, regular people are dependent on technology, but have begun to develop superstitions about how it works. It's magic to people!

This is such a deep issue.

Neat project, good luck with it. I think I'll stick with Hugo, it's freaky-fast and postcss breaking CSS into an AST makes it really modular. Power moved from js into css which I'm okay with (and browsers are too).

As for git. The reason these blogs are so heavy is because editing text files for most people requires a text editor interface on the http which in turn means you need dynamic content whicn in tern means you need a database which in tern means you need a way to submit this code so php which in t... and down the rabbit hole goes. If you get rid of the "editing files requires a text editor" part, then your site is easy and maintainable.

Git I think is a bit more programmer-focused of an api for random blogger joe, but a light wrapper might work. Maybe something like emailing a server with subject "POST: title of blog post" body "text for post" and having the server grab that data from the email, if it came from an allowed user, throwing it into the posts/ folder, git committing it and then deploying it to an apache server on itself. Actions like "delete", "edit" would just search for files with the exact name as in the subject and do the required git action on it.

Something like this could probably work. Email clients already have the text editor users want, why rebuild the wheel? If there was someway to wrap this all up without requiring users actually host their own entire email, I think it would be nice. I think teaching your mom git is a pipe dream unfortunately even if it would fix the Copy-of-Copy-of-Birthday-List_OLD2.txt problem.

> Email clients already have the text editor users want, why rebuild the wheel?

I wouldn't put too much faith in email clients html output being sane, or consistent across clients.

You could do it with markdown, but then you're still having to teach them markdown.

That's true, and you're right. Just a shot in the dark. Maybe someday one of the trendier email clients will support markdown rendering natively in their editors.
Last I checked getting Ruby correctly installed was a mess. That was more than 2 years ago though.

Is there any way to install Ruby and required tooling correctly that comes anywhere near to installing JDK?

rbenv[1] makes installing and managing Ruby pretty damn straightforward, at least on *nix. Once you have Ruby itself up and running, installing any needed Gems is child's play.

[1] https://github.com/rbenv/rbenv

I'm seeing a resurgence of self-hosting with static site generators

I never stopped: http://www.daemonology.net/blog/

And that's why I like you.
I never did find a self-hosted blogging system that I liked, so I just made my own. Basically just githooks+php into a small, mostly html site. I wanted something simple and easy, and could be used from almost any browser (even lynx!)

IMO, lots of blogging platforms add completely unnecessary cruft. Some people may want it, and it definitely can be useful, but not for me.

Yeah, I did the same way. In the n-th iteration it's become quite the beast, and it's not static, but it does exactly what I want how I want it, and I would trade nothing I saw so far for it.
I've hit a roadblock from the other side of things: I have a PHP/Smarty app including a marketing site that would love some new content. But I don't want to go editing stylesheets etc for web site updates.

To make the process not depend on me, I'm considering wordpress.

Hugo and static site generators are nice, but need a developer.

There are quite a few themes out there already and growing rapidly. Adding a CSS theme is almost as easy as a wordpress theme. If you wanted a theme catered to your website, I would expect you'd have to get someone to style it up regardless.

The main two things Wordress has on static generated blogs at the moment are their current community and the editing experience. The editing is of course by design. I have heard that prose.io[0] is nice, but have never worked with it. Essentially webhooked github for cms-free blogs. To me, that seems like the way we should be going.

edit: add link, their site is mainly for access [0] https://github.com/prose/prose

Thank you. You're right that I'd need a developer in any case to first customise the theme, but then also to add customisations over time.

It's still holding us back, though, having a PHP app that a developer needs to edit, instead of allowing any of the team to add content to the site.

I tried to convert my WP to Hugo after seeing your comment, using the WP's export plugin (https://github.com/SchumacherFM/wordpress-to-hugo-exporter) but so far my biggest problem is that the link references that were created in the export process don't seem to work properly, for example:

    [Source][1]
    [1]: http://domain.org/dir/
doesn't get converted correctly...
I didn't have to do migration, but there are aliases[0] for those who do. Again, I haven't used it so I'm kind of recommending something I haven't touched, but maybe it'll help you out.

[0]https://gohugo.io/extras/aliases/