In addition to CTFd's built in page editor, CTFd admins can also create pages using ctfcli.
Creating a page with ctfcli
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
Every CTFd page file must contain frontmatter at the top. At the minimum the frontmatter must contain
title. For example:
Add Page Content
After the front matter we can include our content. In this case HTML content. For example:
<h1>This is a heading</h1>
<p>Document content goes here.....</p>
ctf pages install command will take all local pages and install or sync them up into the target CTFd instance.
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