Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # this plugin adds the variable page.conference to every page
- # it does this by grabbing the conference directory from its path
- module Jekyll
- class Page
- def to_liquid
- # remove everything before and including 'conferences/' and remove everything after the conference directory name
- self.data.deep_merge({
- "conference" => File.join(@dir, self.url).sub(/.*conferences\//, '').slice(/[^\/]*/)
- })
- end
- end
- end
Add Comment
Please, Sign In to add comment