Creating an episode

Overview

Teaching: 10 min
Exercises: 20 min
Questions
  • How do I add an episode to my lesson?

  • What is this table at the top of my Markdown page?

  • How do I add images? Headers? Code samples?

Objectives
  • Add an episode to your lesson

Add a new episode file

In your repository, click on the _episodes folder, then click on add Add File > Create new file. This will create a new file in the current _episodes directory.

Screenshot of main code listing Screenshot of adding a file

Add header metadata to describe your episode

Once we have a blank page, we need to add the header metadata to it. This is denoted by --- at the top and bottom of the metadata section and helps the webpage buidler fill in information to the episode template.

Screenshot of filled in metadata

Within the --- there are a number of required metadata to fill out:

For example, here is the metadata for this episode:

---
title: "Creating an episode"
teaching: 10
exercises: 20
questions:
- "How do I add an episode to my lesson?"
- "What is this table at the top of my Markdown page?"
- "How do I add images? Headers? Code samples?"
objectives:
- "Add an episode to your lesson"
keypoints:
- "Create a new markdown file in your _episodes directory with header metadata."
- "The section at the top of your markdown is metadata for your episode."
- "The body is formatted in markdown and there are many tutorials available for syntax."
---

All of the above metadata will be used in the main schedule for your lesson as well as incorporated into your episode page automatically!

Add the content using Markdown Syntax

Then you just add all the main content for your episode below the last ---! This content is formatted using Markdown which you can see the format of in the following screenshot.

Screenshot of markdown formatted content

Additionally, here is a quick little primer:

Headers:

# This is an <h1> tag
## This is an <h2> tag
###### This is an <h6> tag

Emphasis:

*This text will be italic*
_This will also be italic_

**This text will be bold**
__This will also be bold__

_You **can** combine them_

Lists:
Unordered:

* Item 1
* Item 2
  * Item 2a
  * Item 2b

Ordered:

1. Item 1
1. Item 2
1. Item 3
   1. Item 3a
   1. Item 3b

Images:

![GitHub Logo](/images/logo.png)
Format: ![Alt Text](url)

Links:

http://github.com - automatic!
[GitHub](http://github.com)

Blockquotes:

As Kanye West said:

> We're living the future so
> the present is our past.

Inline code:

I think you should use an
`<addr>` element here instead.

And additional resources:

Next, Save the content

The last step is to save the content and let the magic happen! To do this, scroll to the bottom of the page and click the “Commit” button at the bottom.

Screenshot of commit page

This will trigger Github Pages to automatically publish your website changes and within a couple of minutes, you can go to your lesson website and see your episode!

Screenshot of rendered page

If there are any issues, don’t panic! Just edit the file on github and make the changes.

Finally, what about my images?

All images should be uploaded into the fig directory on your repository. First navigate back to the main page of your repository, click on the fig folder and then click Add file > Upload files.

Screenshot of upload files link

Next, drag all your images onto the indicated region and then click commit!

Screenshot of upload files listing Screenshot of rendered page

This will take a little time to process. Once it’s done it will trigger your website to be rebuilt and after a few minutes you can refresh the page and find the images there!

Screenshot of final rendered page

Key Points

  • Create a new markdown file in your _episodes directory with header metadata.

  • The section at the top of your markdown is metadata for your episode.

  • The body is formatted in markdown and there are many tutorials available for syntax.