{% include https://raw.github.com/propublica/guides/master/coding-manifesto.md %}
从该位置提取降价内容并呈现为jekyll布局?
答案 0 :(得分:0)
是的,您可以使用Octokit API执行此操作,但您必须为此编写插件。
请参阅我的网站回购以获取示例:
module Jekyll
class OctokitContents < Liquid::Tag
def initialize(tag_name, text, tokens)
super
@temp=text.split(';')
end
def render(context)
@address = "madhur/"+"#{@temp[0]}"
cred = YAML.load_file("d:/github.yml")
client = Octokit::Client.new(:login => cred[":username"], :password => cred[":password"])
puts "Getting Github Contents via octokit.rb " + @address + @temp[1]
out=client.contents @address, :accept => 'application/vnd.github.html', :path => @temp[1]
out
end
end
end
Liquid::Template.register_tag('octokit_contents', Jekyll::OctokitContents)
对于一个实例,我在这里使用它的方式:
{% octokit_contents SPProjects;OrgChart/Readme.markdown%}
结果如下:
http://www.madhur.co.in/projects/Silverlight%20Organization%20Chart%20for%20SharePoint.html