Add insert_git_code plugin
此提交包含在:
@@ -0,0 +1,21 @@
|
|||||||
|
require 'open-uri'
|
||||||
|
|
||||||
|
module Jekyll
|
||||||
|
class InsertGitCode < Liquid::Tag
|
||||||
|
|
||||||
|
def initialize(tag_name, url, tokens)
|
||||||
|
super
|
||||||
|
url = url.strip()
|
||||||
|
@filename = File.basename(url)
|
||||||
|
encoded_url = URI.encode(url)
|
||||||
|
@file = URI.parse(encoded_url).read
|
||||||
|
end
|
||||||
|
|
||||||
|
def render(_context)
|
||||||
|
@file
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Liquid::Template.register_tag('insert_git_code', Jekyll::InsertGitCode)
|
||||||
新增問題並參考
封鎖使用者