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
- Navigate to your project directory
- Create a new course using the Hugo command:
hugo new courses/<kebab-style-course-name>/_index.md
- 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: "Month YYYY"
tags: ["tag1", "tag2", "tag3"]
levels: "beginner/intermediate/advanced"
video:
local:
path: /videos/courses/your-course-name/intro-video.webm
poster: "/images/courses/your-course-image.png"
image: "/images/courses/your-course-image.png"
duration: "X hours"
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"
instructors:
- name: "Your Name"
role: "Your Role"
avatar: "/images/placeholders/avatar.svg"
---
# Course content goes here
Creating Lesson Files
- For each lesson in your course, create a new file:
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 minutes"
image: /images/courses/lesson-image.png
video:
local:
path: /videos/courses/your-course-name/lesson-video.webm
poster: /images/courses/lesson-image.png
---
# Lesson content goes here
Organizing Your Files
Ensure your files are organized according to the recommended structure:
content/
└── en/
└── courses/
└── your-course-name/
├── _index.md
├── 010-010-introduction.md
├── 010-020-getting-started.md
├── 020-010-advanced-topic.md
└── ...
Exercise: Create Your Course Files
- Create the course overview file for your planned course
- Create at least three lesson files, following the naming convention
- Fill in the frontmatter for each file with appropriate information
In the next lesson, we’ll focus on writing effective course content using Markdown.