For a new blog, I like to have the post text stored as markdown (or an other suitable format) on github. But I want to have all the nice features of drupal (comments, nodes, captcha, menu syste, categories, etc.) for the whole blog.

What options do I have to make Drupal retrieve the node body from git (path, branch, tag), render it, and show it as it would have been entered directly into the body text field?

I don't mind whether an import task fetches the content every now and then or if this is done online.

I'm actually open for all ideas as long I can have people forking and improoving the content and at the same time not loosing all the nice things of drupal.

Update: If possible I'd prefer a use this module solution. If this doesn't exist coding hints are of course welcome as well.

1 Answer 1


If the content you are importing is not supposed to be edited, I would suggest to follow the same method used on Drupal.org for some nodes: Implement hook_node_view().
In the Drupal.org case, the hook is used to output dynamic content for nodes that once were written using the PHP filter.

This method would allow showing the updated content without to periodically import the content into the node body, it avoids creating revisions for the node, and it avoids having a node body that is edited, and made different from the Github content.
To improve the performance, you can cache the values grabbed from the github, and avoiding accessing it (through drupal_http_request()) too frequently.

  • Thanks for your answer! Yes, if I start coding that's a good option. I've ben thinking about a new field type as well. But since there are already a lot of people writing their blogs like that, I hope someone points me to nice litle module.
    – BetaRide
    Jan 5, 2013 at 18:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.