Magnet Docs v1.1.7 archive docs

Custom Pages

However markdown may be too restrictive — sometimes you may need a custom page instead of a post. See the “about” page. The file for “about” lives in the “templates” directory instead of one of the markdown directories. In Site Settings you’ll see “custompages: about”, which tells Magnet to look for an “about.html” file in templates. If you want to add a new custom page, add a name there and a “name.html” in “templates”. The content for the about page looks like:

{{define "content"}}

<h1>Some Custom page</h1>

<h2>Thing</h2>

This is a custom page. Some more text.

{{end}}

Custom pages are written in HTML, not markdown.

See the “define” part? That puts the content inside the layout template.

Create a new custom page — copy the “about.html” page and name it “contact.html”. Change the Site Settings “site.yaml” line from

custom-pages: about

to

custompages: about, contact

These pages are not posts, they don’t end up in the blogroll or the archive, they are indepedent and you’ll have to call them out in your templates.