File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
resources/asciidoctor/lib/chunker Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ def initialize(doc)
1111 current_url ||= 'index.html'
1212
1313 # raise ArgumentError, "Missing required attribute 'current-url'" if current_url.nil?
14- raise ArgumentError , "Missing required attribute 'outdir'" if outdir . nil?
14+ # raise ArgumentError, "Missing required attribute 'outdir'" if outdir.nil?
1515
1616 # Hardcoded file path
1717 file_path = File . expand_path ( 'v3-mapping.json' , __dir__ )
@@ -23,8 +23,13 @@ def initialize(doc)
2323
2424 actual_url = '/guide' + path_dir + '/*/' + current_url
2525
26- new_url = mapping [ actual_url ]
27-
26+
27+ if mapping . key? ( actual_url )
28+ new_url = mapping [ actual_url ]
29+ else
30+ new_url = '/docs'
31+ end
32+
2833 @header = Asciidoctor ::Block . new ( doc , :pass , source : <<~HTML )
2934 < div id ="url-to-v3 ">
3035 From: < a href ="#{ actual_url } "> CURRENT URL</ a>
You can’t perform that action at this time.
0 commit comments