Creating Course Files

Creating Course Files

In this lesson, we’ll walk through the process of creating the necessary files for your course, including the course overview and individual lesson files.

Creating the Course Overview File

  1. Navigate to your project directory
  2. Create a new course using the Hugo command:
hugo new courses/<kebab-style-course-name>/_index.md
  1. Open the _index.md file and fill in the frontmatter:
---
title: "Your Course Title"
description: "A brief description of your course"
summary: "A summary of the course content"
type: "courses"
layout: "course"
date: YYYY-MM-DD
# lastUpdated: "July 2026"             # Optional display override
tags: ["tag1", "tag2", "tag3"]
levels: "beginner/intermediate/advanced"
video:
  youtube: YOUR_VIDEO_ID              # YouTube video ID (recommended)
  # vimeo: 123456789                  # or Vimeo video ID
  # tibav: 42061                      # or TIB AV-Portal ID
image: course-thumbnail.png           # image from _media/ folder
# duration: 90                        # Optional course override in minutes
lessonCount: X
firstLessonURL: "/en/courses/your-course-name/lesson1/"
featured: true/false
certificate: true/false
objectives:
  - "Objective 1"
  - "Objective 2"
prerequisites:
  - "Prerequisite 1"
  - "Prerequisite 2"
programmingLanguages:
  - "Language 1"
  - "Language 2"
authors:
  - name: "Your Name"
    role: "Your Role"
    avatar: "/images/placeholders/avatar.svg"
---

# Course content goes here

Without duration in the course index, the course page automatically sums all lesson durations. Set a numeric minute value there only when you want to override the calculated total. Likewise, without lastUpdated, the newest Git change to the course index or a lesson is displayed automatically.

Creating Lesson Files

Create lessons as individual Markdown files:

hugo new courses/<kebab-style-course-name>/<prefix>-<kebab-style-lesson-name>.md

Open each lesson file and fill in the frontmatter:

---
title: "Lesson Title"
description: "Brief description of the lesson"
type: "courses"
course: "your-course-name"
layout: "lesson"
lessonNumber: X
courseSection: "Course Section Name"
duration: X                           # Optional estimated minutes
image: getting-started/lesson-thumbnail.png  # image from _media/ subfolder
video:
  youtube: YOUR_VIDEO_ID              # YouTube video ID (recommended)
  # vimeo: 123456789                  # or Vimeo video ID
---

# Lesson content goes here

duration: 5 is the shortcut for five minutes. For a more precise value, specify individual components:

duration:
  hours: 1
  minutes: 2
  seconds: 30
  factor: 1.5                       # Optional positive multiplier

All components and factor are optional; the factor defaults to 1. With only factor: 2, the automatic estimate is doubled. Without an explicit lesson duration, Hugo estimates the time from prose, fenced code blocks, and images. The course page adds exact values and only then rounds the total duration up to full minutes.

Organizing Your Files

Ensure your files are organized according to the recommended structure:

content/
└── en/
    └── courses/
        └── your-course-name/
            ├── _index.md
            ├── _media/
            │   ├── index.md
            │   ├── course-thumbnail.png
            │   └── getting-started/
            │       └── lesson-thumbnail.png
            ├── 10-getting-started/
            │   ├── _index.md
            │   ├── 10-introduction.md
            │   └── 20-getting-started.md
            ├── 20-advanced-topics/
            │   ├── _index.md
            │   └── 10-advanced-topic.md
            └── ...

Exercise: Create Your Course Files

  1. Create the course overview file for your planned course
  2. Create at least three lesson files, following the naming convention
  3. Fill in the frontmatter for each file with appropriate information

In the next lesson, we’ll focus on writing effective course content using Markdown.