Skip to content

Modifying the website format

Mike Meehan edited this page Jun 27, 2020 · 3 revisions

So you want to be a website developer eh? You came to the right place. We will outline some of the basic information you need to make structural changes to the website pages.

Editing the homepage

The homepage is comprised of menus found at config/_default/menus.toml and widgets at content/home/. In menus.toml, a trailing / in the url = field creates a new page for it while a leading # links the widget in content/home/ with the same name, so clicking that menu option just scrolls you down to where that widget is located on the homepage. If a / is used, the _index.md file in the corresponding directory is a guide to designing that page.

The widgets in content/home/ are simply the markdown files located in the folder. You can simply add new widgets by creating a new markdown file in that folder and making it visible (a setting in the .md file). There are a bunch examples there already that are not visible and all of the widgets to choose from can be found in layouts/partials/widgets/ with the corresponding .html file extension. Note that the content/people/ directory created a new widget page to filter groups of people simply by adding an index.md file to the folder.

Modifying source code

Modifying the source code is a good way to adjust and manipulate pages slightly. We did this with the author's homepages to include personal publications. This code is found in layouts/ and the corresponding folder name. To be honest, you are just going to need to play with the codes from here to really understand how they work (i.e., delete some things and see how the website is updated). One useful place to understand html templating, which is basically the "code" that extracts website content, is https://gohugo.io/functions/ for a detailed list of the functions you have available.