Note: This page is outdated as of April 4th, 2020.
See each file for documentation on the purpose of the file, how each part works, etc.
Every website page can be defined by the overall template set out in baseof.html. baseof.html sets out head.html, navbar.html, the main section, jumbotron.html, footer.html, and base.html. Each of the main sections is declared and defined by either list.html, single.html, 404.html, or search.html (the main types of pages).
Here is the overview of every page's final form and how it is defined:
Hugo takes the templates in layouts, the content in content, the files in static, and the variables in config.yaml and generates a full static website.
This is the "archetype" for all posts. It is essentially the "template" for each new post.
Below are some common sections within layout files. I have described what they do. Hugo uses {{ }} to enclose its "code". It provides an easy, configurable way to include outside content inside the page.
{{- partial _____ -}} essentially "pulls" another file (a partial) into the page as a section. In the above example, "navbar.html" is being pulled in. This is located in 'layouts/'. See navbar.html for what it does.
{{ define "main" }}
[content here]
{{ end }}
This creates the HTML section which will be the main part of the page's content.
Throughout the layout files you will find references to CSS. The following is a guide to CSS in our website:
CSS files are defined and added to each page in /layouts/partials/_shared/head.html. We use the following CSS files, all located within /static/css/:
JS files are defined and added to each page in /layouts/partials/_shared/js.html and fast-darkmode.html. We use the following JS files, all located within /static/js/:
In-line script for checking dark mode settings
**: defines the function (darkmode_starting_up()) which checks local storage to see if a previous light/dark setting has been stored already.<script async="async" type="text/javascript">darkmode_starting_up();</script>
**: runs the darkmode_starting_up() function, which enables or disables Dark Mode based on the result of local storage query.