Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

best way to use rocco programmatically? #102

Open
adamwong246 opened this issue Jan 1, 2014 · 1 comment
Open

best way to use rocco programmatically? #102

adamwong246 opened this issue Jan 1, 2014 · 1 comment

Comments

@adamwong246
Copy link

I'd like to call rocco in the compilation of my middleman website but Rocco reads and writes to files and it's an ugly hack ( to me) to write to a temporary file. Is there a nice way to call rocco on a string and to a string?

@adamwong246
Copy link
Author

Answer:

<%= rcc = Rocco.new( 'something.rb', [], {} ) { 
<<EOF
  activate :blog do |blog|
    blog.prefix = "blog"
    # blog.permalink = ":year/:month/:day/:title.html"
    # blog.sources = ":year-:month-:day-:title.html"
    # blog.taglink = "tags/:tag.html"
    # blog.layout = "layout"
    # blog.summary_separator = /(READMORE)/
    # blog.summary_length = 250
    # blog.year_link = ":year.html"
    # blog.month_link = ":year/:month.html"
    # blog.day_link = ":year/:month/:day.html"
    # blog.default_extension = ".markdown"

    blog.tag_template = "tag.html"
    blog.calendar_template = "calendar.html"

    # blog.paginate = true
    # blog.per_page = 10
    # blog.page_link = "page/:num"
  end

  page "/feed.xml", :layout => false
EOF
}.to_html %>

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

No branches or pull requests

1 participant