A OCWebsite plugin is a smart contract which implements the IVersionableWebsitePlugin interface.
See the interface description.
The OCWebsite Starter Kit Plugin is a template to help you make your OCWebsite plugin. Fork it, build it, and experiment with it.
The following plugins were developed in separate repositories :
- Theme "About Me" : A theme with a configurable left menu. The user is able to configure the theme and publish pages.
- VisualizeValue Mint Frontend : A plugin to host your own artist Mint page by VisualizeValue. The user can configure the theme and other settings in the admin panel.
The following plugins were developed inside the Ocweb repository :
- Injected Variables : Let users add some key/values, which will be made available at the
/variables.json
path. Include the hardcoded address of the OCWebsite being viewed in theself
value. - Static Frontend : A major brick: Let users upload files in a filesystem-like structure, which is then served. Useful to upload static frontend. (
web3://ocweb.eth
is a static website hosted via this plugin). - Admin interface : This add an admin interface to the OCWebsite at the
/admin
path. This plugin is actually proxying the request to the OCWebsite hostingweb3://ocweb.eth
, which detect it is called from another OCWebsite, and adapt slightly his interface.
So far, 2 main patterns have emerged:
- For plugins with small basic output (such as Injected Variables), the whole output is generated in Solidity in the smart contract.
- For plugins with larger output (such as Theme "About Me"), one or more separate OCWebsites are used to host static files (thanks to the Static Frontend plugin), and the plugin will basically proxy the requests to this OCWebsite, and expose an extra path that will contains configuration elements.
So far, 2 main patterns have emerged:
- For configuration elements that impact the output at the smart contract level (e.g. on which root path will the plugin content be served) : they are stored on the smart contract. Example :
struct Config { string[] rootPath; } mapping(IVersionableWebsite => mapping(uint => Config)) private configs;
- For the other configuration elements : they are stored as JSON/YAML/... in a file stored in the filesystem provided by the Static Frontend plugin. This approach offers more flexibility, and is used (alongside the first pattern) by the Theme "About Me" and VisualizeValue Mint Frontend plugin.