mirror of
https://seed.radicle.dev/rad:z371PVmDHdjJucejRoRYJcDEvD5pp.git
synced 2026-10-18 19:10:34 +08:00
explorer: Allow passing seed and base as arguments
Also take a default value from configuration. Fix all usages and change some hardcoded links to use the filter.
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
module Jekyll
|
||||
module Explorer
|
||||
def explore(input)
|
||||
base = "https://radicle.network/nodes"
|
||||
if input.include?(' ')
|
||||
prefix, suffix = input.split(' ', 2)
|
||||
"#{base}/#{prefix}/#{suffix}"
|
||||
def explore(
|
||||
input,
|
||||
node = @context.registers[:site].config['node'],
|
||||
explorer = @context.registers[:site].config['explorer']
|
||||
)
|
||||
base = "https://#{explorer}"
|
||||
if input.nil?
|
||||
base
|
||||
else
|
||||
"#{base}/iris.radicle.xyz/#{input}"
|
||||
"#{base}/nodes/#{node}/#{input}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user