<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xml:base="/index.xml" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Magnet Docs</title>
    <link>https://83h3m07h.codeberg.page/go-magnet-docs/</link>
    <description></description>
    <language>en-us</language>
    <generator>magnet v1.2.0</generator>
    
    <item>
        <title>Docs TOC</title>
        <description><![CDATA[<p>• <a href="/post/commands/">Magnet Commands</a><br>
• <a href="/post/markdown/">Markdown and Metadata</a><br>
• <a href="/post/post-settings/">Post Settings</a><br>
• <a href="/post/site-settings/">Site Settings</a><br>
• <a href="/post/site-structure/">Site Structure</a><br>
• <a href="/post/templates/">Themes, Templates, Page Data</a><br>
• <a href="/post/endpoints/">Endpoints</a></p>
]]></description>
        <link>https://83h3m07h.codeberg.page/go-magnet-docs/post/toc/</link>
        <pubDate>Sun, 15 Feb 2026 22:00:00 +0000</pubDate>
        <guid isPermaLink="true">https://83h3m07h.codeberg.page/go-magnet-docs/post/toc/</guid>
    </item>
    
    <item>
        <title>Commands</title>
        <description><![CDATA[<p>The basic process is to create an index of posts, serve those posts, and then build the static site.</p>
<pre><code>go-magnet &lt;COMMAND&gt; -path=&lt;MAGNET DIR PATH&gt;
</code></pre>
<h3>build</h3>
<p>Will run &ldquo;index&rdquo; then &ldquo;serve&rdquo;, then the &ldquo;wget&rdquo; program to capture the site in the &ldquo;static&rdquo; directory by default, but you can set it to write where you want. These will be the files you place on your server. Build will only create pages from what it can find exposed in the templating, if you have a custom page, for instance, but do not link to it anywhere, the page will not be generated.</p>
<h3>index</h3>
<p>Creates the json necessary for lists of entries, for a homepage, archive, tags, author and so on. It will also pull down and index any remote images (by default) if they are found in posts.</p>
<h3>new</h3>
<p>Creates a new blog structure with example posts and docs (this site) in the current location by creating the directory name you specify. If no path is supplied the directory &ldquo;magnet&rdquo; will be created. Follow the instructions after running this command. This command <em>will not</em> create or overwrite existing directories.</p>
<h3>serve</h3>
<p>Will run &ldquo;index&rdquo; then &ldquo;serve&rdquo; up the site on an address, &ldquo;http://127.0.0.1:8081&rdquo; as the default. You can check your work, change CSS and so on.</p>
<p><em>You will need to stop the serve and re-run if there are changes that require re-indexing such as adding new posts and changes in metadata.</em></p>
<h3>show</h3>
<p>Is a convenience command that runs &ldquo;index&rdquo; then &ldquo;serve&rdquo;.</p>
]]></description>
        <link>https://83h3m07h.codeberg.page/go-magnet-docs/post/commands/</link>
        <pubDate>Sun, 15 Feb 2026 21:00:00 +0000</pubDate>
        <guid isPermaLink="true">https://83h3m07h.codeberg.page/go-magnet-docs/post/commands/</guid>
    </item>
    
    <item>
        <title>Markdown</title>
        <description><![CDATA[<p><em>Posts are written in Markdown.</em> They can contain YAML metadata. For instance:</p>
<pre><code>---
title: &quot;Some Title, Be Sure To Use Quotes&quot;
publish: 2020-01-02 10:00:00
---

Here's some __markdown__ text
</code></pre>
<p><em>If no metadata is included</em>, there will be no Title, and the Publish date will be the file creation date.</p>
<p>You <em>should</em> include metadata.</p>
<p>The format of the metadata should be lower case &ldquo;kebab&rdquo; to be consistent with the yaml settings files. However, camel case will also work if you prefer it. Mixed cases like &ldquo;tiTLE&rdquo; will not work. Be consistent, use <a href="https://stackoverflow.com/questions/17326185/what-are-the-different-kinds-of-cases">lower case &ldquo;kebab&rdquo;</a>.</p>
<p><em>Basic HTML is preserved</em>, but complex HTML is not recommended. For this you may want a custom page, which does not parse Markdown (see &ldquo;custom-page&rdquo; in <a href="/post/site-settings/">site settings</a>)</p>
<h2>Markdown Metadata Fields Reference</h2>
<p>Regarding the metadata YAML at the top of each markdown file.</p>
<p>While none of these fields are required, <em>title</em> and <em>publish</em> are recommended.</p>
<p><strong>Example</strong></p>
<pre><code>---
title: &quot;More About Weasels&quot;
publish: 2022-01-15 10:00:00
tags: [nature]
summary: &quot;You didn't know, did you?&quot;
---

The content of my article about weasels here.
</code></pre>
<h2>Markdown Meta Fields</h2>
<h3>authors</h3>
<p><em>List</em>. The name of the author of the entry. A slug will automatically be generated from the author name with dashes instead of spaces.</p>
<pre><code>authors: [&quot;Susan Essay&quot;, &quot;Marvin Markdown&quot;]
</code></pre>
<h3>date</h3>
<p><em>String</em>. See <em>publish</em>. An alias for compatibility.</p>
<h3>expires-days</h3>
<p><em>Int</em>. If set to 1 or greater, the post will expire in N days from the <em>publish</em> date.</p>
<h3>id</h3>
<p><em>String</em>. Must be between 2 and 64 alphanumeric characters. Overrides the default URI for the post which is the filename minus the &ldquo;.md&rdquo; extension.</p>
<p>For instance, if the markdown file is named &ldquo;2025-03-01-Thinger.md&rdquo;, then the post URI is:</p>
<pre><code>/post/2025-03-01-Thinger/
</code></pre>
<p>But if you set the <em>id</em> to &ldquo;my-special-post&rdquo;, then the URI will be:</p>
<pre><code>/post/my-special-post/
</code></pre>
<h3>keywords</h3>
<p><em>String</em>. A string of keywords, for instance, for a local search engine or for templating.</p>
<pre><code>keywords: &quot;here's my keywords&quot;
</code></pre>
<h3>link</h3>
<p><em>String</em>. Unlike the <em>origin-url</em> the <em>link</em> could be used for articles, news or whatever you may want to link to from the post entry in the templating.</p>
<h3>live</h3>
<p><em>Bool</em>. Setting this to false will remove it from site generation. Be aware the individual post html may continue to exist in the static site folder even if unlinked, until you re-build the site.</p>
<h3>pin</h3>
<p><em>Bool</em>. Default is false. If you pin one or more posts, they will appear above the rest of the other posts. The pinned posts will be sorted themselves by whatever sort settings you have, Date ASC/DESC, Path ASC/DESC, for instance. The default is Date Desc. See <a href="/post/site-settings/#posts-sort-asc">settings</a>.</p>
<h3>origin-url</h3>
<p><em>String</em>. Let&rsquo;s suppose you&rsquo;re pulling down and converting some other data, from another site, for instance. You may want to keep track of where the URL was originally found.</p>
<h3>publish</h3>
<p><em>String</em>. The date format is specific here, if it isn&rsquo;t follow magnet will break.</p>
<p><strong>Publish must match this format</strong>:</p>
<pre><code>2019-12-16 10:13:13
</code></pre>
<p><em>Year-Month-Day Hour:Minutes:Seconds</em></p>
<p>If the date is in the future, magnet will <em>not include</em> the post in site generation until that date is reached.</p>
<p>Posts are ordered by date desc for the archive and blogroll. If there are two posts with the exact same date, the first one seen will be the first one placed in the index. There should be no clobbering possible.</p>
<h3>style</h3>
<p><em>String</em>. If declared you can use this in the post entry markup in the templating.</p>
<h3>summary</h3>
<p><em>String</em>. A sentence or two about the post. You can call it out anywhere in templates, particularly the <em>archive</em> endpoint.</p>
<h3>tags</h3>
<p><em>List</em>. A comma seprated list of strings that group posts. Slugs will be created from these names for URLs.</p>
<p>For instance:</p>
<pre><code>tags: [&quot;My Art&quot;, &quot;Thing Stuff&quot;, &quot;And So On&quot;]
</code></pre>
<h3>title</h3>
<p><em>String</em>. Generally you should quote the string. Escape interior quotes with slashes. For instance &ldquo;This \&quot;is my special\&quot; Title!&rdquo;</p>
]]></description>
        <link>https://83h3m07h.codeberg.page/go-magnet-docs/post/markdown/</link>
        <pubDate>Sun, 15 Feb 2026 20:00:00 +0000</pubDate>
        <guid isPermaLink="true">https://83h3m07h.codeberg.page/go-magnet-docs/post/markdown/</guid>
    </item>
    
    <item>
        <title>Post Settings</title>
        <description><![CDATA[<h2>Posts Settings Field Reference</h2>
<p>For every directory within the root of a magnet site (or specified by the &ldquo;posts-root-dir&rdquo; setting) that contains a &ldquo;posts.yaml&rdquo; file, the markdown found there will be added to the site index. The settings <em>are not</em> cumulative, so that children directories do not inherit their parent directories posts.yaml.</p>
<pre><code>|_ magnet
    |_ site.yaml &lt;-this is the site settings file
    |_ posts
        posts.yaml &lt;- this is a posts settings file
        a-post.md  &lt;- a markdown post entry
        |_ blog-one
            |_ my-post.md &lt;- a markdown post entry
            |_ posts.yaml &lt;-this is a posts settings file
        |_ blog-two
            |_ oh-just-one-more-thing.md &lt;- a markdown post entry
            |_ posts.yaml &lt;-this is a posts settings file
</code></pre>
<p><strong>Example posts.yaml</strong></p>
<pre><code>---
name: &quot;my super blog&quot;
skip-archive: false
skip-blog-roll: false
tags: [&quot;My Blog&quot;, &quot;Rocks Are Nice&quot;]
</code></pre>
<p>Setting &ldquo;skip-archive&rdquo; keeps posts from showing up on the archive page. Setting &ldquo;skip-blog-roll&rdquo; keeps posts from showing up on the main blog-roll. The default is false.</p>
<h2>Post Settings Fields</h2>
<h3>authors</h3>
<p><em>List</em>. A list of author names for every post in the directory. These will be added to whatever authors are set in individual posts.</p>
<h3>expires-days</h3>
<p><em>Int</em>. If set to 1 or greater, the posts in this directory will expire in N days from their Publish date.</p>
<h3>name</h3>
<p><em>String</em>. <strong>REQUIRED</strong>. An identifier in the file that tells magnet this directory contains posts, the name can be arbitrary. This is the only required value.</p>
<h3>skip-archive</h3>
<p><em>Bool</em>. Default false. If set to true then posts in the directory don&rsquo;t appear on the archive page.</p>
<h3>skip-blog-roll</h3>
<p><em>Bool</em>. Default false. If set to true then posts in the directory don&rsquo;t appear on the blog roll.</p>
<h3>style</h3>
<p><em>String</em>. If set then the Style markdown meta data for all posts in this directory will have that style string available for templating, to alter with CSS for instance, as &ldquo;Post.Style&rdquo;.</p>
<h3>tags</h3>
<p><em>String</em>. Just like you would use in markdown in the metadata for a post, tags added here will be applied to <em>all the posts</em> in the directory on indexing in addition to whatever tags are set in the post itself.</p>
<pre><code>tags: [foo, bar]
</code></pre>
]]></description>
        <link>https://83h3m07h.codeberg.page/go-magnet-docs/post/post-settings/</link>
        <pubDate>Sun, 15 Feb 2026 19:00:00 +0000</pubDate>
        <guid isPermaLink="true">https://83h3m07h.codeberg.page/go-magnet-docs/post/post-settings/</guid>
    </item>
    
    <item>
        <title>Site Settings</title>
        <description><![CDATA[<h2>Site Settings Fields Reference</h2>
<pre><code>|_ magnet
    |_ site.yaml &lt;-this is the site settings file
    |_ posts
    |_ images
    |_ ...
</code></pre>
<p>See what the &ldquo;go-magnet new&rdquo; command generates for the site site.yaml. There is only one required value &ldquo;sitename&rdquo;, the rest have defaults which you can override.</p>
<h2>Site Settings Fields</h2>
<h3>assets-dir</h3>
<p><em>String</em>. The full path where the assets like CSS and so on are placed. The default a directory called &ldquo;assets&rdquo; in the active theme directory.</p>
<h3>assets-path-prefix</h3>
<p><em>String</em>. The uri which will be used in serving the assets as linked from the templates. The default is &ldquo;assets&rdquo;.</p>
<p>For instance:</p>
<pre><code>http://my-site/assets/css/site.css
---------------^^^^^^-------------
</code></pre>
<h3>custom-pages</h3>
<p><em>List</em>. A list of simple page names. The html for these are expected to be found in the &ldquo;templates-dir&rdquo; as the name you have added plus &ldquo;.html&rdquo;. The name can be alphanum upper and lower case, with a dash.</p>
<p>For instance:</p>
<pre><code>custom-pages: [about, contact, foobar, stuff, Mything-More-Stuff]
</code></pre>
<p>There should be several html files in the templates directory in this case:</p>
<pre><code>|_ templates
    |_ about.html
    |_ contact.html
    |_ foobar.html
    |_ stuff.html
    |_ Mything-More-Stuff.html
    |_ ...layout, index, other html files
</code></pre>
<h3>custom-pages-dir</h3>
<p><em>String</em>. The location of the custom pages html. The default location is the <strong>templates-dir</strong>.</p>
<p>You might want to set this to a different location per site if you have multiple sites using the same theme.</p>
<h3>custom-page-prefix</h3>
<p><em>String</em>. The uri that will be served for custom pages. The default is &ldquo;/s&rdquo;. So, for instance:</p>
<pre><code>http://my-site/s/about/
---------------^--------
</code></pre>
<h3>domain</h3>
<p><em>String</em>. The domain name of your site, if you choose to set it, for templating.</p>
<h3>ignore-future-publish</h3>
<p><em>Bool</em>. The default is false. If true, then any future dated post which doesn&rsquo;t have a meta &ldquo;live: false&rdquo; value, will be displayed. Useful for previewing future dated posts.</p>
<h3>image-auto-subdir</h3>
<p><em>Bool</em>. Default is false. In cases where you are fetching a lot of images from remote urls, you may not want them all together in one directory, for instance, S3 type buckets &mdash; this will create subdirectories from the first two characters (by default) and place the appropriate images there. Be aware that if you toggle this setting back and forth you may be placing images where they later may not be found by the server.</p>
<h3>image-auto-subdir-len</h3>
<p><em>Integer</em>. Default is two. Only used if image-auto-subdir is true.</p>
<h3>image-dir</h3>
<p><em>String</em>. The full path to where go-magnet will find and store images.</p>
<p>If, on indicing, magnet sees a remote image in markdown, it will pull it down to this directory and serve it from there (unless &ldquo;image-skip-fetch&rdquo; is set to true).</p>
<h3>image-domain</h3>
<p><em>String</em>. The name of the domain which will be inserted in the final markup for the capured image. If your images are being uploaded to S3 through some mechanism, it would be set here.</p>
<h3>image-err-expires</h3>
<p><em>Int</em>. The number of seconds waiting before trying to re-fetch an image given that the image fetch returned an error or 404. The default is 1800.</p>
<h3>image-fetch-exts</h3>
<p><em>List</em>. Default is [&ldquo;gif&rdquo;, &ldquo;png&rdquo;, &ldquo;jpg&rdquo;, &ldquo;jpeg&rdquo;, &ldquo;png&rdquo;, &ldquo;webp&rdquo;, &ldquo;pnj&rdquo;].</p>
<p>Be aware, this list is currently <em>case sensitive</em>.</p>
<h3>image-fetch-timeout</h3>
<p><em>Int</em>. The number of seconds before an image fetch request times out. The default is 3 seconds.</p>
<h3>image-full-url</h3>
<p><em>Bool</em>. Default false. Use a full url for the img tag in rendered html. This is always &ldquo;true&rdquo; for the RSS endpoint. Requires <em>site-remote-address</em> to be set because otherwise what would the url be? <em>image-domain</em> takes precedent and will be used if set.</p>
<h3>image-path-prefix</h3>
<p><em>String</em>. The uri element which go-magnet will use. The default is &ldquo;images&rdquo;.</p>
<pre><code>http://my-site/images/da836af924596a4c9154f56dd9be82f5.jpg
---------------^^^^^^-------------------------------------
</code></pre>
<h3>image-skip-fetch</h3>
<p><em>Bool</em>. Default is false. Skip fetching remote images.</p>
<h3>index-dir</h3>
<p><em>String</em>. The path where the json indices are kept. The default is to keep this directory in the root of the magnet directory.</p>
<h3>markdown-anchors</h3>
<p><em>Bool</em>. Default is false. When parsing the markdown, magnet automatically creates ids and anchors for each heading element.</p>
<h3>page-size</h3>
<p><em>Integer</em>. The number of items in each set of pagination. Default is 10. If you have a lot of posts and want to decrease the size of the static site increase this number.</p>
<h3>posts-sort-asc</h3>
<p><em>Bool</em>. If set to true the sort order will be ASC instead of the default DESC.</p>
<h3>posts-sort-path</h3>
<p><em>Bool</em>. If set to true the sort will use the relative path name instead of date. The default sort is Date DESC.</p>
<h3>posts-root-dir</h3>
<p><em>String</em>. The location which should be crawled to find markdown as entries for the site index. The default is the current magnet directory.</p>
<h3>render-xhtml</h3>
<p><em>Bool</em>. When converting markdown into HTML, use XHTML instead. Since the included theme templates are doctype HTML this is set to false by default.</p>
<h3>robots-file</h3>
<p><em>String</em>. The location of the robots.txt file. The default location is in the &ldquo;templates-dir&rdquo;, robots.txt. When the site is built it wants to also include this robots file.</p>
<h3>site-local-address</h3>
<p><em>String</em>. The web address of the local magnet site. The default is &ldquo;http://127.0.0.1:8081&rdquo;.</p>
<h3>site-remote-address</h3>
<p><em>String</em>. The web address used in URLs for templating. The default is empty.</p>
<p><strong>You should set this since valid RSS needs a full address for URLs.</strong></p>
<h3>site-name</h3>
<p><em>String</em>. <strong>REQUIRED</strong> The name of the site.</p>
<h3>site-port</h3>
<p><em>Integer</em>. Defaults to 8081.</p>
<h3>static-dir</h3>
<p><em>String</em>. The full path where the &ldquo;build&rdquo; of the site using wget will be placed &mdash; the static site itself.</p>
<p>Wget is used to crawl against the Go server, using a mirror command, but the root of it will be this &ldquo;static-dir&rdquo;.</p>
<h3>temp-dir</h3>
<p><em>String</em>. The full path of a directory where temporary work is done on json and images. The default is a &ldquo;temp&rdquo; directory inside your magnet directory.</p>
<h3>templates-dir</h3>
<p><em>String</em>. Full path of a directory with templates. The default for this is the &ldquo;template&rdquo; directory in the theme-name. Included as another way to share a theme across sites.</p>
<h3>theme-name</h3>
<p><em>String</em>. The name of the theme in the magnet directory structure. A valid value here <em>must have an appropriately matching directory</em> in the themes folder.</p>
<h3>themes-dir</h3>
<p><em>String</em>. The location of the themes directory. The default is &ldquo;themes&rdquo; inside your magnet directory.</p>
<h3>wget-cmd</h3>
<p><em>Array</em>. A list of strings. This will be the wget command used on the &ldquo;site-local-address&rdquo; to write files to the &ldquo;static-dir&rdquo;.</p>
<p>Default is: [&quot;-e robots=off&quot;, &ldquo;-nH&rdquo;, &ldquo;-m&rdquo;, &ldquo;&ndash;base=/&rdquo;, &ldquo;-P&rdquo;]. The robots file is pulled in a seprate operation.</p>
<p>For instance, if you wanted to add wget logging, use this in the yaml:</p>
<pre><code>wget-cmd: [&quot;--output-file=wget.log&quot;, &quot;-e robots=off&quot;, &quot;-nH&quot;, &quot;-m&quot;, &quot;--base=/&quot;, &quot;-P&quot;]
</code></pre>
<p>Or, if you want the final links of the static site to be relative (supposing you want to serve it from <a href="https://mydomain.com/some-directory/">https://mydomain.com/some-directory/</a>) you could:</p>
<pre><code>wget-cmd: [&quot;--output-file=wget.log&quot;, &quot;-e robots=off&quot;, &quot;-k&quot;, &quot;-nH&quot;, &quot;-m&quot;, &quot;--base=/&quot;, &quot;-P&quot;]
</code></pre>
<p>See the Wget documentation <a href="https://www.gnu.org/software/wget/manual/wget.html">here</a>.</p>
]]></description>
        <link>https://83h3m07h.codeberg.page/go-magnet-docs/post/site-settings/</link>
        <pubDate>Sun, 15 Feb 2026 18:00:00 +0000</pubDate>
        <guid isPermaLink="true">https://83h3m07h.codeberg.page/go-magnet-docs/post/site-settings/</guid>
    </item>
    
</channel>
</rss>
