daily pastebin goal
37%
SHARE
TWEET

Untitled

a guest Dec 11th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top