Blog plugin demo
A blog with a page per post, a feed and moderated comments – written as an SMS plugin, not built into ForgeCMS. Copy it, change it, make it yours.
Source code of this plugin →This blog is a plugin

The blog you are reading is not part of ForgeCMS. It is a plugin: two files in the content repo of this site.
plugins/blog/plugin.smlsays what the plugin is and which permissions it wants.plugins/blog/plugin.smsis the script, about 600 lines of SMS.
The posts are in blog-plugin-demo/blog.sml, the texts are Markdown files next to it – the same format as the built-in blog module. The script reads them, sorts them, builds the list, a page for every post, the links to the older and newer post and an Atom feed at /blog-plugin-demo/feed.xml.
ForgeCMS runs the script in a sandbox. It can read the text files of the content repo and keep its own records, nothing else: no other files, no network, no programs. Each page view may take a quarter of a second of script time at most – this one takes about two milliseconds.
Comments (0)
Write a comment