Erdblock
Overview
Erdblock is a modular personal webpage. The content is presented by different plugins, which return their own express instance.
- API
- addPlugin(plugin, id, priority)
- removePlugin(id)
- setPriorityForPlugin(id, priority)
- locals.title
- locals.subtitle
- locals.profileImage
- locals.coverImage
- Example
- Licence
API
addPlugin(plugin, id, priority)
You can add plugins to an erdblock instance with the addPlugin(plugin)
method.
attrubute | description - | - plugin | plugin object id | to identify the plugin for later manipulation priority | to oder the plugins (higher = first) | (optional)
// init objectvar plugin = // add plugin to erdblockerdblock // or with priorityerdblock
removePlugin(id)
Remove plugin from erdblock.
attrubute | description - | - id | identifyer of the plugin
// remove plugin from erdblockerdblock
setPriorityForPlugin(id, priority)
Set the priority for a added plugin.
attrubute | description - | - id | identifyer of the plugin priority | to oder the plugins (higher = first) |
// set priority for pluginerdblock
locals.title
Title of erdblock (H1)
locals.subtitle
Subtitle of erdblock (H2)
locals.profileImage
Absolute url to the profile image (round)
locals.coverImage
Absolute url to the cover image
Example
// init erdblock objectvar erdblock = // init express objectvar express = var app = // setup url handler for erdblockapp // configure main settingserdblocklocalstitle = "Hello World"erdblocklocalssubtitle = "Subtitle"erdblocklocalsprofileImage = __dirname + "/assets/profile.png"erdblocklocalscoverImage = __dirname + "/assets/cover.png" // configure the plugins, and add them to the erdblock objectvar website = websitelocalsconfigtitle = "Example"websitelocalsconfigurl = "http://www.example.com/"websitelocalsconfigdescription = "Example Description"erdblock // configure additional plugins // configure portapp
Look at the erdblock-default for more examples.
Licence
GNU GENERAL PUBLIC LICENSE Version 2