I’ve downloaded Hugo for Windows, and I’m deeply confused about what to do next. The install instructions refer to usr/local/bin. What OS is that for? It’s not a Windows path. (No OS is mentioned in the instructions.)
The package I downloaded basically consists of a single executable file called hugo_0.12_windows_amd64.exe. (I’m on Windows 8.1 64-bit.)
I haven’t found any instructions yet on what to do with that file, or how to invoke it. At first I thought it was an installer, but launching it just gives me a brief flash of a command line window. So I assume it’s analogous to python.exe – something that is invoked in command line operations. Should I rename it to hugo.exe? Will the hugo commands work when the file is named with the long string? Right now PowerShell doesn’t recognize “hugo” as a command.
I looked up Homebrew, but it appears to be Mac-only.
I would rename it to hugo.exe and put it somewhere on your PATH (either by copy it somewhere that is on the path, or put exe files like this in a dir like c:/tools/bin or something and put that directory on the path. Adding to the path should be found in control panel / environment or something).
Then you can open a cmd prompt (start -> run -> cmd)
Type “hugo help” and hit return
If your path is correct, you should get a list of commands. From then on you should be able to follow the rest of the guide.
Do not hesitate to ask.
I’m writing this on Linux, so the Windows steps above is from my memory.
Another question (let me know if I should start a new thread): I understand the Markdown to HTML transformation for posts and articles, but where does javascript go? I want to embed scientific charts and graphs, e.g. from Plotly or CanvasJS.
I’ve not heard of a way to embed code in Markdown. I know about embedding code snippets to display that code. But I want to embed code that will be executed. Does this reside in the templates instead of the .md files? I’m new to templates and am still learning that part.
One last thing: I’m having trouble understanding the architecture of Hugo and similar SSGs (e.g. Jekyll), particularly what happens on one’s own computer and what happens on the server. Is the building / compiling of the content happening locally or on the server? Is there any kind of application running on the server, or is it literally just a file tree of html, css, and js files?
As Michael says, you would have put to the Javascript includes in the templates (typically a partial that you include in others)
Hugo is a STATIC site generator, so what you get in /public when running Hugo is enough to copy to a web server (Hugo has a built in server, too, mostly for development, but that’s another story).
How exactly are the hugo releases built? It seems that we could make the artefacts created by the build process much easier to use by renaming and zipping them in a platform-idiomatic way. I opened https://github.com/spf13/hugo/issues/735 to see if we can find a programmatic way to make this obvious.
I understand that Hugo is a static site generator – that’s the appeal. WordPress is ridiculously top-heavy for what it does. I’ve been looking at Hugo, Jekyll, and and similar tools.
My question of what exactly is on the server was sparked in part by the write-up on Pygments, which appears to be a server side application. And apparently Hugo includes a web server, but I’m not clear on whether that’s just an optional feature.
I think one thing I’m starting to realize is that static site generators, while being simpler in operation on the server, are much more complex for the user than CMS platforms like WP. It seems like Hugo is designed for developers, so there’s a bit of a learning curve for me. I know HTML and CSS, and that’s about it.
Pygments is “server side”, but in this case it means “build time”.
I have used WordPress for many years and wouldn’t call it simpler if you consider all the stuff/plugins needed for caching, SEO, security, Facebook etc. integration, … and writing WP-shortocdes in PHP isn’t hard, but I find the Hugo way way more intuitive.
I guess it is a mindset thing.
AND Hugo should get better at theming (more and better themes, and an easier way to handle them).
I am on the same boat as Joe in terms of the problem, however my issue is I don’t understand how to get the hugo.exe file on a PATH. I can appreciate this is a totally dumb question, I’ve tried the Hugo course on Udemy but this is also not really clear. Would it be possible to get a clear step by step idea from an expert on how to get hugo.exe into the PATH for myself and future newbies?
I just wrote you a long message explaining what I was doing but thought I’d try it once more and it worked! I thank you sir for taking the time to respond, it is greatly appreciated
Winner, in the long run, you might want to install a Windows PATH editor. The default Windows interface for this is ridiculous, as you’ve noticed — a single field to house a PATH string that can easily go longer than 1,000 characters. Two editor tools built for this purpose are:
You’ll probably want to avoid Windows system directories, like windows\system32 for stuff like Hugo. You don’t want to be messing around in a directory that has critical operating system and application files. It would be safer to create something like c:\hugo or c:\website\hugo (which will of course require you to update the PATH variable.)
+1 To JoeWeb’s suggestion to use a path editor if you’re going to be dealing with Windows paths regularly. If this is a one-off type of thing, I recommend putting Hugo.exe somewhere in the existing path, like C:\Windows\System32.
This will show what’s currently in your path: echo %PATH% and if you want to see if hugo is in your path, use where hugo.
I just downloaded the Windows binary and tried to install.
The thing crashed saying before dying:
ERROR: … Config not found (bla bla bla)
ERROR: … Unable to find Static Directory (bla bla bla)
CRITICAL: … No source directory found (bla bla bla)
I thought that binaries were to exempt us Windows users from the trouble to install from source. It looks like I should have installed a lot of things before firing up the binaries… but I cannot find the information about what I should have installed. Anyone can help ?
It’s not really an install. Copy the hugo_0.12_windows_xxxxxx.exe file to a directory on your hard drive that you can use for your site (e.g., D:\HugoSites). Rename it to just hugo.exe. Open a command prompt window, change to that location and then run the command to generate a new site from scratch:
C:\SomePath> cd D:\HugoSites C:\SomePath> d: D:\HugoSites> hugo new site fooby
This creates a new hugo site in D:\HugoSites\fooby for you to work with.