Skip to content
Get started
Documentation menu

Plugins

This section is for web developers who want to add a feature to a Hatamoto site without changing the server itself. A plugin can react when content is published, change what a page shows, keep its own data, answer its own web addresses and add a page to the admin. It runs in a closed space and can do only what the site owner allows.

Start with the guides: they take you from what a plugin is, through a first build, to a signed package installed on a site. The examples use Go. The reference pages list every manifest field, hook, host function and limit when you need the exact rules.

Guides

  • Overview

    Learn what a plugin can add to your site, what it can never touch, and how your site stays up when a plugin breaks.

  • Hello plugin

    Build the smallest complete plugin, load it into your local server and see it log each publish and add data to every page.

  • React to events

    Write a plugin that runs code each time a page is published and adds a tag to the head of every page on your site.

  • Data and routes

    Write a plugin that stores a number, answers its own web address with it and reports it on a schedule.

  • Add an admin page

    Give your plugin a settings form and a page of its own in the admin, where owners and editors see what it is doing.

  • Package and install

    Turn your plugin into one signed file, install it on a site, update it to a new version and remove it again.

Reference

  • Manifest

    Every field of the plugin.json file that describes a plugin, with its limits, defaults and the rules checked when it loads.

  • Hooks and events

    Every event a plugin can react to and every value it can change, with the data each one receives and what happens when it fails.

  • Host API

    Every function a plugin can call on the server, the permission each one needs, its arguments, its result and its errors.

  • Data, routes and cron

    How a plugin stores its own data, answers web requests and runs on a schedule, and how to prepare the database for plugin data.

  • Admin and templates

    Everything a plugin can add to the admin and to your theme: its own admin page, a settings form, template functions, sections and files.

  • Packaging and signing

    The plugin package file, its size and safety limits, signing keys, trusted signers, registries, and what install, update and uninstall do.

  • First-party plugins

    The two plugins Hatamoto ships, the patterns worth copying from them, and how to write a plugin in a language other than Go.