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:
Lorenz Leutgeb
2026-04-20 21:00:04 +02:00
parent 567a6eede6
commit 6309f516c6
11 changed files with 26 additions and 22 deletions
+9 -6
View File
@@ -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