Guest User

Untitled

a guest
Dec 11th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. # this plugin adds the variable page.conference to every page
  2. # it does this by grabbing the conference directory from its path
  3. module Jekyll
  4.  
  5. class Page
  6.  
  7. def to_liquid
  8.  
  9. # remove everything before and including 'conferences/' and remove everything after the conference directory name
  10. self.data.deep_merge({
  11. "conference" => File.join(@dir, self.url).sub(/.*conferences\//, '').slice(/[^\/]*/)
  12. })
  13.  
  14. end
  15.  
  16. end
  17.  
  18. end
Add Comment
Please, Sign In to add comment