mirror of
https://seed.radicle.dev/rad:z371PVmDHdjJucejRoRYJcDEvD5pp.git
synced 2026-10-18 19:10:34 +08:00
Also take a default value from configuration. Fix all usages and change some hardcoded links to use the filter.
19 lines
385 B
Ruby
19 lines
385 B
Ruby
module Jekyll
|
|
module Explorer
|
|
def explore(
|
|
input,
|
|
node = @context.registers[:site].config['node'],
|
|
explorer = @context.registers[:site].config['explorer']
|
|
)
|
|
base = "https://#{explorer}"
|
|
if input.nil?
|
|
base
|
|
else
|
|
"#{base}/nodes/#{node}/#{input}"
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
Liquid::Template.register_filter(Jekyll::Explorer)
|