Magnet Docs v1.1.7 archive docs
tag → settings (3)

Your Site Settings

You’ll see a “site.yaml” file at the root of the magnet directory. See more about the site structure here.

You’ll also see “posts.yaml” files inside directories where posts live.

Try this, stop the “go-magnet show” command, open the “site.yaml” file and change the “pagesize: 5” line to “pagesize: 20”.

Restart go-magnet. You need to restart because this is a change that effects metadata and indices.

You’ll see that the number of posts shown on a single page has changed.

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.

Archive And Blogroll

The markdown for this post lives in the “more-posts” directory. The “posts.yaml” file there says

archive: false

If you click on the archive link, you’ll see the other posts there but not this one.

Likewise, setting

blog-roll: false

in “more-posts/posts.yaml” would exclude any post in that directory from the blogroll, for instance.