News for hackers. Stuff that matters.
Re:Building a blog from scratch in 2022 using Hugo, Docker a... by nicbou on Friday March 18, 2022 @04:49AM (#30719914)
I don’t understand the hatred for classic content management systems. Every time I see those static blog posts, they’re for barebones blogs with a dozen posts.

These things fall flat when you need to regularly update the content. Then a proper editor feels nice. Formatting text and uploading images doesn’t break your workflow.

It also lets you have more metadata without resorting to a weird data format. The guides on my website have sources, glossary entries, categories, images and widgets. Describing that as text would be awkward.

Besides, you can just log in and change something. There’s no need to fire up a terminal, type commands or deploy changes. Just click save, from any computer with a web browser.

Re:Building a blog from scratch in 2022 using Hugo, Docker a... by enriquto on Friday March 18, 2022 @05:30AM (#30720106)
> Then a proper editor feels nice.

A proper editor for whom? What "proper" means is different to everybody. I already have and use a perfectly proper editor, and don't want to be forced to use another one just to write a few posts somewhere.

> Besides, you can just log in and change something. There’s no need to fire up a terminal,

Alright, but please recognize that this is a subjective point of view. My subjective point of view is the opposite: I'm already on the terminal, and I can just edit some files in there to update a post. There's no need to fire up a web browser, log-in using an ad-hoc login interface, and then use and ad-hoc editor.

Re:Building a blog from scratch in 2022 using Hugo, Docker a... by colesantiago on Friday March 18, 2022 @07:26AM (#30720805)
Of course this point of view is with common developers, so I understand that view.

People who are content editors in newspapers, magazines, etc. would highly likely use Wordpress, Ghost or even Substack.

In the end, use whatever you're comfortable with, I always go with, "can I extend this" or "will this save me time?" and Wordpress/Ghost almost always gets chosen.

Re:Building a blog from scratch in 2022 using Hugo, Docker a... by actually_a_dog on Friday March 18, 2022 @05:35AM (#30720133)
Indeed, emacs and vim are very “proper editors” in this context, which is where having your posts stored as flat files, as is done in most static site blogs, really shines.
Re:Building a blog from scratch in 2022 using Hugo, Docker a... by copperx on Friday March 18, 2022 @12:31PM (#30724312)
You can also, say, install a plugin to fire emacs to edit a textarea.
Re:Building a blog from scratch in 2022 using Hugo, Docker a... by WorldMaker on Friday March 18, 2022 @04:52PM (#30727365)
Plus these days on Github (and Azure Repos) you can press . and open the entire repo in VS Code (github.dev/vscode.dev) in your browser.
Re:Building a blog from scratch in 2022 using Hugo, Docker a... by enriquto on Friday March 18, 2022 @05:39PM (#30727885)
Or, the other way round, use a terminal-based browser so that you don't need to interrupt your workflow!
Re:Building a blog from scratch in 2022 using Hugo, Docker a... by nicbou on Saturday March 19, 2022 @10:10AM (#30733825)
> please recognize that this is a subjective point of view

Yes. This is what we're discussing.

Re:Building a blog from scratch in 2022 using Hugo, Docker a... by sandreas on Friday March 18, 2022 @06:30AM (#30720444)
I understand what you are saying... and you are right for most of it. You have to change your mindset a bit to use a static site generator. But you should keep in mind that "classic content management systems" have some major disadvantages, that are real:

- security - a static site tends to have less vulnerabilities and security issues

- performance - there is nothing faster than a static site, if the webserver is configured properly

- maintainability - a static site has no database and is easy to version control, backup/restore and manage

> Then a proper editor feels nice.

And there is no one that prevents you from setting up "content management" for a static site generator... I tend to use my JetBrains IDE, but there is also Typora or MarkText for editing my files.

> It also lets you have more metadata without resorting to a weird data format.

Hugo supports external data files, and with little effort, even static site search. See https://pilabor.com/blog/2021/05/building-a-blog-with-hugo/#....

> Besides, you can just log in and change something.

You can use github actions for deployment, then you can just use github editor to change something.

Just my 2 cents. Maybe try it for a smaller site... it's awesome.

Re:Building a blog from scratch in 2022 using Hugo, Docker a... by naet on Friday March 18, 2022 @09:57AM (#30722303)
Static site generator isn't the opposite of CMS.

I have made tons of headless CMS powered static generated sites. And I've made personal mark up powered sites. The markup is fun if you are the only person who will ever work on it, otherwise I recommend hooking up a proper content editable site.

Re:Building a blog from scratch in 2022 using Hugo, Docker a... by 3np on Friday March 18, 2022 @04:57AM (#30719941)
It depends on your workflow and preferences, I guess.

From the other side:

You can just update it straight from you terminal in your preferred text editor and push the changes. There's no need to open up a web browser, log in, and navigate through a web UI or clunky WYSIWYG interface.

But yeah, whatever floats your boat.

Re:Building a blog from scratch in 2022 using Hugo, Docker a... by noirscape on Friday March 18, 2022 @06:44AM (#30720529)
It depends (as with everything) on your goal and purpose.

Static sites have their uses (and there's a surprising amount of people who do run more complex blogs as static sites, me included), but they're a very different design goal.

The main thing that makes most traditional CMS systems nearly unworkable for me is the combination of a data lock-in and the inevitable mess that content + widgets ends up becoming in the database. I'm sure everyone has their own horror story with the Wordpress site that has 20 plugins and one decided it stopped playing nicely with the APIs and now you're untangling a mess set up by a secretary 3 years ago who didn't leave any notes (theoretic example).

Static sites are at least good at that; you can separate the core content of your site (blogposts/images/pages) from the layout and visual logic. Personally I've swapped between three different static site generators for my blog over the past 7 years (usually because another offered better functionality or just had a cooler CSS theme I wanted) and the process usually didn't take more than an hour or two.

Meanwhile, Wordpress took me several days to upgrade to a new version because a bunch of older extensions needed manual hacks to keep working.

On another degree, since I self-host my blog, it's quite nice to not have to bother with a webserver besides Nginx. Running any sort of webapp is a joy for security (and server usage), while just serving HTML/CSS/JS from a folder is something webservers are already pretty good at doing quickly with not that much of a load.

That said, there's a bunch of advantages with CMS systems too; accessibility being the big one. These are systems designed to make it easy to put up a new blogpost while not having to worry about layout and styling, and that makes them very accessible to the layman.

Re:Building a blog from scratch in 2022 using Hugo, Docker a... by stavros on Friday March 18, 2022 @04:54AM (#30719931)
Because the complete lack of maintenance alone more than makes up for the lack of a login to change content for me. Not to mention I still have an editor and can log in to it to change content, it just commits to git instead of using a complicated backend.
Re:Building a blog from scratch in 2022 using Hugo, Docker a... by dvdkon on Friday March 18, 2022 @05:33AM (#30720121)
Most static site generators are much easier to customise than common GUI CMSs. I use nanoc, which is basically a build system with some website-oriented builtins. I wrote a snippet that replaces images with responsive ones with srcset. Sure, there's probably a Wordpress plugin for that, but it's not 50 LOC.
Re:Building a blog from scratch in 2022 using Hugo, Docker a... by WorldMaker on Friday March 18, 2022 @04:48PM (#30727329)
> Besides, you can just log in and change something. There’s no need to fire up a terminal, type commands or deploy changes. Just click save, from any computer with a web browser.

Github has supported creating PRs directly in the browser for years now. It's a pretty good editor with support for Markdown previewing and such. Depending on your needs, Github itself has been a "proper editor" for SSGs for a long time now. Now that Github Actions exists and you aren't restricted to only Jekyll as your SSG for auto-builds on PR merges, it is even better than before. (Drag and drop for things like images into PRs on the web has also worked to various extents in the Github web UI for some time.)

With github.dev (and the . shortcut) you can even create a PR in VS Code on any computer with a web browser if you want even better Markdown previewing with VS Code extensions and Settings Sync. (Even things like uploading new photos, you can drag and drop into VS Code on github.dev! Some of the domain specific data editors for your CMS needs you could potentially build custom YAML or JSON editors as VS Code extensions.)

I don't think there is necessarily a "hatred" for classic content management systems, but the tools have "converged" somewhat. Github is a reasonably good CMS with powerful web editing tools (especially github.dev) at this point, but more importantly the "version management" tool for the "Github CMS" is git so you know that you'll have strong auditing of content changes over time and also content reviews (code reviews, PRs) and things like that which other CMS tools do to various extents, but git was built to do specifically.

Re:Building a blog from scratch in 2022 using Hugo, Docker a... by shantnutiwari on Friday March 18, 2022 @06:10AM (#30720327)
yeah, same here. After trying a dozen of these "simple" static hosting tools, I always go back to Wordpress , and recently, Ghost.

The problem with static tools os, they are only simple if you write 5-6 blogs (in total). Once you start writing more often, the lack of a good editor, styling becomes painful.

You can bash Wordpress all you want, its still the best way if you just want to focus on content without jumping thru a lot of hoops.

Re:Building a blog from scratch in 2022 using Hugo, Docker a... by nickjj on Friday March 18, 2022 @08:06AM (#30721123)
This depends on what you're used to.

My personal blog has almost 400 posts[0] and I'm using Jekyll (another static site generator). I find writing in my code editor to be the path of least resistance. It lets me quickly write drafts as I'm working without breaking my flow and writing Markdown feels good. Jekyll supports live reloading too so after I save a post the browser auto-reloads with the new content in about 2 seconds.

[0]: https://nickjanetakis.com/blog/

Re:Building a blog from scratch in 2022 using Hugo, Docker a... by jefftk on Friday March 18, 2022 @08:30AM (#30721323)
> Every time I see those static blog posts, they’re for barebones blogs with a dozen posts.

I think that's often because people are most excited about writing about their blogging software when they have just built it. But there are a lot of bloggers (ex: me) using static site generation who've been doing it for years and have hundreds of posts.

Re:Building a blog from scratch in 2022 using Hugo, Docker a... by globular-toast on Friday March 18, 2022 @05:50AM (#30720222)
> Then a proper editor feels nice.

That's why I prefer static sites. A proper editor is emacs, not some custom text box in a browser.

> There’s no need to fire up a terminal, type commands or deploy changes.

If you set up a CI pipeline then deploying changes is as simple as making a commit and pushing it. I don't fire up a terminal or type commands to make changes.

Re:Building a blog from scratch in 2022 using Hugo, Docker a... by copperx on Friday March 18, 2022 @12:37PM (#30724387)
You can install a plugin that fires up emacs to edit such a text box. Easy fix.
Re:Building a blog from scratch in 2022 using Hugo, Docker a... by radiKal07 on Friday March 18, 2022 @09:17AM (#30721818)
Beware, I will shamelessly plug my product here but this is exactly the problem I am solving with my tool. Why not have the best of both worlds? The easy-of-use of a CMS and the speed of a static blog. This is exactly what I do with https://panakit.com
Re:Building a blog from scratch in 2022 using Hugo, Docker a... by Mikeb85 on Friday March 18, 2022 @06:39AM (#30720501)
I mean, a CMS adds complexity and hosting costs when enough people just want to get those dozen blog posts out there and don't care about the rest. Not like people don't know about stuff like WP.
Re:Building a blog from scratch in 2022 using Hugo, Docker a... by AlchemistCamp on Friday March 18, 2022 @10:32AM (#30722757)
I hosted a WP blog for years. It hit the front page of Reddit multiple times and #1 once and it never cost more than $10/month. These days, the same blog could easily run on a $5/month VPS. You could also host a WP blog for free, using their hosted service.

Even as a non-programmer back then, I didn't find the complexity bad at all. It was certainly a lot less than what's involved with the OP's setup.

Re:Building a blog from scratch in 2022 using Hugo, Docker a... by marc_io on Friday March 18, 2022 @12:10PM (#30724014)
Not always true. Publii is an example of a CMS for static websites that does not require any server costs or complex configuration.
Re:Building a blog from scratch in 2022 using Hugo, Docker a... by michaelbrooks on Friday March 18, 2022 @06:03AM (#30720287)
I've gone from using WordPress to static sites and back again because I missed having all the features that WP offered. Even Ghost is simpler but still nicer than any static site I've created.
Re:Building a blog from scratch in 2022 using Hugo, Docker a... by sdoering on Friday March 18, 2022 @07:06AM (#30720661)
I went a similar route from WordPress to jekyll. Then to Kirby v2. I dabbled with grav CMS and now am back to Kirby v3.

I can chsmge stuff in the terminal with vim or via VSCode remotely over ssh. But I can just as easily login to the admin panel and do stuff there.

What I like about Kirby for client work is that I can adapt the admin panel so easily that I can adapt it to my clients' needs and workflows.

And there is no DB in the background I need to maintain.

So I feel it always depends on use case and personal preferences in the end.

Re:Building a blog from scratch in 2022 using Hugo, Docker a... by indigodaddy on Friday March 18, 2022 @01:22PM (#30724936)
$114/site though?
Re:Building a blog from scratch in 2022 using Hugo, Docker a... by sdoering on Friday March 18, 2022 @02:31PM (#30725808)
If I save on time with development (as I do) I come out net positive. And why shouldn't I pay for a great tool?

As said it is a question of what to value more. My time. Working with a great tool (imho) or saving a few bucks.

But everybody's mileage will inevitably vary.

Re:Building a blog from scratch in 2022 using Hugo, Docker a... by indigodaddy on Friday March 18, 2022 @04:42PM (#30727255)
Ok well said I buy your argument (so to speak:) )
Re:Building a blog from scratch in 2022 using Hugo, Docker a... by rozhok on Friday March 18, 2022 @02:56PM (#30726089)
As a regular blogger I can't agree with you more.

I've started with hugo and editing in IntelliJ but eventually switched to Ghost, when I needed to automatically cross-post my content to social media.

Zero regrets then.

Re:Building a blog from scratch in 2022 using Hugo, Docker a... by nvarsj on Friday March 18, 2022 @12:55PM (#30724595)
I have gone full circle, and back to managed wordpress.

I barely have enough time to just create content. I don't want to waste that time managing my blog deployment.

Re:Building a blog from scratch in 2022 using Hugo, Docker a... by 1337shadow on Friday March 18, 2022 @06:46AM (#30720535)
Why not get the best of both worlds with coldcms