Site Settings
Site Settings Fields Reference ¶
|_ magnet
|_ site.yaml <-this is the site settings file
|_ posts
|_ images
|_ ...
See what the “go-magnet new” command generates for the site site.yaml. There is only one required value “sitename”, the rest have defaults which you can override.
Site Settings Fields ¶
assets-dir ¶
String. The full path where the assets like CSS and so on are placed.
assets-path-prefix ¶
String. The uri which will be used in serving the assets as linked from the templates. The default is “assets”.
For instance:
http://my-site/assets/css/site.css
---------------^^^^^^-------------
custom-pages ¶
String. A list of simple page names, e.g. “about, contact”. The html for these are expected to be found in the “templates-dir” as the name you have added plus “.html”. The name can be alphanum upper and lower case, with a dash.
For instance:
custom-pages: about, contact, foobar, stuff, Mything-More-Stuff
There should be several html files in the templates directory in this case:
|_ templates
|_ about.html
|_ contact.html
|_ foobar.html
|_ stuff.html
|_ Mything-More-Stuff.html
|_ ...layout, index, other html files
custom-pages-dir ¶
String. The location of the custom pages html. The default location is the templates-dir.
You might want to set this to a different location per site if you have multiple sites using the same theme.
custom-page-prefix ¶
String. The uri that will be served for custom pages. The default is “/s”. So, for instance:
http://my-site/s/about/
---------------^--------
guess-title ¶
Bool. The default is false.
If true, and there is no title in the markdown metadata, a title will be taken from the first H1 if that exists.
# Test Post
Here's some content.
The title field for templating in this case, if guess-title is set, would be “Test Post”.
ignore-future-publish ¶
Bool. The default is false. If true, then any future dated post which doesn’t have a meta “live: false” value, will be displayed. Useful for previewing future dated posts.
image-auto-subdir ¶
Bool. 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 — 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.
image-auto-subdir-len ¶
Integer. Default is two. Only used if image-auto-subdir is true.
image-dir ¶
String. The full path to where go-magnet will find and store images.
If, on indicing, magnet sees a remote image in markdown, it will pull it down to this directory and serve it from there (unless “image-skip-fetch” is set to true).
image-domain ¶
String. 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.
image-err-expires ¶
Int. 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.
image-fetch-exts ¶
List. Default is [“gif”, “png”, “jpg”, “jpeg”, “png”, “webp”, “pnj”].
image-fetch-timeout ¶
Int. The number of seconds before an image fetch request times out. The default is 3 seconds.
image-full-url ¶
Bool. Default false. Use a full url for the img tag in rendered html. This is always “true” for the RSS endpoint. Requires site-remote-address to be set because otherwise what would the url be? image-domain takes precedent and will be used if set.
image-path-prefix ¶
String. The uri element which go-magnet will use. The default is “images”.
http://my-site/images/da836af924596a4c9154f56dd9be82f5.jpg
---------------^^^^^^-------------------------------------
image-skip-fetch ¶
Bool. Default is false. Skip fetching remote images.
index-dir ¶
String. The path where the json indices are kept. The default is to keep this directory in the root of the magnet directory.
markdown-anchors ¶
Bool. Default is false. When parsing the markdown, magnet automatically creates ids and anchors for each heading element.
page-size ¶
Integer. 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.
posts-root-dir ¶
String. The location which should be crawled to find markdown as entries for the site index. The default is the current magnet directory.
render-xhtml ¶
Bool. When converting markdown into HTML, use XHTML instead. Since the included theme templates are doctype HTML this is set to false by default.
robots-file ¶
String. The location of the robots.txt file. The default location is in the “templates-dir”, robots.txt. When the site is built it wants to also include this robots file.
site-local-address ¶
String. The web address of the local magnet site. The default is “http://127.0.0.1:8081”.
site-remote-address ¶
String. The web address used in URLs for templating. The default is empty. You should set it since RSS needs wants to use full addresses.
site-name ¶
String. REQUIRED The name of the site.
site-port ¶
Integer. Defaults to 8081.
static-dir ¶
String. The full path where the “build” of the site using wget will be placed — the static site itself.
Wget is used to crawl against the Go server, using a mirror command, but the root of it will be this “static-dir”.
temp-dir ¶
String. The full path of a directory where temporary work is done on json and images. The default is a “temp” directory inside your magnet directory.
templates-dir ¶
String. Full path of a directory with templates. The default for this is the “template” directory in the theme-name. Included as another way to share a theme across sites.
theme-name ¶
String. The name of the theme in the magnet directory structure. A valid value here must have an appropriately matching directory in the themes folder.
themes-dir ¶
String. The location of the themes directory. The default is “themes” inside your magnet directory.
wget-cmd ¶
Array. A list of strings. This will be the wget command used on the “site-local-address” to write files to the “static-dir”.
Default is: ["-e robots=off", “-nH”, “-m”, “–base=/”, “-P”]. The robots file is pulled in a seprate operation.
For instance, if you wanted to add wget logging, use this in the yaml:
wget-cmd: ["--output-file=wget.log", "-e robots=off", "-nH", "-m", "--base=/", "-P"]
Or, if you want the final links of the static site to be relative (supposing you want to serve it from https://mydomain.com/some-directory/) you could:
wget-cmd: ["--output-file=wget.log", "-e robots=off", "-k", "-nH", "-m", "--base=/", "-P"]
See the Wget documentation here.