Moved to Hugo + Small Script

Hello all. I’d like to just say that I was extremely happy when I found Hugo. I had used Jekyll in the past but stopped using it because (I hate ruby).

So, I migrated my site and, originally, the same template I used with my old set of awk scripts that I handled the site with, in about a day, mainly just finding the functionality I need. I managed to get a recursive menu up and running pretty quickly which matched the functionality I had used before in about a half hour. Overall, a relatively pain-free process, considering the process I went through migrating a sqlite database and twig with PHP to Jekyll a couple of years ago… Afterwards, I was poring through templates and saw the slim theme, which I kept in the back of mind when writing the current one.

Here’s the link https://www.spudstalker.ninja/. It’s nothing really special, just a personal site, but I do plan on using the blogging features in the future.

Also, here’s a small awk script I’ve been using to tidy the output, because I didn’t feel like poring through my templates explicitly controlling white space, and indenting partials and content correctly to match up. It obviously depends on HTML Tidy, but I think it does a good job. Only problem is it wants to place its generator tag above Hugo’s (:slight_smile:), which might annoy somebody with more OCD than me.

 #!/bin/awk -f
BEGIN{
	hugocmd="rm -rf public && hugo";
	while((hugocmd | getline hugo)>0){
		print hugo;
	}
	close(hugocmd);
	globcmd="find public";
	tidycount=0;
	while((globcmd | getline glob)>0){
		if(glob ~ /.*\.html/){
			system("cp " glob " tmp.html && cat tmp.html | tidy " \
			"--quiet yes --indent auto --wrap 80" \
			" --quote-ampersand no --preserve-entities yes " \
			"--input-encoding utf8 --output-encoding utf8 " \
			"--output-file " glob " && rm tmp.html");
			tidycount++
		}
	}
	close(globcmd);
	print "\nTidy tidied " tidycount " documents.\n";
}

Place in hugo folder. Also note: it won’t ignore any files from the ./static/ folder (which you might not want to tidy).

Anyway, thanks again for the great project!

EDIT: spelling.

1 Like

Nice minimal site and nice script :slight_smile:

1 Like