Config #

Configuration, customization, and data file conventions for hugo-theme-ncsu.

Hugo Settings #

General Hugo config options are listed in the Hugo configuration documentation.

1
2
3
4
baseURL = "" # Set by deploy script
languageCode = "en-us"
title = "NCSU Theme Documentation"
theme = "hugo-theme-ncsu"
  • baseURL: Base URL for the deployed site. Set this to the course website root when manually deploying generated HTML.
  • languageCode: Displayed in the website header as the lang attribute.
  • title: Default website title displayed in browser tabs and search results when no page title is set.
  • theme: Name of this theme in the themes folder.

Theme Parameters #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
[params]
	showToC = true
	showSidebar = true
	showWIP = true
	showFooter = true
	iteration = "Fall 2024"
	year = "2024"
	cshort = "CSC XXX"
	clong = "Example Lecture"
	cfull = "CSC XXX - Example Lecture"
	cdesc = "Some longer course description"
	time = "Monday, Wednesday 6:00pm -- 7:15pm"
	location = "1226 Engineering Building 2 (EB 2)"
  • showToC: Show the autogenerated table of contents on the right.
  • showSidebar: Show the left sidebar from /layouts/partials/sidebar.html.
  • showWIP: Show the work-in-progress notice from /layouts/partials/wip.html.
  • showFooter: Show the site footer from /layouts/partials/footer.html.
  • Course variables can be used in templates with {{ .Site.Params.cshort }} and in Markdown with {{< param "cshort" >}}.

Page front matter can override theme display flags for individual pages.

1
2
3
4
5
+++
showToC = false
showSidebar = true
showFooter = false
+++

Menu entries appear in the top navigation.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
sectionPagesMenu = "main"
[menu]
	[[menu.main]]
		identifier = "about"
		name = "About"
		URL = "/"
		weight = 1
	[[menu.main]]
		identifier = "config"
		name = "Config"
		URL = "/config/"
		weight = 2
	[[menu.main]]
		identifier = "shortcodes"
		name = "Shortcodes"
		URL = "/shortcodes/"
		weight = 3

Use menuHighlight in page front matter when the highlighted navigation item should differ from the page path.

1
2
3
+++
menuHighlight = "config"
+++

Overrides #

Create files with the same path in the site to override theme partials.

Sidebar
/layouts/partials/sidebar.html
Footer
/layouts/partials/footer.html
Work in Progress Notice
/layouts/partials/wip.html
Head Additions
/layouts/partials/head.html

The example site includes its own sidebar override at exampleSite/layouts/partials/sidebar.html.

Assignment Data #

Assignment shortcodes read from /data/assignments.toml.

1
2
3
4
5
6
7
8
[a1]
id = "a1"
name = "Assignment 01"
short_name = "A01"
url = "/course-example#A01"
page = "/course-example#A01"
date = "2024-07-21T13:59:59"
color = "bg-secondary"
id
Stable identifier used by Assignment 01.
name
Full display name.
short_name
Compact badge label.
url
Link target for badge-style output.
page
Link target for default assignment output.
date
Due date used by date and countdown output.
color
Bootstrap badge color class, optionally combined with text classes.

Lecture Data #

Schedule lecture shortcodes read from /data/lectures.toml.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
[intro]
id = "lec-intro"
title = "Course Introduction"
label = "intro"
description = "Included in recording of Lec00"
short = "Guest Lecture"
time = "3 pm"
slides = "https://drive.google.com/..."
recording = "https://ncsu.hosted.panopto.com/..."

[intro.additional]
a1 = {authors="BD Payne, WK Edwards", title="A Brief Introduction to Usable Security", url="https://example.com", venue="IEEE Internet Computing", date="2008", type="paper"}

[intro.mentioned]
m1 = {title="ACM SIGSOFT Empirical Standards for Software Engineering", url="https://example.com", type="website"}
id
Stable identifier used by the lecture shortcode, for example the lec-intro lecture entry.
title
Lecture title.
label
Optional link id and displayed card label. Falls back to id.
description
Optional Markdown-enabled lecture description.
short
Optional text before the lecture title. Falls back to automatic lecture numbering.
time
Optional lecture time override.
slides
Optional slides link.
recording
Optional recording link.
additional
Optional resource table rendered as additional resources.
mentioned
Optional resource table rendered as mentioned resources.