Magnet Docs v1.1.4 archive about feed docs
Wednesday, October 25, 2023 tags: • docs

Commands

The basic process is to create an index of posts, serve those posts, and then build the static site.

go-magnet <COMMAND> -path=<MAGNET DIR PATH>

build

Will run “index” then “serve”, then the “wget” program to capture the site in the “static” 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.

index

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 if they are found in posts.

new

Will create a new blog structure with example posts and docs in the current location by creating the directory name you specify. If no path is supplied the directory “magnet” will be created. Follow the instructions after running this command. This command will not create or overwrite existing directories.

serve

Will run “index” then “serve” up the site on an address, “http://127.0.0.1:8081” as the default. You can check your work, change CSS and so on. You will need to stop the serve and re-run if there are changes that require re-indexing (new posts, changes in metadata and so on).

show

Is a convenience command that runs “index” then “serve”.