From 7d6f4a2252a030d03dfb551b0038ad5e372b285d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Thu, 18 Jul 2019 00:00:00 +0000 Subject: [PATCH] asciidoctor: use absolute paths on up links --- asciidoctor/link-target-up.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/asciidoctor/link-target-up.rb b/asciidoctor/link-target-up.rb index 29b4176..cef8c42 100644 --- a/asciidoctor/link-target-up.rb +++ b/asciidoctor/link-target-up.rb @@ -11,7 +11,15 @@ class LinkTargetUp < Asciidoctor::Extensions::InlineMacroProcessor ExternalLinkRegex = /^https?:\/\// def target_base - '..' + # Return an absolute path here because you will + # often want your out/ to be a symlink to your hard + # disk, and doing just '..' in that case breaks. + # + # The downside is that you can't move the repo around + # and still have the HTML work, but other Buildroot things + # will likely break anyways in that case, so this is + # the least of worries. + File.expand_path('..', __dir__) end def process parent, target, attrs