Magnet Docs v1.1.4 archive about feed docs
Thursday, November 2, 2023 tags: • blog-one

Hello

What’s a static site generator?

Instead of work being done in an application on a remote server, like a CMS (WordPress for instance), work is done locally by Magnet to create the final set of HTML that you then put on a server or S3 or similar setup. Where you put the HTML is up to you.

What are the advantages?

Speed. Without an application or scripting language, the serving of flat HTML pages is faster than creating them on the server.

Security. There’s no application or database or admin endpoints needed on the server for the site, just plain HTML.

Why write in Markdown?

It’s simple, clean, helps removes distraction. If you write creatively it’s not going to get in your way. Markdown is plain text so you can use whatever editor you want. Basic Markdown syntax here.

Take a minute to read more. For settings reference and structure look at the docs here.

Wednesday, November 1, 2023 tags: • blog-one

Running Commands

If you’re looking at this in a browser then you already ran the “go-magnet show” command.

go-magnet <COMMAND> -path<PATH>

Try stopping it and re-running it. You’ll need to stop and restart when you add posts, when you change tags or other metadata. If you’re just adding or editing text in existing posts, you can leave it running and refresh the view in the browser.

Try it now, go to one of the Markdown files in the posts directory and change some text then refresh the page in the browser.

See more about commands.

Tuesday, October 31, 2023 tags: • blog-onesettings

Settings

You’ll see a “site.yaml” file at the root of the magnet directory. 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.

Monday, October 30, 2023 by Susan Essay tags: • posts

New Posts

Try adding a file named “newest.md” to the “posts” directory that looks like this:

---
title: "This Is The Newest Entry"
tags: test
---

This is a new entry in _Markdown_.

Stop and restart the “go-magnet show” command, you should see the new post at the top since there was no “Publish” set in the markdown. It uses the file creation date in that case. You can set “Publish” to whatever date you want as long as it fits the “Y-m-d H:m:s” format.

Sunday, October 29, 2023 by Susan Essay tags: • blog-twoposts

Removing A Post

If you want to remove a post then delete the markdown file and rerun the “go-magnet show” command or add:

live: false

to the metadata in the markdown of the entry you want to unpublish.