module Jekyll class InputProjectTag < Liquid::Tag def initialize(tag_name, text, tokens) super @text = text; end def render(context) site = context.environments.first['site'] #set your project dir. dir = 'Projects' if defined? site.projects_dir dir = site.projects_dir end source = site['source'] #render the variable to the markdown filename content = Liquid::Template.parse(@text).render(context.environments.first) path = File.join(File.join(source, dir), content); input = IO.read(path.strip()) #render the markdown file with the variables of the project. return Liquid::Template.parse(input).render(context) end end end Liquid::Template.register_tag('include_project', Jekyll::InputProjectTag)