Hugo is both a delightful movie from 2011 and a flexible, fast, open source static website builder. I'm no stranger to static websites, so I'm giving it a try!
-> You will need git installed.
Steps.
1. Install Powershell
2. Use Hugo
3. Using a Domain
4.Publishing a Hugo Site (GitHub Pages)
Installing Powershell
Powershell is not the same as Windows Powershell. I'm using WinGet, the Windows Package Manager. It's a tool that does everything you do in a GUI for Windows Clients, but in the command line.
WinGet also installs Hugo.
Using Hugo
All of this work is in Powershell.
`hugo new site quickstart`
The command makes a new folder called quickstart while populating it with the Hugo things we need.
`git init`
Initializes git.
`git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke`
It clones the repo into the quickstart directory.
`echo "theme = 'ananke'" >> hugo.toml`
copies the theme to the .toml file.
`hugo server`
opens the webpage on a localhost link. Mine looks like this;
The anaki theme looks similar to whatever theme I have on my Google Site;
The steps in the documentation are here.
Let's add and populate another page with the following new content command;
` hugo new content content/posts/my-first-post.md`
Names and places the page in the subdirectory content and posts. I open this in VS Code, deep the `draft = true` tag in place, and edit the file with markdown to get this;
Adding a new page and image
Using a Domain
I have a domain - it points to another website. Adjusting CNAME records (These tell DNS servers where to send people when they put in runtcpip.com) is a pain, so I will pass for now, but it is easy.
Publishing a Hugo Site to GitHub Pages
After making a repo, first I reinitialize git in the quickstart directory.
Second, I make a local git repo while putting the files from quickstart in.
Third, by pushing them from local to the main branch I add the files to the newly made GitHub repo.
With these instructions and this in-depth look at using Git. I couldn't get the images working, so I went through the steps and took it down again.
Closing Thoughts
Was this similar to the old internet? A collection of pages hosted locally, an open port to a directory isolated enough so bad agents did not see your (primitive, at the time) desktop? This was a good exercize in using git to push, add notes, and make a remote repository
Comments
Post a Comment