Skip to content

Plugin system #8

@ericsagnes

Description

@ericsagnes

Not really an issue, but could it be possible and/or useful to have a plugin system?

I think Lambda Pad is a great static site generator framework, but for now every new functionality has to be written from scratch.
Even if it is not that much complicated, it could be appealing for new users to be able to use common features in an easy way.

I have implemented a few blog common features and was thinking that it could be nice to share it as a plugin.

Just an idea but for example in index.erl we could have:

plugins() ->
  [ 'blog', 'foo' ].

and then inside of site we could:

site(Data) ->
  ...
  Posts = plist:value(posts, Data),
  % paginate posts with 10 items per page
  PagedPosts = blog:paginate_data(Posts, 10),
  ...

The main concern would be how to handle the template code as it is not very generic.

For now I have:

  • pagination system (about 25 lines of erlang & 2 templates)
  • post tagging system & tag cloud (about 40 lines of erlang & 2 templates)
  • draft management, delayed publishing and preview mode (about 45 lines of erlang & 1 template)

Feel free to close the ticket if this is out of topic.

Cheers,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions