Tag: Posts (5 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, which looks like “2026-02-26 10:00:00”.

Whenever you change something like a filename, or something in a post’s metadata, you’ll need to restart Magnet. If you’re changing the body of the post, you can simply refresh the page to see your changes.

Page Layout

The page layout is a template that lives in the currently used theme. Open up “themes/propeller-3.0/templates/layout.html”. You should see some fairly basic HTML as well as some variables rendered by magnet. Note however, the “block content” section. This block is filled in by the “index.html” file, where the HTML for these posts lives. Changing the “layout.html” and “index.html” files lets you render the site very differently.

The theme you’re using is declared here in the site.yaml file:

theme-name: propeller-3.0

…however you can easily copy and rename this directory to whatever you want, changing the html and css to what you like, then put that directory name into the site.yaml file. See more about site structure here.

Be sure to restart the magnet when you change this value.

Tags And Authors

Metadata at the top of each Markdown post can include Tags and Authors.

---
title: "More About Rocks"
publish: 2025-03-01 10:00:00
tags: ["Rocks"]
authors: ["Susan Essay"]
summary: "More than you ever wanted to know about rocks..."
---

Also, Tags and Authors can be included in the Post Settings file:

---
name: "Susan's Posts"
archive: true
blogroll: true
authors: ["Susan Essay"]
tags: ["Geology"]

Tags and Authors for each post are amended — so if the post meta has tags “things, stuff” and the post settings has “geology” then the published post will have the tags “things, stuff, geology”. Likewise Authors.

Post IDs & Custom IDs

This post is about creating custom IDs

You might want to use a custom URI for a posts:

---
title: "Using A Custom Post ID"
publish: 2025-03-16 12:13:13
id: thingstuff
tags: [about-ids]
summary: "Showing a custom ID..."
---

This will be served under:

http://127.0.0.1:8081/post/thingstuff/

where “thingstuff” is used instead of the filename of the post markdown. The filename of this post is “custom-id.md” (you can name posts whatever you want), so without the ID set in metadata the local url would look like:

http://127.0.0.1:8081/post/custom-id/

If there are more than one files named the same (across different post directories for instance) the ID will have a small random suffix added to prevent collision.

A good practice is to name files with two pieces of information, say, date and title. For instance:

20230330-custom-ids.md

Naming like this, consistently, means you’ll be able to easily glance over the file tree to see your posts and also likely avoid naming two files the same thing. One of the purposes of Magnet is to keep everything within a human scope — instead of building and querying a database about your posts, simply use a file tree of plaintext.

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.

page 1 of 1