cyjake / darko

🐰A Node.js port of Jekyll
82 stars 16 forks source link

Support for _plugins directory #11

Open wojtask9 opened 9 years ago

wojtask9 commented 9 years ago

It would be great if darko could provide support for custom tags and generators located in _plugins directory

Currently I'm able to use "custom tags/generators" but it is very ugly way :)

What do you think about this feature ? It is possible?

cyjake commented 9 years ago

I've kept myself from adopting any plugins because Github Pages only accept vanilla Jekyll. They run jekyll with --safe option turned on.

Anyway, it's merely possible to adopt existing plugins into darko for they are all written in Ruby. I can come up with similar mechanisms for authoring plugins in JavaScript but that'll depend on how much darko users want this feature.

Can you provide some use cases?

wojtask9 commented 9 years ago

We use darko internally for generate documentation, site prototyping, testing etc. Additionaly we use expres with liquid templates (https://github.com/sirlantis/express-liquid-node) for more dynamic pages.

So it would be nice if we can share some of ours "custom tags" by copy tags to _plugins directory and then generate site using darko.

I was thinking about mechanism that can pick tags/generators from _plugins directory in liquid-node style(https://github.com/sirlantis/liquid-node#registration-of-new-tags).

As example you can look at https://github.com/patternfly/patternfly/tree/master/tests-src This project use jekyll for site prototyping.

cyjake commented 9 years ago

I see your point. Darko uses registerTag internally already, for Jekyll specific tags' support. Plugins written in Ruby is a no for Darko, because that's quite absurd to do so.

I'll try to support plugin authoring in JavaScript. Hopefully there will be an alpha version this weekend. It's Labours' Day and we've got a three day holiday in China.

cyjake commented 9 years ago

Aha. It seems Github Pages have got several plugins baked in. https://help.github.com/articles/using-jekyll-plugins-with-github-pages/

Maybe I shall take these official plugins for example, see if I can manage to implement them in Darko and come up with some plugin authoring mechanism.