File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
resources/asciidoctor/lib/chunker Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ def initialize(doc)
1313 # raise ArgumentError, "Missing required attribute 'current-url'" if current_url.nil?
1414 # raise ArgumentError, "Missing required attribute 'outdir'" if outdir.nil?
1515
16- # Hardcoded file path
17- # file_path = File.expand_path('v3-mapping.json', __dir__)
18- # # Read content from the specified file and convert it to a dictionary
19- # mapping = JSON.parse(File.read(file_path)) if File.exist?(file_path)
16+ Hardcoded file path
17+ file_path = File . expand_path ( 'v3-mapping.json' , __dir__ )
18+ # Read content from the specified file and convert it to a dictionary
19+ mapping = JSON . parse ( File . read ( file_path ) ) if File . exist? ( file_path )
2020
2121 segments = outdir . sub ( '/tmp/docsbuild/target_repo/raw' , '' ) . split ( '/' )
2222
@@ -31,15 +31,15 @@ def initialize(doc)
3131 actual_url = '/guide' + path_dir + '/*/' + current_url
3232
3333
34- # if mapping.key?(actual_url)
35- # new_url = mapping[actual_url]
36- # else
37- new_url = '/docs'
38- # end
34+ if mapping . key? ( actual_url )
35+ new_url = mapping [ actual_url ]
36+ else
37+ new_url = '/docs'
38+ end
3939
4040 @header = Asciidoctor ::Block . new ( doc , :pass , source : <<~HTML )
4141 < div id ="url-to-v3 ">
42- From: < a href =" #{ actual_url } " > CURRENT URL </ a >
42+ From: #{ actual_url }
4343 To: < a href ="#{ new_url } "> NEW URL</ a>
4444 </ div>
4545 HTML
You can’t perform that action at this time.
0 commit comments