Skip to main content

Pages

In addition to CTFd's built in page editor, CTFd admins can also create pages using ctfcli.

Creating a page with ctfcli

Create the pages folder

In an event repo, the pages folder is a special folder where ctfcli expects all pages to be. To begin create the pages folder with mkdir pages inside of your event repository.

Create a page

Inside of the pages folder create an empty markdown (.md) or html (.html) file. The extension will determine what format CTFd will render the page as.

For our example we will use faq.html.

Define frontmatter

Every CTFd page file must contain frontmatter at the top. At the minimum the frontmatter must contain route and title. For example:

---
title: "FAQ"
route: "faq"
---

Add Page Content

After the front matter we can include our content. In this case HTML content. For example:

---
title: "FAQ"
route: "faq"
---

<h1>This is a heading</h1>
<p>Document content goes here.....</p>

Install/Sync pages

Running the ctf pages install command will take all local pages and install or sync them up into the target CTFd instance.

frontmatter options

  • title - Title for the page
  • route - Route for the page
  • draft - Whether the page is a draft or not
  • hidden - Whether the page shows up in CTFd navigation
  • auth_required - Whether the user must be authenticated to view the page