Skip to content

Commit

Permalink
Merge pull request #43 from rundeck/exp/fix-titles
Browse files Browse the repository at this point in the history
Fix: page title element should not be blank
  • Loading branch information
gschueler authored Jul 31, 2018
2 parents 208b10d + feac721 commit 53ecf50
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions scripts/edam.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def readIndexFile(File dir){
return index
}
def replaceParams(String templ,Map params,String tokenStart='${', String tokenEnd='}'){
def replaced1=templ.replaceAll(quote('$if(')+'([a-zA-Z_0-9.-]+?)'+quote(')$')+'(.*?)'+quote('$endif$'),{all,match1,match2->
def replaced1=templ.replaceAll(quote(tokenStart+'if(')+'([a-zA-Z_0-9.-]+?)'+quote(')'+tokenEnd)+'(.*?)'+quote(tokenStart+'endif'+tokenEnd),{all,match1,match2->
params[match1]?match2:''
})
def replaced=replaced1.replaceAll('('+quote(tokenStart)+'([a-zA-Z_0-9.-]+?)'+quote(tokenEnd)+')',{all,match1,match2->
Expand Down Expand Up @@ -491,7 +491,7 @@ def generateAll(allpages,toc,templates,File dir, File outdir, crumbs, subdirs){
xvars.srcpagelink=options.srcpagelink?:'Edit This Page'
xvars.srcpageurl=options.srcbaseurl + crumbpath
}
def pargs=['-B',expandFile(templates.header,xvars)]
def pargs=['-B',expandFile(templates.header)]

//set up nav links
def navs=[currentpage:chapLinkTitle(titem),currentpagelink:titem.outfile]+xvars
Expand Down Expand Up @@ -533,21 +533,21 @@ def generateAll(allpages,toc,templates,File dir, File outdir, crumbs, subdirs){
pargs.addAll(['-B',navfileTop])
}

pargs.addAll(['-B',expandFile(templates.before,xvars)])
pargs.addAll(['-A',expandFile(templates.after,xvars)])
pargs.addAll(['-B',expandFile(templates.before)])
pargs.addAll(['-A',expandFile(templates.after)])
if(flags.doNav || flags.recursive){
pargs.addAll(['-A',navfileBot])
}

pargs.addAll(['-A',expandFile(templates.footer,xvars)])
def htemplate=expandFile(templates.html,xvars)
pargs.addAll(['-A',expandFile(templates.footer)])
def htemplate=expandFile(templates.html)
def cssPath= options.cssRelative=='true'? '../'*crumbs.size() : ''
def outfile=new File(outdir,titem.outfile)
pargs.addAll(['-o',outfile.absolutePath,'-s',"--css=${cssPath}${options.cssFileName}","--template=${htemplate.absolutePath}"])
if(titem.index>0){
pargs<<"--toc"
}
pargs.add(expandFile(titem.file,xvars))
pargs.add(expandFile(titem.file))
if(titem.multifiles){
pargs.addAll titem.multifiles
}
Expand Down

0 comments on commit 53ecf50

Please sign in to comment.