Bulding your website with Hugo
What is Hugo?
Hugo is a fast and flexible open-source static site generator designed for developers to build and customize websites efficiently.
Unlike systems that dynamically build a page with each visitor request, Hugo builds pages when you create or update your content. Since websites are viewed far more often than they are edited, Hugo is designed to provide an optimal viewing experience for your website’s end users and an ideal writing experience for website authors. Websites built with Hugo are extremely fast and secure. Hugo sites can be hosted anywhere, including Netlify, Heroku, GoDaddy, DreamHost, GitHub Pages, GitLab Pages, Surge, Firebase, Google Cloud Storage, Amazon S3, Rackspace, Azure, and CloudFront and work well with CDNs. Hugo sites run without the need for a database or dependencies on expensive runtimes like Ruby, Python, or PHP.
Some key features of Hugo:
- Easily manage your homepage, blog posts, publications, talks, and projects
- Configurable widgets available for Biography, Publications, Projects, News/Blog, Talks, and Contact
- Need a different section? Just use the Custom widget!
- Write in Markdown for easy formatting and code highlighting, with LaTeX for mathematical expressions
- Social/academic network linking, Google Analytics, and Disqus comments
- Responsive and mobile friendly
- Simple and refreshing one page design
- Easy to customize
Here are a couple of examples of nice academic websites built with Hugo: Matteo Courthoud, Emmanuel Teitelbaum.
Install Hugo and the Academic Theme
- First of all, install Hugo following the official documentation. Then, create a new website by typing the following commands in your Terminal or Command Prompt:
hugo new site my_website cd my_website
- Then, install the Academic theme:
git clone https://github.com/gcushen/hugo-academic.git themes/academic
Or alternatively, download Academic and extract it into a themes/academic folder within your Hugo website.
- If you are creating a new website, copy the contents of the
exampleSitefolder to your website root folder, overwriting existing files if necessary. TheexampleSitefolder contains an example config file and content to help you get started.
cp -av themes/academic/exampleSite/* .
- Start the Hugo server from your website root folder:
hugo server --watch
Now you can go to localhost:1313 and your new Academic powered website should appear.
- Customize your website - refer to the next subsection below.
- Build your site by running the
hugocommand. Then host it on the CMU Stats directory by copying all the contents of the generatedpublic/directory (by FTP, Rsync, etc.) into the directorypublic_html/that Carl created for you (see here)
Getting Started
Assuming you created a new website with the example content following the installation steps above, the “Getting Started” section in this tutorial explores just a few more steps in order to customize it.
References
Below are some useful links to more extensive external resources. Part of this short guide was adapted from material found on these websites.
- Hugo main page
- Hugo templates
- Self-contained guide to Hugo
- Tutorial: Getting started with the Academic framework for Hugo
- A free 45 minutes course on Hugo on Youtube: Getting Started with Hugo