I would recommend poking around with 11ty,[0] which I find to be significantly simpler than Hugo.
The Go templating of Hugo is extremely confusing for most non-Go people. After using it for years I still constantly look up how to do simple conditionals.
11ty is a very competent, "good enough" generator. We used it to build this site[1] for CERN back in 2019 from scratch over the course of a few days.
Yes, Go templating is quite hard. There was a feature request[1] to implement the Django/Jinja2-like Pongo2 template engine[2], but got rejected because it would have been a too big change.
Templates are the ugliest part of Django. They are completely unaware of the target syntax, so very often the template itself cannot be validated as HTML, which makes it difficult to lint or reformat.
The only tool I'm aware of that can (mostly) correctly reformat Django templates is the PyCharm/IntelliJ family of IDEs, but their reformatting often introduces subtle breakage (such as adding new lines inside tag attributes) and requires careful review.
Thanks, and nice job on the build :) I came across 11ty today. Looked interesting. But, the moment I see code blocks my brain shuts down. I try to stick it out, but it's difficult. Trying tho!
You don’t need to code to get started with Hugo. You just copy some template files around, write your pages using any text editor in the very simple markdown format, run Hugo in the command line, and get html files ready to upload. None of this is actually “code”.
I'm ridiculously noob with all this. Trying to teach myself. I don't even know what a "command line"is. It's a wonder that I keep up with anything at all on here!(though I'm trying).
That’s exactly the question I would search in google to get started. Then when another question pop up in my mind, I would also google it. Keep doing that until you start building a better mental model & before you know it, You are reading tutorials & getting started.
I was teaching myself about Git today, and it's hilarious the Google threads I develop. "Git is a Distributed Concurrent Versions System." OK what's a "Distributed Concurrent Versions System"? Hmmm OK what's a "Concurrent Versions System?" hmm OK what's a "Version system?" googling is helpful af, but at some point I need a human interaction for real time questions. Slowly but surely.
Command line is the black and white (usually) "hacker view" that you see in movies. All OSs have one easily accessible (even windows).
Think of it as a text-only way of moving around and looking at directories/folders inside your computer - you start off in some directory and can move to other ones. In side each directory you can do really basic things like just list the files there, or rename them or move them etc. Just like you can in the GUI.
Where the command line gets powerful is that as well as manipulating files you can run arbitrary "commands" - i.e. you can run programs like you can by double-clicking an icon - AND you can start to do smart stuff like sending the output of one command as the input to another.
So you can do things like sort all of the lines in a text file in alphabetical order, remove duplicates, then count the number of lines with the command line in a couple of seconds, where as in the GUI you'd probably end up pasting the text file into a spreadsheet or something I guess.
Look for "terminal" or "CMD" in Linux/osx or Windows and have a poke around by moving through directories and listing files etc, checking against the GUI as you go. Eventually you'll get an intuition for using it.
Thanks so much. I've been thinking that Terminal on my Mac was gonna play a role in all this learning somehow. Maybe my next step will be to find some tutorials on how it works and for what purpose. Thanks for the Kickstart.
https://ashleynolan.co.uk/blog/getting-started-with-terminal has some very basic stuff for mac terminal (n.b. these are also largely identical to linux too, so bonus!). No relation to the site, just found it from googling and looks to cover off the essentials.
That will get you started getting comfortable moving around and doing things, but it doesn't go further than the absolute minimum. It will at least get you started and hopefully slightly comfortable if you need to use the terminal for anything else in the future as that is where the real learning comes from. E.g. following a tutorial and they say "type this in the command line" you are now at least a little familiar with it and can google the rest.
The Missing Semester of CS education by MIT ( https://missing.csail.mit.edu/ ) has a lot of great materials and videos to get started with basics of command line, shell, and git.
Follow this extremely simple guide & project for a basic free ssg site. I use plain html & Jekyll, two different ones. I have no experience except simple html, css, js & markdown.
The complexity of of static site generator isn't always needed or useful.
If you just want a simple site with a handful of posts a year then manually making .html files with an WYSIWYG editor or just copying old HTML/CSS templates from site likes "alistapart" is a legitimate, simple option. Installing nginx from your system repos is safe and easy too but if you don't want to self host then https://neocities.org/ is decent.
I write a lot! Have used Wordpress for almost a decade and a half. But, am trying to teach myself other ways of doing it all. It gets confusing for me very quickly. Though, I'm trying to teach myself.
You might try going back to basics. First write some pages in plain HTML using a text editor to get a feel for how tags work. Then add some styling using CSS and play around with that. That’s about all I know how to do, but I’m able to maintain a personal website that meets my needs. Since the site has no dependencies, it will presumably be readable for decades to come. And it is extremely light (not that it gets many visitors!).
Thanks for the advice. I have a bit of html and css experience, but mostly from when I tried to customize WordPress over the years. So, I'm bmhetting better at recognizing what's what in the code (is that code?), but I get really tripped up with the "but where is it?" and "how does it get from my text doc or markdown out there online?"
I’ve taught several non-technical people how to use Hugo and many of them still use it to this day on their own. It’s totally achievable after you understand just a few key concepts and pick a well-formed template to start with. And yes, Hugo is your best bet to keep things easy.
Those key concepts are what I'm after. In every vid or article I'm learning from inevitably there's a point where I can see they pivot and lose me, and it's because I'm missing a key perspective or concept. I've yet to figure out what that actually is, which makes it hard to ask for advice! Cuz I don't have the question.
Yeah it’s hard when you don’t know what you don’t know. Your best bet is to go one on one with someone who understands you’re starting from zero. Catching someone who understands that will make a huge difference. Tech in general is absolutely amazing at continually making assumptions in instructions and documentation and it irritates me to no end. A couple hours one on one with a good teacher will crack the case quickly.
This has been my feeling all along. I think in every post I make I need to add that at the end (I'm starting from zero). Bc, understandably, people assume I know more than I do. And, yes. I need to find someone to give me a couple hours to help crack it open so I can better know what I don't know.
I haven't been able to figure it how to implement my Jekyll use case in Hugo, maybe you or someone else would be able to help me.
I don't want to use a theme at all because I don't really use it for making posts, but just a website with different pages. I have a page template that pulls in my head, nav, page content, and footer.
Yeah, Jekyll and Hugo treat pages differently. It does depend on what your intended URL format is going to be when building out your layouts. I’m on mobile so I can’t get into detail now how they differ, but you can’t drop Jekyll templates into Hugo and get them to work like that. I would actually download and study some free Hugo templates to learn by example how they treat pages.
This tripped me up when I switched too, but for me it was worth it to move away from Jekyll.
[edit] I just want to add - pay attention to the content “type” in relation to creating a template and specifying the type in the frontmatter. https://gohugo.io/content-management/organization/#type may point you in the right direction. You can manifest your own type by creating a template in the correct layouts dir and then specifying that type in your frontmatter.
Do not use Hugo for this kind of setup. It's horrendously complicated and it was probably never meant to be used like this. Hugo might be good for a blog, but even a simple personal static site where you want to have different templates for each page is only achievable by jumping so many hoops.
This is my use-case (very simple, fully static site- not blog), and I'd love a tool to generate it from markdown. Do you happen to have a recommendation of a simpler tool for that?
I worked with middleman[0] before and it was much easier to setup for these kind of sites. It might not be as fast as Hugo but who cares if you change a page every other month.
How do you go about teaching people that are outright hostile to the command line and anything that resembles code?
Currently dealing with a snobbish painter/graphic designer who has used Microsoft Frontpage and Adobe Muse for over 20 years and just wants their GUI WYSIWYG back.
Context. I might try something like “Frontpage is to MS Paint as writing code is to Adobe Illustrator. I’m not trying to teach you a child’s toy so you need to stick it out long enough to gain some perspective on this.” I’ve had success convincing people that the terminal isn’t “for hackers” by showing them the command line is really where everything happens like double clicking an icon is the same as running `open ~/Applications/Adobe/Creative \Cloud/Photoshop.app` and other normal operations performed with commands. It also helps to differentiate between things we’re doing just to operate/navigate vs. steps taken in the actual writing of code/building something. You can tell how much they understand by how literal they follow directions. I usually start with a whole lesson on using the command line so when we get to the actual meat of building they’ve seen many of the common commands before. It also helps if they’re on the clock and getting paid to learn vs. trying to pick a new skill on nights and weekends.
So, in light of this (great feedback), for someone like me who's primary motivation is to increase my computer literacy so I can make better and more informed choices on how I post/interact/hang out on the web, would you recommend that I start with what you're discussing: the command line?
My thinking: if I understood basic concepts and philosophy of coding and how the "the web works," I'd be able to build build myself a simple blog, simple website, but also be less beholden to Zuck and Google platforms. Obvs I'd still be using some of it, but I'd just have more choices.
Knowing how to use the command line will not automatically elevate your command of computers in and of itself. Operating your machine at a lower level by way of the command line will over time help you to gain more computing knowledge more as a side effect. There will come times where you will get stuck trying to use a command or series of commands or scripting something for automation and you will hit a wall - this is where you will discover the secret of all power users; knowing how to solve a problem. (Almost) no one here is a great programmer because they memorized an entire language or framework or OS. We’re great programmers because we know how to find information about our issue and apply that knowledge to come up with a solution. You make a mistake or come across something you’ve never seen before, you research and figure it out, your new knowledge helps you to not make that same mistake again and this just keeps repeating. All of computing knowledge is additive; low-level concepts and tools are the foundations for all layers of abstraction above them. So learning how to use a computer at a lower level will give you a proper base for understanding higher concepts and you’ll learn useful meta information along the way. Certainly everyone learns differently, but I would recommend diving into the command line if you want to do any sort of programming or just be a power user.
Don’t try to make them love the terminal. They mostly won't, ever.
Just give them visual tools like Webflow, Blocs.app, Bootstrap Studio or even WordPress (now a complete visual page builder, from version 5.9 onwards).