Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

markdown + erb? #82

Open
alexdean opened this issue Mar 26, 2013 · 1 comment
Open

markdown + erb? #82

alexdean opened this issue Mar 26, 2013 · 1 comment

Comments

@alexdean
Copy link

I'd like to be able to author blog posts in markdown, but sprinkle in a few helper calls here and there. Does stasis support any way to embed some ruby snippets in a markdown file?

@frank06
Copy link

frank06 commented May 1, 2013

I use files with the .html.md extension and the following in my controller.rb:

# preprocess markdown files through ERB first, in order to use helpers, etc

before /\.md$/ do

  template_erb = Tilt::ERBTemplate.new(_stasis.path)
  out = template_erb.render(self)

  template_md = Tilt['md'].new{ out }
  instead template_md.render(self)

end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants