File tree Expand file tree Collapse file tree 3 files changed +11
-30
lines changed Expand file tree Collapse file tree 3 files changed +11
-30
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ function registerPartials (src) {
82
82
}
83
83
84
84
function registerHelpers ( src ) {
85
+ handlebars . registerHelper ( 'relativize' , relativize )
85
86
handlebars . registerHelper ( 'resolvePage' , resolvePage )
86
87
handlebars . registerHelper ( 'resolvePageURL' , resolvePageURL )
87
88
return vfs . src ( 'helpers/*.js' , { base : src , cwd : src } ) . pipe (
@@ -116,6 +117,10 @@ function copyImages (src, dest) {
116
117
. pipe ( map ( ( file , enc , next ) => next ( ) ) )
117
118
}
118
119
120
+ function relativize ( url ) {
121
+ return url ? ( url . charAt ( ) === '#' ? url : url . slice ( 1 ) ) : '#'
122
+ }
123
+
119
124
function resolvePage ( spec , context = { } ) {
120
125
if ( spec ) return { pub : { url : resolvePageURL ( spec ) } }
121
126
}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ antoraVersion: '3.0.0'
2
2
site :
3
3
url : http://localhost:5252
4
4
title : Brand Docs
5
- homeUrl : &home_url /xyz/5.2/ index.html
5
+ homeUrl : &home_url /index.html
6
6
components :
7
7
- name : abc
8
8
title : Project ABC
72
72
url : ' #'
73
73
urlType : fragment
74
74
- content : Brand’s Hardware & Software Requirements
75
- url : /xyz/5.2/ index.html
75
+ url : /index.html
76
76
urlType : internal
77
77
versions :
78
78
- version : ' 6.0'
@@ -96,13 +96,13 @@ page:
96
96
urlType : fragment
97
97
items :
98
98
- content : Brand’s Hardware & Software Requirements
99
- url : /xyz/5.2/ index.html
99
+ url : /index.html
100
100
urlType : internal
101
101
- content : Cu Solet
102
- url : ' /xyz/5.2/ index.html#cu-solet'
102
+ url : ' /index.html#cu-solet'
103
103
urlType : internal
104
104
- content : English + 中文
105
- url : ' /xyz/5.2/ index.html#english+中文'
105
+ url : ' /index.html#english+中文'
106
106
urlType : internal
107
107
- content : Liber Recusabo
108
108
url : ' #liber-recusabo'
@@ -116,5 +116,5 @@ page:
116
116
url : ' #'
117
117
urlType : fragment
118
118
- content : Some Code
119
- url : ' /xyz/5.2/ index.html#some-code'
119
+ url : ' /index.html#some-code'
120
120
urlType : internal
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments